Subscribe to RSS Subscribe to Comments

Sensthethesia

Programs:Thing3.1

Audio Morse Code (Valentine Edition)

;This should define "dots" and "dashes" and then assign operations
;for buzzer-->Morse code
;have redefined dot and dashes to buzzer because we got to that.
;Thomas Engdahl


to Powerup
        write $fc1 $f
        clearbit 0 porta-ddr
        clearbit 0 porta
end

to tick         ;fundamental sound
clearbit 0 porta
setbit 0 porta
end

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

constants [[pitch 46]]

to dot
        runlightred
        repeat 10 [tick repeat pitch [no-op]]
        runlightgreen
        wait 2
end

to dash
        runlightred
        repeat 40 [tick repeat pitch [no-op]]
        runlightgreen
        wait 2
end

to space
        runlightgreen
        wait 5
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

to startup      ;Happy Valentines DAY
        space
MC_I
        space space
MC_L    space
MC_O    space
MC_V    space
MC_E    space
        space space
MC_T    space           ;<--insert loved one here
MC_O    space           ;<--
MC_M    space           ;<--
MC_M    space           ;<--
MC_Y                    ;<--
        space
        space

end

No comments yet. Be the first.

Leave a reply

Based on FluidityTheme Redesigned by Kaushal Sheth Sponsored by Send Flowers