send data from BS2 to the computer
student999
Posts: 9
Hi all
Iam using the BS2 to read from the SRF08 sensors, and I need to transfer the data (readings ) to computer using any of the ports. Can anybody tell me how to do that? and is necessary to transfer the data in a binary form through the I/O pins?
Thanks
Iam using the BS2 to read from the SRF08 sensors, and I need to transfer the data (readings ) to computer using any of the ports. Can anybody tell me how to do that? and is necessary to transfer the data in a binary form through the I/O pins?
Thanks
Comments
"All BASIC Stamps (except the BS1) have a line driver on its SOUT pin (Tpin = 16). See the "Hardware" section of the "Introduction to the BASIC Stamps" chapter. The SOUT pin goes to a PC's serial data-in pin on the DB-9 connector built into BASIC Stamp development boards. The connector is wired to allow both programming and run-time serial communication (unless you are using the Stamp 2 Carrier Board which is only designed for programming). For the built-in serial port set the Tpin argument to 16 in the SEROUT command".
On the BS2 end, then, it's simply a matter of sending your data out through pin 16 using SEROUT. How you read the data on the other end depends on what kind of program you're using, of course. A simple way is to use a terminal program and capture the data to a file. You can have that up and running in minutes.
MyBaud CON 16468
MyValue VAR WORD
SEROUT 16, MyBaud, [noparse][[/noparse]"Hello there", CR] -- will send data out the DB-9 connector
SERIN 16, MyBaud, [noparse][[/noparse]DEC MyValue] -- Will put a decimal string encoded value into "MyValue" from the DB-9 connector.
·
That's why SEROUT 16, [noparse][[/noparse]"Hello!", CR] uses that number "16" in there -- that says, use the 'programming port' on the BS2. Which, since you've been able to program the BS2, you MUST have worked out all the USB to RS232 kinks and know that link works.
thanks again
·· Another option you can look at is called PLX-DAQ.· You can find this on the Parallax website at:
http://www.parallax.com/tabid/441/Default.aspx
·· Using SEROUT, this will allow you to plop data right into an Excel spreadsheet.
[noparse][[/noparse]Tim]