ColorPal

BlocklyProp reference for COLORPAL blocks

Available for Activity Board, FLiP, and Other board types. Not available for Badge or Scribbler Robot board types. I/O pin range options will vary with board type.

These blocks use a ColorPal Color Sensor (#28380) 

New to this sensor? Click here to see an example schematic and quick Blockly program to help you get started.


ColorPal initialize

This block launches a processor automatically, one per block instance.

The ColorPal initialize block sets up the ColorPal sensor. If you forget to use this block, other LCD blocks will remind you with a triangle-shaped warning icon:

From the PIN dropdown, select the Propeller I/O pin number that is connected to the ColorPal module's signal pin.

If you use more than one ColorPal initialize block in a project, the other ColorPal blocks will provide a drop-down to select the Propeller I/O pin for your target ColorPal module.


ColorPal raw colors

The ColorPal raw colors block measures the amount of red, green, and blue it detects. Each of those three raw values is stored in the corresponding variable selected in each drop-down menu. The raw values can range from 0 to 4095. The raw values are not white-balanced, but when used correctly, they can be more accurate than the value provided by the ColorPal get color block.

  • Choose the target variables in which to store the ColorPal output values for the R (red), G (green), and B (blue) components of the sampled color.
  • If you are using more than one ColorPal initialize block in a project, select the Propeller I/O pin for the target ColorPal module from the drop-down that will appear.

ColorPal get color

The ColorPal get color block takes a measurement and provides a single, approximate white-balanced,  24-bit color value that is stored in the variable selected in the drop-down.  That variable can then be used with other color value blocks.

  • Choose the target variable in which to store the sampled ColorPal output value.
  • If you are using more than one ColorPal initialize block in a project, select the Propeller I/O pin for the target ColorPal module from the drop-down that will appear.