-
Notifications
You must be signed in to change notification settings - Fork 0
Led
Alex Krieg edited this page May 25, 2018
·
2 revisions
- 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();
- Constructor
- Needs the pinNr on which the led is connected to.
Led myLed(3);
- Destructor
delete &myLed;
- Check if the blink Timer is finished.
myLed.update();
- Turns the led on.
myLed.on();
- Turns the led off.
myLed.off();
- 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.
myLed.toggle();
- Lets the led blinking.
- Toggles the led in a interval ms of time.
- Needs the function .update() in your program.
myLed.blinkOn(500);
- Turns the blink mode off.
myLed.blinkOff();
- Toggles the led blink mode.
- When the led isn't blinking, it will start blinking.
- When the led is blinking, it will stop blinking.
myLed.blinkToggle();
- Sets the interval of the bkink mode.
myLed.blinkInterval(500);
- Gets the interval time of the blink mode back.
unsigned int timeInterval = myLed.blinkInterval();
- Gets the state of the led back.
- Returns true if the led is on.
- Returns false if the led is off.
bool state = myLed.isOn();
- Gets the state of the blink mode back.
- Returns true if the led is blinking.
- Returns false if the led isn't blinking.
bool state = myLed.isBlinking();
Wiki
Arduino libraries