Colby
02-28-2005, 10:30 AM
Here is my situation, I have a basic stamp2, connected to a relay board that takes high and low signals to flip relays. That all works just fine. As of yesterday I have been trying to get the basic stamp to talk to my compter, so I will be able to trigger relays from my compter. I eventually got it working with the following code on my basic stamp useing the debug window to transfer data:
'{STAMP BS2}
choice VAR Byte
DO
SERIN 16, 16468, [choice]
TOGGLE CHOICE
LOOP
I then tried to get this working on my linux box by doing "echo <relaynumber> >> /dev/ttyS0". This would only work after I ran bstamp_run to upload code to the basic stamp. Im assuming when I run that program it changes some serial port settings allowing it to work. So I guess my first question is can anyone tell me how to ajust my serial port settings in linux to get this to work? I cant find any recources online that seem to deal with my issue. Just to try to see if maby it had something to do with the default serial pin (number 16, which i guess is really pin 2) I hooked up a spare serial cable with pin 2 (recieve) hooked into pin 10 on the basic stamp, and serial pin 5 (ground) into ground. And tried SERIN 10, 16468, [choice]. This does not work at all? Am I totally missing something here?
So, I guess im wondering if:
1. Has anyone had any success with serial communication and the basic stamp on linux? And how did you get it working right?
2.How can I attach another serial port to the basic stamp, so I am not limited to the default code uploading / debug port.
My ultimate goal is to be able to have a serial link to a mini-itx board for a more advanced robot. If anyone can help me out with anything it would be greatly appriciated.
Colby
'{STAMP BS2}
choice VAR Byte
DO
SERIN 16, 16468, [choice]
TOGGLE CHOICE
LOOP
I then tried to get this working on my linux box by doing "echo <relaynumber> >> /dev/ttyS0". This would only work after I ran bstamp_run to upload code to the basic stamp. Im assuming when I run that program it changes some serial port settings allowing it to work. So I guess my first question is can anyone tell me how to ajust my serial port settings in linux to get this to work? I cant find any recources online that seem to deal with my issue. Just to try to see if maby it had something to do with the default serial pin (number 16, which i guess is really pin 2) I hooked up a spare serial cable with pin 2 (recieve) hooked into pin 10 on the basic stamp, and serial pin 5 (ground) into ground. And tried SERIN 10, 16468, [choice]. This does not work at all? Am I totally missing something here?
So, I guess im wondering if:
1. Has anyone had any success with serial communication and the basic stamp on linux? And how did you get it working right?
2.How can I attach another serial port to the basic stamp, so I am not limited to the default code uploading / debug port.
My ultimate goal is to be able to have a serial link to a mini-itx board for a more advanced robot. If anyone can help me out with anything it would be greatly appriciated.
Colby