Skip to content
Alex Krieg edited this page May 25, 2018 · 2 revisions

Functions

  • Led(int pinNr);
  • ~Led();
  • void update();
  • void on();
  • void off();
  • void toggle();
  • void blinkOn(unsigned int interval);
  • void blinkOff();
  • void blinkToggle(unsigned int interval);
  • void blinkInterval(unsigned int interval);
  • unsigned int blinkInterval();
  • bool isOn();
  • bool isBlinking();


Led(int pinNr);

Description

  • Constructor
  • Needs the pinNr on which the led is connected to.

Syntax

Led myLed(3);


~Led();

Description

  • Destructor

Syntax

delete &myLed;


void update();

Description

  • Check if the blink Timer is finished.

Syntax

myLed.update();


void on();

Description

  • Turns the led on.

Syntax

myLed.on();


void off();

Description

  • Turns the led off.

Syntax

myLed.off();


void toggle();

Description

  • Chanches the state of the led.
  • If the led is on, it will be turned off.
  • If the led is off, it will be turned on.

Syntax

myLed.toggle();


void blinkOn(unsigned int interval);

Description

  • Lets the led blinking.
  • Toggles the led in a interval ms of time.
  • Needs the function .update() in your program.

Syntax

myLed.blinkOn(500);


void blinkOff();

Description

  • Turns the blink mode off.

Syntax

myLed.blinkOff();


void blinkToggle(unsigned int interval);

Description

  • Toggles the led blink mode.
  • When the led isn't blinking, it will start blinking.
  • When the led is blinking, it will stop blinking.

Syntax

myLed.blinkToggle();


void blinkInterval(unsigned int intervall);

Description

  • Sets the interval of the bkink mode.

Syntax

myLed.blinkInterval(500);


unsigned int blinkInterval();

Description

  • Gets the interval time of the blink mode back.

Syntax

unsigned int timeInterval = myLed.blinkInterval();


bool isOn();

Description

  • Gets the state of the led back.
  • Returns true if the led is on.
  • Returns false if the led is off.

Syntax

bool state = myLed.isOn();

bool isBlinking();

  • Gets the state of the blink mode back.
  • Returns true if the led is blinking.
  • Returns false if the led isn't blinking.

Syntax

bool state = myLed.isBlinking();