Advertisement
Guest User

Morse code code

a guest
Mar 30th, 2020
493
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. // draw the led wiredwires using turtle
  2. function drawProng(x,y) {
  3. hide();
  4. penUp();
  5. moveTo(x,y);
  6. turnTo(180);
  7. penWidth(5);
  8. penRGB(130,135,136);
  9. penDown();
  10. moveForward(50);
  11. }
  12. onEvent("start", "click", function () { //change to translation sceen and draw the led
  13. setScreen("screen1");
  14. drawProng(170,60);
  15. drawProng(150,60);
  16. });
  17.  
  18. //morse code functions.
  19.  
  20. function wait(milliseconds){
  21. setTimeout(function() {hideElement("placeholder")},milliseconds);
  22. }
  23. function long(){
  24. showElement("flash");
  25. wait(1500); //hold for 1500m and then turn off.
  26. hideElement("flash");
  27. wait(1500); // use my wait function for 1500m before going onto next morse
  28. }
  29. function short(){
  30. showElement("flash");
  31. wait(500)
  32. hideElement("flash"); //hold for 500m and then turn off
  33. wait(500); // wait 500m before going onto next morse.
  34. }
  35. function next() {
  36. wait(1500)
  37. }
  38. function space(){
  39. wait(3500);
  40. }
  41.  
  42.  
  43. //Text box handling portion (this is going to be a nightmare)
  44.  
  45. function letterA(){
  46. short();
  47. long();
  48. next;
  49. }
  50. var A = letterA()
  51.  
  52. onEvent("submit","click", function() {
  53. getText("textBox")
  54. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement