Advertisement
bangnaga

Middle Marker Morse Tone

Sep 26th, 2016
290
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.36 KB | None | 0 0
  1.  
  2.  
  3. /*
  4. Middle marker
  5. A middle marker works on the same principle as an outer marker.
  6. It is normally positioned 0.5 to 0.8 nautical miles (1 km) before the runway threshold.
  7. When the aircraft is above the middle marker, the receiver's amber middle marker light starts blinking,
  8. and a repeating pattern of audible morse code-like dot-dashes at a frequency of 1,300 Hz in the headset.
  9. This alerts the pilot that the CAT I missed approach point (typically 200 feet (60 m) above the ground level on the glideslope)
  10. has been passed and should have already initiated the missed approach if one of several visual cues has not been spotted.
  11.  
  12. */
  13.  
  14. const int buzzerPin = 12;
  15. const int ledPin = 13;
  16. const int tonefreq = 1300;
  17. const int dotlength = 100;                                      
  18. const int dashlength = dotlength * 3;
  19. const int inter = dotlength;
  20.  
  21.  
  22. void setup()
  23. {
  24.   pinMode(buzzerPin, OUTPUT);
  25.   pinMode(ledPin, OUTPUT);
  26.   Serial.begin(9600);
  27. }
  28.  
  29. void loop()
  30. {
  31.     dot();
  32.     dash();
  33.     delay(100);
  34. }
  35.  
  36.  
  37.  
  38.  
  39.  
  40. void dot()
  41. {
  42.   tone(buzzerPin, tonefreq);
  43.   digitalWrite(ledPin, HIGH);
  44.   delay(dotlength);
  45.   noTone(buzzerPin);
  46.   digitalWrite(ledPin, LOW);
  47.   delay(inter);
  48. }
  49.  
  50. void dash()
  51. {
  52.   tone(buzzerPin, tonefreq);
  53.   digitalWrite(ledPin, HIGH);
  54.   delay(dashlength);
  55.   noTone(buzzerPin);
  56.   digitalWrite(ledPin, LOW);
  57.   delay(inter);
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement