EpuckLEDs Class Reference

This class controls the turn on and turn off of e-puck LEDs. More...

#include <epuckLEDs.hpp>

Inheritance diagram for EpuckLEDs:
Collaboration diagram for EpuckLEDs:

List of all members.


Detailed Description

This class controls the turn on and turn off of e-puck LEDs.

Author:
Renato Florentino Garcia
Date:
December 2008

Classes

struct  LEDstate
 Struct with the state of e-puck LEDs. More...

Public Member Functions

 EpuckLEDs (const SerialPort *const serialPort)
 EpuckLEDs class constructor.
void SetRingLED (bool ringLED[RING_LEDS_NUM])
 Set the e-puck ring LEDs.
void SetRingLED (unsigned id, bool state)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
void SetFrontLED (bool state)
 Set the e-puck front LED.
void SetBodyLED (bool state)
 Set the e-puck body LED.
void ClearInternal ()
 Turn off the internal representation of all e-puck LEDs.

Static Public Attributes

static const unsigned RING_LEDS_NUM = 8
 The quantity of LEDs in e-puck ring LEDs.

Private Member Functions

void SendLEDState () const

Private Attributes

LEDstate ledState

Constructor & Destructor Documentation

EpuckLEDs::EpuckLEDs ( const SerialPort *const  serialPort)

EpuckLEDs class constructor.

Parameters:
serialPortPointer for a SerialPort class already created and connected with an e-puck.

References EpuckLEDs::LEDstate::body, EpuckLEDs::LEDstate::front, EpuckLEDs::LEDstate::ring, and RING_LEDS_NUM.


Member Function Documentation

void EpuckLEDs::ClearInternal ( )

Turn off the internal representation of all e-puck LEDs.

This function turn off only the internal representation of the LEDs, in e-puck their state won't change. This is useful in unsubscribe operation, at end of program the LEDs won't chage. But in a new client program execution, only the desired LEDs will tuned on.

References EpuckLEDs::LEDstate::body, EpuckLEDs::LEDstate::front, EpuckLEDs::LEDstate::ring, and RING_LEDS_NUM.

void EpuckLEDs::SetBodyLED ( bool  state)

Set the e-puck body LED.

Parameters:
stateTrue for on, false for off.

References EpuckLEDs::LEDstate::body.

void EpuckLEDs::SetFrontLED ( bool  state)

Set the e-puck front LED.

Parameters:
stateTrue for on, false for off.

References EpuckLEDs::LEDstate::front.

void EpuckLEDs::SetRingLED ( bool  ringLED[RING_LEDS_NUM])

Set the e-puck ring LEDs.

The state of all ring LEDs is given in ringLED parameter.

Parameters:
ringLEDThe state of each ring LED, where true is LED on.
void EpuckLEDs::SetRingLED ( unsigned  id,
bool  state 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

The state of only one LED will be set, the others won't change.

Parameters:
idThe index of the ring LED.
stateThe desired state. True for on, false for off.

References EpuckLEDs::LEDstate::ring.


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