I switched computers so I don't have some old code available, but here's the gist for the button command. This code is great if all you are using is an 08 or other "primitive" Picaxe that doesn't support interrupts
The sending picaxe does the same sequence as the interrupt example above, but needs to keep the pin in the high state long enough for the receiving Picaxe to cycle through its main loop so it isn't missed.
sending picaxe pseudocode
high 1
pause 50
low 1
serout 1, T2400, ("start", databyte,databyte1,etc)
The receiving Picaxe uses the button command in the main loop to determine if the sending Picaxe wants to send data. If the main loop is long, put more than one BUTTON command in the loop
workvar= 0 ' initialize button byte variable
Main:
button 1,1,0,0,workvar,1,receivedata
<<your main loop code here>>
goto main
receivedata:
serin 1,t2400, ("Start,"
,databyte, databyte1,etc
goto main
' the receiving Picaxe gets the data after the "start" string.
the code snippets are generalized, and haven't been checked, but you get the idea...
Edited by - Larry on 23/04/2006 05:16:31