Hi again... I'm trying to input a number from my PC to the PICAXE. I wrote this code...
main:
serin 4, n2400, b1, b2, b3
for b0 = 1 to b1
high 2
pause 300
low 2
pause 300
next b0
pause 800
for b0 = 1 to b2
high 2
pause 300
low 2
pause 300
next b0
pause 800
for b0 = 1 to b3
high 2
pause 300
low 2
pause 300
next b0
pause 800
serout 1, n2400, ("Hello"
goto main
The PC sends a three digit number. The Picaxe then flashes the LED the correct number of times for the ASCII code of the three digits it has recieved and when it's done it sends "Hello" back to the PC. My VB application displays the "Hello" ok, so that end works too.
But.... If I change the line
serin 4, n2400, b1, b2, b3
to read
serin 4, n2400, #b1, #b2, #b3
which as I understand it should put the actual digits into the variables, not the ASCII codes, nothing happens. The PICAXE just sits as if it is waiting for a SERIN. What am I doing wrong, please?
Richard
main:
serin 4, n2400, b1, b2, b3
for b0 = 1 to b1
high 2
pause 300
low 2
pause 300
next b0
pause 800
for b0 = 1 to b2
high 2
pause 300
low 2
pause 300
next b0
pause 800
for b0 = 1 to b3
high 2
pause 300
low 2
pause 300
next b0
pause 800
serout 1, n2400, ("Hello"
goto main
The PC sends a three digit number. The Picaxe then flashes the LED the correct number of times for the ASCII code of the three digits it has recieved and when it's done it sends "Hello" back to the PC. My VB application displays the "Hello" ok, so that end works too.
But.... If I change the line
serin 4, n2400, b1, b2, b3
to read
serin 4, n2400, #b1, #b2, #b3
which as I understand it should put the actual digits into the variables, not the ASCII codes, nothing happens. The PICAXE just sits as if it is waiting for a SERIN. What am I doing wrong, please?
Richard