Creative debugging

When writing Arduino code I often make heavy use of the serial port in order to debug the code as I go along. However when using an XBee module I don’t have use of the serial port as the XBee is using it. I could use a software serial port but I don’t have the required hardware to make use of one. So I got creative and came up with this.

DSC_8838

It’s a status dial made from a simple servo. Using this I can get about 20 distinct outputs from just 1 Arduino pin!

Yesterday I was trying to debug what was going on by flashing different LEDs different numbers of times. I expect this to be a lot simpler and quicker than: “1..2..3..4..5”…”what does 5 mean again…oh wait it’s started flashing again!…aggghh I’ve lost count”.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s