I am using Serin and # successfully in several programs (written 6 years ago). Just trying to use them again and cannot seem to get it to work.
I am sending a file from a PC with Tera Term (via USB TTL link) then reading with SERIN on the Picaxe. The file starts like this and is in ASCII:
A08,00,09,30crlf
P14,30,16,00crlf
Y12,00,00,00crlf
If I read like this:
serin [8000,sertimeout],radio,t9600_32,b0,b1,b2,b3,b4,b5,b6,b7,b8,b9,b10,b11,b12,b13
It works perfectly, with b0="A",...B10="3", B11="0", B12=$0D, B13=$0A
If I read like this:
serin [8000,sertimeout],radio,t9600_32,b0,#b1,b19,#b2,b19,#b3,b19,#b4,b19,b19
I get b0="A", B1=8, B2=0, B3=9 but for some reason B4=0 instead of 30
I tried putting another comma after the 30 and before the crlf but still got the same.
I tried changing the 30 to 125 and B4 was then 25.
What am I not understanding? (The manual is extremely light on explanation on the use of #).
I put a 2ms delay between each character on the send side.
I am sending a file from a PC with Tera Term (via USB TTL link) then reading with SERIN on the Picaxe. The file starts like this and is in ASCII:
A08,00,09,30crlf
P14,30,16,00crlf
Y12,00,00,00crlf
If I read like this:
serin [8000,sertimeout],radio,t9600_32,b0,b1,b2,b3,b4,b5,b6,b7,b8,b9,b10,b11,b12,b13
It works perfectly, with b0="A",...B10="3", B11="0", B12=$0D, B13=$0A
If I read like this:
serin [8000,sertimeout],radio,t9600_32,b0,#b1,b19,#b2,b19,#b3,b19,#b4,b19,b19
I get b0="A", B1=8, B2=0, B3=9 but for some reason B4=0 instead of 30
I tried putting another comma after the 30 and before the crlf but still got the same.
I tried changing the 30 to 125 and B4 was then 25.
What am I not understanding? (The manual is extremely light on explanation on the use of #).
I put a 2ms delay between each character on the send side.