colorpal library  v0.51
Simplifies monitoring ColorPAL sensor with the Propeller.
Functions
colorpal.h File Reference

Simplifies reading Parallax ColorPAL sensor. More...

#include "fdserial.h"

Go to the source code of this file.

Functions

colorPal * colorPal_open (int sioPin)
 Open a connection to a Parallax ColorPAL sensor.
void colorPal_close (colorPal *device)
 Close a connection and recover all memory set aside for the ColorPal sensor instance.
void colorPal_getRGB (colorPal *device, int *r, int *g, int *b)
 Get RGB (red green blue) values from the ColorPAL sensor.
unsigned int colorPalRRGGBB (int r, int g, int b)
 Supplies 8-bit white balanced approximations of ColorPal sensor's 12-bit values. Note: The rgb parameters are values, not pointers like they are in the colorPal_getRGB function.

Detailed Description

Simplifies reading Parallax ColorPAL sensor.

Author
Andy Lindsay
Version
0.50

Function Documentation

void colorPal_close ( colorPal *  device)

Close a connection and recover all memory set aside for the ColorPal sensor instance.

Parameters
*devicedevice identifier returned by colorPal_open function.
void colorPal_getRGB ( colorPal *  device,
int *  r,
int *  g,
int *  b 
)

Get RGB (red green blue) values from the ColorPAL sensor.

Parameters
*devicedevice identifier returned by colorPal_open function.
rRed value.
gGreen value.
bBlue value.
colorPal* colorPal_open ( int  sioPin)

Open a connection to a Parallax ColorPAL sensor.

Parameters
sioPinPropeller I/O pin connected to ColorPAL sensor's SIO pin.
Returns
colorPal device identifier for use with functions in colorpal library and functions with text_t parameter in simpletext library.
unsigned int colorPalRRGGBB ( int  r,
int  g,
int  b 
)

Supplies 8-bit white balanced approximations of ColorPal sensor's 12-bit values. Note: The rgb parameters are values, not pointers like they are in the colorPal_getRGB function.

Parameters
@r12-bit red value from ColorPal
@g12-bit green value from ColorPal
@b12-bit blue value from ColorPal
Returns
an int with 3 8-bit color bytes in 00rrggbb format.