Apologies if this has been covered here before, but so far my searches haven't pulled much up. I'm thinking of a few uses for an old and somewhat defunct laptop I have lying around, and most of them would involve sending information from the laptop to control components like motors directly. (The idea is appealing since it'd be using the proessing power of the computer for most things, and also because I have more experience in that realm... not to mention potentially being cheap, since I already have the computer!)
Two days ago, i downloaded a simple debug ADC program onto my picaxe 20m2 to get adc values from an IR phototransistor. Code: main: readadc b.3, b0 debug goto main The program downloaded successfully and a window opened showing the adc values. Then I closed that debug window and made a few changes to my IR phototransistor circuit.
Last night I was building my next bot, Hammer, and I got to the point where I had all the electronics more or less completed and some mechanics done too. With some help from my dear friend hot glue I managed to build a shaky test platform. I hoped I could test Sharp IR distance sensor and motors. Maybe even do some simple navigation stuff. Here are a couple of pictures how Hammer looks like right now.
I ran this sketch that would simply read an ADC port and print it out to my pc. It went just fine and results were pretty consistent, something like: 300 300 300 300 300 299 300 300 299 300 300 and so on....
But when I use Serial.print(analogRead(whatever_pin)); in a larger sketch, results are very different, something like: 300 290 305 288 310 315 306 296 and so on. This "larger" sketch has 3 interrupt service routines, and the hardware setup has 3 different chips and a loudspeaker.