|
Author |
Topic: basic stamp basics? + serial communication (Read 2273 times) |
|
crib
|
basic stamp basics? + serial communication
« on: Dec 3rd, 2004, 5:19am » |
|
hello everyone... this my be an easy question but i know nothing about serial port protocol, and the SEROUT paramaters are tricky. i am trying to set up processing to work with my basic stamp 2 sx. i have managed to get the stamp to send data and processing to recieve it, but it comes as a list of 15 numbers, the last of which is the one i was trying to send. my basic code: SEROUT 16, $f0 ,[0] my processing code: void serialEvent() { println(serial); } the list of numbers: 0 112 111 115 105 116 105 111 110 32 61 32 48 13 0 <------the number the stamp sent. any thoughts as to how to isolate the last number, or how to eliminate the rest of the numbers? is it a baudmode or Tpin problem? thanks for any help... -chris
|
|
|
|
crib
|
Re: basic stamp basics? + serial communication
« Reply #1 on: Dec 3rd, 2004, 5:25am » |
|
btw, i read morscads thread, but i didnt get the part about turning the out pin on and off...there is already a one second pause in my basic program loop....
|
|
|
|
mattgilbert
|
Re: basic stamp basics? + serial communication
« Reply #2 on: Dec 3rd, 2004, 7:05am » |
|
i'm not sure what those numbers are, but maybe this will help: a while back i was trying to use SEROUT, and never got it to work. I ended up just using DEBUG, and Processing recieved those messages perfectly. matt
|
|
|
|
crib
|
Re: basic stamp basics? + serial communication
« Reply #3 on: Dec 3rd, 2004, 8:41am » |
|
aha! processing was reading the debug statments earlier in the code....i didn't even thing about that. but it only makes sense that the stamp would still be sending out those debug values, and processing was reading the ascii values....thanks!
|
|
|
|
mohn
|
Re: basic stamp basics? + serial communication
« Reply #4 on: Dec 3rd, 2004, 1:59pm » |
|
the SEROUT has encoding that screws up processing understanding it. most likely you need to adjust how SEROUT is sending the bytes... or you could use the backwards method of DEBUG. nice one mattgilbert. i'll have to remember that little trick.
|
|
|
|
|