One of my past blog entries described in detail my adventures in designing and building the EPROM Reader. When discussing the Windows software I made a brief mention of a sub project that provided a prototype of the communication subsystem within the EPROM Reader Windows software. The sub project consisted of developing an Arduino sketch and Windows application that allowed two way communication between these two devices. The result was a very simple app whose only propose in life was to receive a certain number of bytes from the Arduino and then place them in a list.
Although simple (and quite frankly boring), the app makes use of various C# techniques to send and receive data through the serial port and to update UI elements from an event. I knew it was worthwhile documenting these and other techniques, especially for my own benefit as I was sure I would forget how I did it. The Arduino sketch also makes use of a state machine. I wanted this added complexity because once the state machine is working, it can be enhanced and expanded to support a multitude of features.
To develop and test the state machine I built a simple circuit with three LEDs and a push button. When the push button got pressed it would advance the state machine to the next state. Once I had that working,as illustrated in the YouTube video I made of it, I then modified the code so that the state machine would advance to the next state based on data received from the Windows app. Once both parts (Windows and Arduino) were working I then modified the state machine again so that I could use it in the EPROM reader project.
My Tech Notes on the Windows C# app and Arduino sketch can be found on the following link:
The video provides a detailed description of the Windows app, and all code, including the Arduino sketch, can be downloaded from a link that I provided in the video's description: The EPROM Reader project itself spawned two smaller projects which in themselves were a fantastic learning experience. This part of the fun of diving into a new project, you never know where it will lead!