Thomas Engdahl’s Morse_Code
;This should define "dots" and "dashes" and then asign operations
;for led-->morse code
;could redefine dot and dashes to buzzer when we get to that.
;Thomas Engdahl
to runlightgreen
setbit 0 portc ; set port C0 to high voltage
clearbit 3 portc ; set port C3 to low voltage
end
to runlightred
setbit 3 portc ; set port C3 to high voltage
clearbit 0 portc ; set port C0 to low voltage
end
to runlightoff
clearbit 0 portc ; set both port C0
clearbit 3 portc ; and port C3 to low voltage
end
to dot
runlightred
wait 5
runlightgreen
wait 5
end
to dash
runlightred
wait 10
runlightgreen
wait 5
end
to space
runlightgreen
wait 10
end
to MC_A ;for Morse Code A
dot dash
end
to MC_B
dash dot dot dot
end
to MC_C
dash dot dash dot
end
to MC_D
dash dot dot
end
to MC_E
dot
end
to MC_F
dot dot dash dot
end
to MC_G
dash dash dot
end
to MC_H
dot dot dot dot
end
to MC_I
dot dot
end
to MC_J
dot dash dash dash
end
to MC_K
dash dot dash
end
to MC_L
dot dash dot dot
end
to MC_M
dash dash
end
to MC_N
dash dot
end
to MC_O
dash dash dash
end
to MC_P
dot dash dash dot
end
to MC_Q
dash dash dot dash
end
to MC_R
dot dash dot
end
to MC_S
dot dot dot
end
to MC_T
dash
end
to MC_U
dot dot dash
end
to MC_V
dot dot dot dash
end
to MC_W
dot dash dash
end
to MC_X
dash dot dot dash
end
to MC_Y
dash dot dash dash
end
to MC_Z
dash dash dot dot
end
to MC_0
dash dash dash dash dash
end
to MC_1
dot dash dash dash dash
end
to MC_2
dot dot dash dash dash
end
to MC_3
dot dot dot dash dash
end
to MC_4
dot dot dot dot dash
end
to MC_5
dot dot dot dot dot
end
to MC_6
dash dot dot dot dot
end
to MC_7
dash dash dot dot dot
end
to MC_8
dash dash dash dot dot
end
to MC_9
dash dash dash dash dot
end
to MC_Fullstop
dot dash dot dash dot dash
end
to MC_comma
dash dash dot dot dash dash
end
to MC_Query
dot dot dash dash dot dot
end