Solved: My ColorPal randomly shuts down
kaboom
Posts: 12
I got a ColorPal for my birthday. I have decided to start using it with my Arduino. I am starting with color generation. Here is my code.
My issue is that, sometimes the device will randomly shut down. For those who don't know what "=tFFrFFFFFFr000000(00t3FrFF0000r00FF00r0000FFrFF00FFrFFFF00r00FFFF)!" means, it tells my ColorPal to slowly fade from off to white, then fade out, then fade between colors. This actually happens, except...
When I move my system (Arduino, Breadboard, ColorPal, and battery combination) quickly or the ColorPal jiggles or vibrates, it shuts down, flickers a few times, then stays off. When this happens, I must press the reset button to send "=tFFrFFFFFFr000000(00t3FrFF0000r00FF00r0000FFrFF00FFrFFFF00r00FFFF)!" again. Why do I like including that so much?
/*Color sensor has 4 direct comands * = to begin buffering * ! to execute buffer * # to save code to EEPROM * + to get "network" adress * r to display color * t to set transition rate * s to sample ambient/radiant light level * m to sample reflective light color * h for high sensitivity * l for low sensitivity * p to pause for set time*5ms * ( to begin a loop with a number of times to execute, 00 for forever. * ) to end a loop * > is GOTO * ? for random deviation * v to get firmware version * Predefined colors are in datasheet at https://www.parallax.com/sites/default/files/downloads/28380-ColorPAL-Documentation.pdf */ void setup() { Serial.begin(9600); Serial.print("=tFFrFFFFFFr000000(00t3FrFF0000r00FF00r0000FFrFF00FFrFFFF00r00FFFF)!"); }And I am executing "=tFFrFFFFFFr000000(00t3FrFF0000r00FF00r0000FFrFF00FFrFFFF00r00FFFF)!" without the quotes on my sensor.
My issue is that, sometimes the device will randomly shut down. For those who don't know what "=tFFrFFFFFFr000000(00t3FrFF0000r00FF00r0000FFrFF00FFrFFFF00r00FFFF)!" means, it tells my ColorPal to slowly fade from off to white, then fade out, then fade between colors. This actually happens, except...
When I move my system (Arduino, Breadboard, ColorPal, and battery combination) quickly or the ColorPal jiggles or vibrates, it shuts down, flickers a few times, then stays off. When this happens, I must press the reset button to send "=tFFrFFFFFFr000000(00t3FrFF0000r00FF00r0000FFrFF00FFrFFFF00r00FFFF)!" again. Why do I like including that so much?
Comments
Good that you got it going.
Could you provide a specific link to the instructions that need to be fixed?
I may also need a servo cable... But I have one just lying around!
The instructions that need fixing are at https://www.parallax.com/sites/default/files/downloads/28380-ColorPAL-Documentation.pdf. This is the link in my source code. The issue: It is not obvious that you need to force the pin high.
I'll check it out.
2400 and 7200 baud, using a non-inverted, open-drain protocol. The ColorPAL includes a pullup
resistor to Vdd, so you do not need to apply one externally. Because of the open-drain protocol, the pin
used to communicate with the ColorPAL should always be configured as an input, except when being
driven low. Also, when starting up, you should wait for this pin to be pulled high by the ColorPAL before
trying to send it any commands. This is particularly important when connecting it to one of the BOE’s
servo headers, since the three-way power switch will start your PBASIC program before powering up the
ColorPAL.
-Phil
I think the ColorPal is a great device. Phil did a great job designing it.