105Views4Replies

Author Options:

code? Answered

Heres the code for flashing SOS in morse code on output pin 4 with a piAxe microcontroller so please verify the code if there are some mistakes that i made plzzz help me out.



main: high 4
pause 1000
low 4
pause 1000
high 4
pause 1000
low 4
pause 1000
high 4
pause 1000
low 4
pause 1000
high 4
pause 3000
low 4
pause 1000
high 4
pause 3000
low 4
pause 1000
high 4
pause 3000
low 4
pause 1000
high 4
pause 2000
low 4
pause 1000
high 4
pause 1000
low 4
pause 1000
high 4
pause 1000
low 4
pause 1000
high 4
pause 1000
low 4
pause 1000

Tags:sgfr

Discussions

None
Kiteman

Best Answer 7 years ago

Do I see a 2000 where there should be a 3000?

None
rickharris

7 years ago

Run it in the simulator and see if it does what you expect.

have a look here for a picaxe morse programme

Depending on what is connected to output 4 you may only get a short pip as the output goes high. (you might have an LED on there though I don't know)

You really need to be using the sound command if you expect to hear a tone.

None
robot1398

7 years ago

thanks to both iceing and kiteman!

None
iceng

7 years ago

As Kiteman points out there is a 2000 in the code.
And you need a longer last pause then 3000 at the end of a word
assuming you are sending  SOS__SOS__SOS  Not  SOSSOSSOS.

A