upm  1.7.1
Sensor/Actuator repository for libmraa (v2.0.0)
Public Member Functions

API for the Olimex LoL array. More...

Detailed Description

This module defines the LoL API and implementation for a simple framebuffer.

lolshield.jpg
int
main(int argc, char** argv)
{
upm::LoL sensor;
signal(SIGINT, sig_handler);
// buffer = sensor.getFramebuffer();
int x = 0, y = 0;
while (!is_running) {
sensor.setPixel(x, y, !(sensor.getPixel(x, y)));
if (++x == 13) {
x = 0;
y++;
}
if (y == 9)
y = 0;
upm_delay_us(10000);
}
std::cout << "exiting application" << std::endl;
return 0;
}

Public Member Functions

 LoL ()
 
 ~LoL ()
 
unsigned char * getFramebuffer ()
 
bool getPixel (int x, int y)
 
void setPixel (int x, int y, bool pixel)
 

Constructor & Destructor Documentation

LoL ( )

Instantiates an LoL object singleton

~LoL ( )

LoL object destructor

Member Function Documentation

unsigned char * getFramebuffer ( )

Gets a framebuffer pointer

Returns
0 if successful
bool getPixel ( int  x,
int  y 
)

Gets a pixel at specified coordinates

Parameters
xCoordinate x
yCoordinate y
Returns
true if the pixel is on, false if off
Exceptions
std::invalid_argumentif pixel is out of bounds
void setPixel ( int  x,
int  y,
bool  pixel 
)

Sets a pixel at specified coordinates

Parameters
xCoordinate x
yCoordinate y
pixelfalse is off, true is on
Exceptions
std::invalid_argumentif pixel is out of bounds

The documentation for this class was generated from the following files: