I have made up a circuit with a picaxe 08. It has pins 0,1,2 and 4 as outputs to LEDs. It has pin 3 as a serial and trigger input. It is loaded with the following program:
I have a switch between + and pin3, as well as a serial input cable. the idea is to have several of these. when turned on, depending on the status of pin3, they enter program mode or display mode.
Program: The units wait for their id to be called out. they then set all pins high. It waits for input of a pins value, and writes it to EEPROM 1.
Display: The units read EEPROM 1 and sets it to pins.
I believe the error is in the write command, as when I set it with preloaded messages it can read them. also if i change it so the serin goes
it sets the pins to the right value.
I am confused by this problem and would appreciate any help people can give me.
Code:
symbol unitid = 1
let dirs = %00010111
if pin3 = 1 then
serin 3,N2400,(24,"p",unitid)
pins = %00010111
serin 3,N2400,(60,"v"),b0
write 1,b0
end if
read 1,b0
let pins = b0
Program: The units wait for their id to be called out. they then set all pins high. It waits for input of a pins value, and writes it to EEPROM 1.
Display: The units read EEPROM 1 and sets it to pins.
I believe the error is in the write command, as when I set it with preloaded messages it can read them. also if i change it so the serin goes
Code:
serin 3,N2400m(60,"v"),pins
I am confused by this problem and would appreciate any help people can give me.