|
Author |
Topic: SEROUT from Stamp STack II (Read 1730 times) |
|
morscad
|
SEROUT from Stamp STack II
« on: Nov 26th, 2004, 11:12am » |
|
Hey everyone I am using the Stamp Stack II (BSX2) and interfacing with processing by the SEROUT command as mentioned by the tutorial on this foum. my pBasic code for the serout is: --------------------- main: IF IN0=1 THEN open IF IN0=0 THEN close open: HIGH 1 DEBUG "1" SEROUT 2,19200,[DEC 49] PAUSE 100 GOTO main close: LOW 1 DEBUG "0" SEROUT 2,19200,[DEC 48] PAUSE 100 GOTO main ------------------------- and I am recieving a signal in processing alright, but the output (when I use the println(serial) method) is "0" for off and "6" for on, and the value doesn't change on this output no matter how I edit the pBasic code. anyone know where I went wrong? would appreciate any help. thanks. O;
|
|
|
|
mKoser
|
Re: SEROUT from Stamp STack II
« Reply #1 on: Nov 28th, 2004, 12:15am » |
|
what speed have you set Processing to recieve serial at? did you use beginSerial() or beginSerial(int)?... and in that case, did you use beginSerial(19200) ? + m
|
mikkel crone koser | www.beyondthree.com | http://processing.beyondthree.com
|
|
|
mohn
|
Re: SEROUT from Stamp STack II
« Reply #2 on: Nov 28th, 2004, 1:23pm » |
|
it would be good to see your processing code as mKoser suggests. the default serial baud rate for processing is 9600. you can set this value in pde.properties in the lib folder. on another note, i ran into a similiar thing working with microchips PIC chips. it had to do with the way the SEROUT was encoding the bits. but not sure if this would be your issue with the Stamp. the issue was that the value would not change and when i adjusted the encoding setting for SEROUT it finally worked. this was a while back and i can't remember what i changed it from and to. sorry. foggy brain today. - mohn
|
|
|
|
morscad
|
Re: SEROUT from Stamp STack II
« Reply #3 on: Nov 30th, 2004, 2:12am » |
|
thanks guys.. the problem turned out to be: I set the baud rate to 19200 with 100 ms pause, so the serial was sending four or five values to the stamp and the process was out of synch. I just had to set the baud to 9600 and turn on the "out" pin for 1 ms and then turn it off for 1000 ms. and tings went back in synch again thanks again
|
|
|
|
mohn
|
Re: SEROUT from Stamp STack II
« Reply #4 on: Nov 30th, 2004, 4:18am » |
|
good news! STAMP on!!!!!! SEROUT can be fussy at times...
|
|
|
|
|