|
I haven't tried anything else. I figured I could just cycle the 12VDC supply on my end if necessary to restart everything (microcontroller, motor controller, 7-sgement display, and IP camera). The switch is allowing me to turn on/off just the LED headlight or also the IP camera, which is fine for me.
After my previous post, I was able to integrate the switch control into the keypad control code. Now I can turn on/off the light AND control the rover with key presses within the same code.
After I added the switch code to the key pad control (serin.....[dec2 command, dec2 speed, LED), the rover errors (motors turn even after key is lifted). I can recover control by pressing a key a few times. I assume it is tied to the timing which continues to be tricky. I continue to tweak the timing and structure of the code to minimize any errors when switching between key presses or holding down on key for a long period of timing (i.e. sends string of commands for serin variables).
Interestingly enough, I see the same hiccup I get when I press and hold a key to turn the motors using the Terminal Program (macros). I suspected the hiccup was due to the 'key repeat delay', but I am now sure it is the 'key repeat delay' setting and not the timing of the code. The LED light has the same hiccup rythym as the motors when I press and hold a key to turn on light or turn motors (Brief ON....Brief OFF...ON.....). Also, when I check the box in the terminal program which streams the macro command, there is no hiccup; motors and LED turn on immediately. I tried to change the Windows registry so there is no delay (0), but that didn't seem to work or have any noticeable affect. Any suggestions to configure Windows, the terminal program, or other setting to eliminate this hiccup?
Mike
|