After a few hours of clumsy and inept coding, I managed to scrape together a basic windows console application to send data over serial. Right now it just asks you which COM port the Arduino is on (usually COM3), and then you hit enter to turn the lights on/off. All that’s actually happening is the program sending the character ‘1′ or ‘0′ down the serial pipe.
On the other end of the pipe, the Arduino is listening to the serial communication. The sketch I have set up simply sets pin 9 to HIGH when it receives a 1, and LOW when it receives a 0. That’s it. Then the hardware is controlled as discussed in the previous post.

Prototype console application for Arduino Serial communication
So at this point we have:
a) Hardware control of lights
b) Windows console application for serial communication on/off
Which leaves:
c) Having the application read the tracker for wootoff status
d) Packaging it together in a nice, pretty package
So for those following along with an Arduino, I’m posting the Arduino sketch and the console application below. If you want to use a pin other than pin 9 on the arduino, just modify that part at the top of the sketch. Obviously, you should upload the sketch to the Arduino first, exit the Arduino software (since only one application can access the port at a time), identify which port your Arduino is on, and then run the console application. I AM NOT RESPONSIBLE FOR ANY HORRIBLE THINGS THAT RESULT FROM THE USE OF THIS SOFTWARE, largely because I started college as a CS major and switched to EE a year later because I hate coding. That said, it works fine on my and my roommate’s machines.
Post a Comment