PDA

View Full Version : communication between basic stamp, and C++



polymer
04-03-2007, 06:28 AM
Hey! I am doing a project for school where a wiimote can act as an input device for the basic stamp, I thought I could do this by connecting to the wiimote with C++ and then have C++ address the values into memory, which then the basic stamp could access. I don't know if this is possible, but I am hopeful considering it can send debug information back to the PC. If there is anybody who has enough experience to tell me whether this will work or not, I would appreciate some help :).

polymer
04-04-2007, 10:57 AM
I'm not getting any replies :/ . Is it possible to connect the basic stamp to your PC, and take information from the PC for purposes other then compiling?

Mike Green
04-04-2007, 11:09 AM
The Stamp cannot "take" information from the PC. A PC program can take information it has available and transmit it to a Stamp via a serial port. Exactly how to do this (from the PC side) is beyond the scope of these forums. Have a look at Stamp Plot Pro (here: www.selmaware.com/ (http://www.selmaware.com/)) for one example of a PC program that communicates extensively with a Stamp and provides a mechanism for a Stamp to record data it collects.

QuattroRS4
04-04-2007, 11:11 AM
see 'Writing to text files' - in the Basic Stamp Thread

This is a HTML Logger logging in/out serial activity - you can have the stamp waiting for serial data (serin) - this can be sent from this application - assuming the stamp is programmed to react to the string - it carries out whatever you set it to do .. it can then send back (serout) a confirmation string to say action was completed - all transactions both tx and rx are logged in a html file...


http://forums.parallax.com/showthread.php?p=640960

and a link to latest version ... of this program

http://forums.parallax.com/attachment.php?attachmentid=46405

let me know if it fits the bill ....

Regards,
Quattro

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
'Necessity is the mother of invention'

Post Edited (QuattroRS4) : 4/4/2007 4:18:56 AM GMT

polymer
04-04-2007, 12:08 PM
Thanks! This is a good start, I can do something in class tomorrow :D. At any rate, it looks like I'll be using the serin for this. If there are anymore resources people are willing to post, I'll gladly accept it. For now these should help me. Thank you. :)

QuattroRS4
04-04-2007, 12:13 PM
No problem .... post a bit of feedback..

Regards,
Quattro

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
'Necessity is the mother of invention'

polymer
04-13-2007, 12:18 PM
Okay, I know how to use the simple program to send a string, how would I program the basic stamp so that it notices it?, I'm thinking I am going to make it increment the value X or something for each X that gets sent to it. I'll play with this, if you have any simple coding advice/tips I would appreciate it :).

Post Edited (polymer) : 4/13/2007 5:46:09 AM GMT

Mike Green
04-13-2007, 12:45 PM
If you have a program in C++ that runs on a PC and somehow gets data from a wiimote, you can open a serial port from C++ and transmit the data to a Stamp over the serial port as text strings. The Stamp can receive and interpret the strings using SERIN or DEBUGIN statements. If you write the C++ program to allow it, the Stamp could request data from the C++ program using commands much like the sort of thing that StampPlotPro does. Have a look at the StampPlotPro tutorials. They would show you the sort of thing that can be done and what the information going back and forth might look like.

Mike Green
04-13-2007, 12:47 PM
The StampPlotPro tutorials have examples from the Stamp side that show what statements are needed to send a "command" to the PC side and to interpret the information coming back.