Hello,
I'm currently doing an electronic safe project at school which involves a PICAXE 08M and an 18X. My problem is that I need to be able to send 6 different 'messages' from my main 18X which runs the main program, to the 08M which plays the tune; and on the circuit Outputs 0 and 1 on the 18X are connected to inputs 3 and 4 on the 08M. I was recommended at school to use the serin and serout commands for sending messages, and so looked the command up in the manual. Problem is, I still have no idea how the code works, and my attempts at programming it in in the editor always return syntax error :/.
An example of my somewhat crappy code from the 08M is as follows (please don't laugh):
Can someone please point out what am I doing wrong, and if I using the right command(s)?
Many thanks, Dracion
I'm currently doing an electronic safe project at school which involves a PICAXE 08M and an 18X. My problem is that I need to be able to send 6 different 'messages' from my main 18X which runs the main program, to the 08M which plays the tune; and on the circuit Outputs 0 and 1 on the 18X are connected to inputs 3 and 4 on the 08M. I was recommended at school to use the serin and serout commands for sending messages, and so looked the command up in the manual. Problem is, I still have no idea how the code works, and my attempts at programming it in in the editor always return syntax error :/.
An example of my somewhat crappy code from the 08M is as follows (please don't laugh):
Code:
main: 'Listen for commands
if pin2=1 then goto alarm
if serin 4,T300_4,goto fail
if serin 4,T600_4,goto congrats
if serin 4,N300_4,goto badbeep
if serin 4,N600_4,goto goodbeep
if serin 4,N1200_4,goto normalbeep
goto main
Many thanks, Dracion