Well, after the couple of comments from this blog, Maus LearningBot - Family Challenge One (State Machine), I've done some reading, recoding and experimenting with some of the concepts suggested of how state machines should work. I've now dubbed this version 2 and it seems to work just as well as version 1. I'll try to explain myself as I walk through the code.

When I'm coding, depending on the programming language, I usually like to sprinkle debugging statements into my code to see data, code decisions and general information while the program is executing. Using the Arduino, I can use the Serial library to stream print statements to the Serial Monitor for example.

Option 1: In code #if

The first option is very simple. At the top of your source file, you put in the following line when you want to turn debugging code on:

The first Library Basics blog covered a basic conversion from a working sketch to a very simple library using the C++ class. User mogul correctly pointed out some code optimizations that we can make. His original message was:

Thanks to the help of my fellow LMR members I now have a working library. I have attached the initial library created as a result of this forum. A big thanks to cr0c0, Maus and Mogule who put a lot of effort into helping me with my code. The attached library is not the final product, I need to add more functions and examples yet (I may also need more help).

I'm currently programming a software oscilloscope based on C++ and DirectX, thus the performance is very good. It works directly off the serial/COM ports. I was just wondering..is anyone else interested in such a thing?

I'm programming it for my Arduino BUT it should be able to work with Picaxe(or anything else) too. It's not gonna be a fancy pro application, but it works pretty damn well :) For now it's rather limited since it only accepts 8 bit values...well for now...