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
- Copyright
- Copyright (C) Parallax, Inc. 2012. All Rights MIT Licensed.
Function Documentation
void colorPal_close |
( |
colorPal * |
device | ) |
|
Close a connection and recover all memory set aside for the ColorPal sensor instance.
- Parameters
-
*device | device 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
-
*device | device identifier returned by colorPal_open function. |
r | Red value. |
g | Green value. |
b | Blue value. |
colorPal* colorPal_open |
( |
int |
sioPin | ) |
|
Open a connection to a Parallax ColorPAL sensor.
- Parameters
-
sioPin | Propeller 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
-
@r | 12-bit red value from ColorPal |
@g | 12-bit green value from ColorPal |
@b | 12-bit blue value from ColorPal |
- Returns
- an int with 3 8-bit color bytes in 00rrggbb format.