WebbotLib AVR library
WebbotLib It just does it
  C++ documentation  C documentation

getPixel

Returns the colour of a given pixel.
The return value is FALSE if there was an error talking to the camera in which case the returned colour has an unreliable value. A value of TRUE means that the function has completed and a returned colour is available.
Syntax
Camera. getPixel(x,y,rtn)
Where Camera is the name you have given to the device in Project Designer.
Parameters
TypeNameDescription
'x'
The x co-ordinate of the pixel.
'y'
The y co-ordinate of the pixel.
'rtn'
The variable to return the color.
Returns
boolean
Example
Example to read the pixel at 10,10 :-
uint16_t x = 10;
uint16_t y = 10;
Color color;
if(camera.getPixel(x, y, color)){
    // The color is in 'color' so lets dump it out
    color.dump();
}else{
    // We had problems talking to the camera
}

 

 

Valid XHTML 1.0 Transitional