Noiasca Tool Kit
Several helper functions and classes to make life with Arduino easier
|
turnsignals for a car More...
#include <Noiasca_led.h>
Public Member Functions | |
Turnsignal (T &obj) | |
car Turn signal More... | |
void | begin () |
start hardware More... | |
void | setInterval (uint16_t _on, uint16_t _off) |
set on/off times More... | |
void | setOnColor (uint16_t actual, uint32_t _on) |
set on/off color More... | |
void | left () |
left turning signal on More... | |
void | right () |
right turning signal on More... | |
void | hazard () |
hazard turning signal on More... | |
void | setOnStateChange (Callback funcPtr) |
set the callback function onStateChange More... | |
void | update (uint32_t currentMillis=millis()) |
check if update is necessary More... | |
turnsignals for a car
this class needs 3 LEDs (left, right and a hazard warning light in the dashboard).
|
inline |
car Turn signal
This can be used for turning signals on a car. Additionally you can define a hazard indicator on the dashboard which will blink in the rhythm of the turning signals.
obj | a object with 2 or 3 LEDs for turning signals |
|
inline |
start hardware
Will do the necessary steps to initialize the hardware pins. Call this function in your setup().
|
inline |
set on/off times
Set the on and off interval.
_on | the on interval |
_off | the off interval |
|
inline |
set on/off color
Set the on and off colors.
actual | the LED number 0 left, 1 right, 2 hazard |
_on | the on color |
|
inline |
left turning signal on
Turn on the left signal.
|
inline |
right turning signal on
Turn on the right signal.
|
inline |
hazard turning signal on
will activate left and right turning signal and the hazarad light in the dashboard (if defined).
|
inline |
set the callback function onStateChange
a callback function receives state changes from the effect
funcPtr | the callback function |
|
inline |
check if update is necessary
This is the "run" function. Call this function in loop() to make the effect visible.
currentMillis | you can handover a millis timestamp |