To implement the hardware communication for this project I utilized portions of the CAVERNsoft UDP socket wrappers along with PBASIC code written for the microcontroller as well as a standard C++ node for YG.  The setup for the project is as follows: I start a UDP server on a remote windows machine. This same machine is responsible for connecting directly to the microcontroller via the serial port, and thus requires the use of an I/O Port device driver as well (to get around Windows protections). At this point, the YG application may be started, creating a client node from the UDP class ‘kmStampUDP’. This client node connects to the server via IP, and begins passing data to it in the form of a string. The server receives this string, parses it and passes the data through the serial port to the microcontroller (Basic Stamp).  The Stamp then interprets the data, runs through its’ own processes, and sends data back to the server in hexadecimal. The server formats the data back into a string to send back to the YG client, repeating this process indefinitely. The client node is responsible for initiating the transfer, and will take an argument to set the amount of time between each transfer. Currently, transmissions occur every 1 second, but can be adjusted as needed.

 

flowchart