ColorPAL won't stop flashing color
jacquelinevl03
Posts: 18
Help!! I want to program the ColorPAL sensor, but it won't stop flashing light. I ran sample programs on the ColorPAL, but now they don't seem to stop. Please help, I would like to detect color, not flash color.
Thank you
This is the code that I think keeps running. The ColorPAL keeps flashing colors even though I did run the program, or even if it is not connected to Pin15. As long as it has power it flashes colors.
' =========================================================================
'
' File...... ColorPAL_flicker.bs2
' Purpose... ColorPAL flickering candle imitator.
' Author.... Phil Pilgrim -- Bueno Systems, Inc.
' E-mail.... propeller@phipi.com
' Started... 17 Apr 2009
' Updated... 26 Jan 2010: Changed reset delay from 50 ms. to 80ms.
'
' {$STAMP BS2}
' {$PBASIC 2.5}
'
' =========================================================================
'
[ Program Description ]
' This program programs the ColorPAL to imitate a flickering candle.
' Once programmed, it will run standalone with just +5V and ground
' connections.
'
[ I/O Definitions ]
sio PIN 15 ' Serial I/O com pin for ColorPAL.
'
[ Constants ]
' Baudrate definitions. Serial I/O must be open-drain. The ColorPAL includes
' a pullup internally.
#SELECT $STAMP
#CASE BS2, BS2E, BS2PE
baud CON 119 + 32768
#CASE BS2SX, BS2P
baud CON 327 + 32768
#CASE BS2PX
baud CON 536 + 32768
#ENDSELECT
'
[ Variables ]
red VAR Word ' Received RGB values from ColorPAL.
grn VAR Word
blu VAR Word
'
[ Initialization ]
GOSUB Reset ' Reset the ColorPAL and enter direct command mode.
'
[ Program Code ]
SEROUT sio, baud, ["= (00 ?05 Y t09 F t05 r404000 t09 ) #00"]
PAUSE 1000
SEROUT sio, baud, ["!"]
DO:LOOP
'
[ Subroutines ]
' Reset: Sends a long break to reset ColorPAL and enter direct command mode.
Reset:
LOW sio 'Pull sio low to eliminate any residual charge.
INPUT sio 'Return pin to input.
DO UNTIL sio : LOOP 'Wait for pin to be pulled high by ColorPAL.
LOW sio 'Pull pin low.
PAUSE 80 'Keep low for 80ms to enter Direct mode.
INPUT sio 'Return pin to input.
PAUSE 10 'Pause another 10ms
RETURN
Thank you
This is the code that I think keeps running. The ColorPAL keeps flashing colors even though I did run the program, or even if it is not connected to Pin15. As long as it has power it flashes colors.
' =========================================================================
'
' File...... ColorPAL_flicker.bs2
' Purpose... ColorPAL flickering candle imitator.
' Author.... Phil Pilgrim -- Bueno Systems, Inc.
' E-mail.... propeller@phipi.com
' Started... 17 Apr 2009
' Updated... 26 Jan 2010: Changed reset delay from 50 ms. to 80ms.
'
' {$STAMP BS2}
' {$PBASIC 2.5}
'
' =========================================================================
'
[ Program Description ]
' This program programs the ColorPAL to imitate a flickering candle.
' Once programmed, it will run standalone with just +5V and ground
' connections.
'
[ I/O Definitions ]
sio PIN 15 ' Serial I/O com pin for ColorPAL.
'
[ Constants ]
' Baudrate definitions. Serial I/O must be open-drain. The ColorPAL includes
' a pullup internally.
#SELECT $STAMP
#CASE BS2, BS2E, BS2PE
baud CON 119 + 32768
#CASE BS2SX, BS2P
baud CON 327 + 32768
#CASE BS2PX
baud CON 536 + 32768
#ENDSELECT
'
[ Variables ]
red VAR Word ' Received RGB values from ColorPAL.
grn VAR Word
blu VAR Word
'
[ Initialization ]
GOSUB Reset ' Reset the ColorPAL and enter direct command mode.
'
[ Program Code ]
SEROUT sio, baud, ["= (00 ?05 Y t09 F t05 r404000 t09 ) #00"]
PAUSE 1000
SEROUT sio, baud, ["!"]
DO:LOOP
'
[ Subroutines ]
' Reset: Sends a long break to reset ColorPAL and enter direct command mode.
Reset:
LOW sio 'Pull sio low to eliminate any residual charge.
INPUT sio 'Return pin to input.
DO UNTIL sio : LOOP 'Wait for pin to be pulled high by ColorPAL.
LOW sio 'Pull pin low.
PAUSE 80 'Keep low for 80ms to enter Direct mode.
INPUT sio 'Return pin to input.
PAUSE 10 'Pause another 10ms
RETURN
Comments
Could you post the code that you are using that creates the problem?
'
' File...... ColorPAL_flicker.bs2
' Purpose... ColorPAL flickering candle imitator.
' Author.... Phil Pilgrim -- Bueno Systems, Inc.
' E-mail.... propeller@phipi.com
' Started... 17 Apr 2009
' Updated... 26 Jan 2010: Changed reset delay from 50 ms. to 80ms.
'
' {$STAMP BS2}
' {$PBASIC 2.5}
'
' =========================================================================
'
[ Program Description ]
' This program programs the ColorPAL to imitate a flickering candle.
' Once programmed, it will run standalone with just +5V and ground
' connections.
'
[ I/O Definitions ]
sio PIN 15 ' Serial I/O com pin for ColorPAL.
'
[ Constants ]
' Baudrate definitions. Serial I/O must be open-drain. The ColorPAL includes
' a pullup internally.
#SELECT $STAMP
#CASE BS2, BS2E, BS2PE
baud CON 119 + 32768
#CASE BS2SX, BS2P
baud CON 327 + 32768
#CASE BS2PX
baud CON 536 + 32768
#ENDSELECT
'
[ Variables ]
red VAR Word ' Received RGB values from ColorPAL.
grn VAR Word
blu VAR Word
'
[ Initialization ]
GOSUB Reset ' Reset the ColorPAL and enter direct command mode.
'
[ Program Code ]
SEROUT sio, baud, ["= (00 ?05 Y t09 F t05 r404000 t09 ) #00"]
PAUSE 1000
SEROUT sio, baud, ["!"]
DO:LOOP
'
[ Subroutines ]
' Reset: Sends a long break to reset ColorPAL and enter direct command mode.
Reset:
LOW sio 'Pull sio low to eliminate any residual charge.
INPUT sio 'Return pin to input.
DO UNTIL sio : LOOP 'Wait for pin to be pulled high by ColorPAL.
LOW sio 'Pull pin low.
PAUSE 80 'Keep low for 80ms to enter Direct mode.
INPUT sio 'Return pin to input.
PAUSE 10 'Pause another 10ms
RETURN
When you run a program on the BS2, it is save to the EEPROM on the chip. Every time you power up, it will run that program. To make it stop flashing, and sense colors, you need to load another program in the Basic Stamp Tool, such as the programs found here:
https://www.parallax.com/downloads/colorpal-color-matching-program-and-basic-stamp-sample-files
-Phil
http://forums.parallax.com/discussion/157618/colorpal-28380
I tried your solution to him Phil Pilgrim, but it gave me the error of: "Expected a constant, variable, unary operator, or ("
Yes, that is the program I am using.
Which line of the program gives you this error?
-Phil
When it gives out the error code it highlights the second SEROUT.
-Phil
-Phil
When I ran the program I noticed I had the Pin connection in the wrong slot in the breadboard (right next to the place it should have been in. I did not connect it to the Voltage or Ground, it was just in a slot that had no connection.) so I connected it to the correct pin and it stopped flashing the color. Now it won't respond to programs like flicker, how can I check if the sensor is fine. Or maybe the code that was used made it stop flashing color completely, I am not sure.
-Phil
Fry pork bellies, not Colorpals. Sensor lives matter!