- I have learned the for every peripheral I need a simple test sketch that performs ONLY the functions associated with that device. In this case I have an "IR Test" sketch that simply prints out the code received. Using this, it is clear that my cheap remote does not give consistent codes, but the VCR remote does... Batteries tested and fine, but I do find that the IR works better when a weak 9v is plugged in vs. my 4xAA pack. IR sensitivity is power-related?
- Tried to isolate any bad IR sensors (of the four.) Running one at a time seems to make no difference, but as I unplugged and rewired them...
- I recall a diagram about I sensors that had the sensor pin insulated from the others. AH! Could this be some sort of interference? Is THAT why the sensor and power pins are on opposite sides, with the ground int he middle? Rewiring so the sensor pins & wires are away from positive wires seems to have not effect.
- Further testing indicates... remote functions are FINE until the servo is activated! Check the code: Is there something in the left/right functions I have written that makes the IR code stall? Nothing obvious there...
- What about interference with pins? Can I really use ALL of the pins independently, or are some "paired" such that I can;t use them both? Coincidentally (or perhaps not) I have also lost Speed control since adding more peripherals (eg. using more pins.) Correlation? Perhaps I need to reassign some of the pins to see... NOPE. I moved the servo to A4 (forgot that the analog pins could be used for digital output as well.) No chance of interference there, and still the same results: activating the servo seems to disable the IR.
- BINGO!? A search of "servo interferes with IR" landed this info, which indicates that the power drain from a "stuck" servo WILL interfere with IR and other inputs! So now the trick will be powering the Servo separately... shouldn't be an issue to run it off of the driver board!?! Nope... common ground for all three causes some feedback to the board. OK, a THIRD battery pack just for the servo.... WORKS! SOLVED!
And now... why did I lose speed control?
No comments:
Post a Comment