![]() |
nanoI2CSlaveExpander
ARDUINO Nano v3 used as I2C slace digital and analog io expander for ESP8266 and others...
|
a Class to flash a LED through nanoI2CIOExpander... More...
#include <nanoI2CIOExpLib.h>
Public Member Functions | |
CFlasherNanoExp () | |
CFlasherNanoExp (int compAdd) | |
void | begin (int pin, unsigned long ton, unsigned long toff) |
to prepare Led Flashing... More... | |
void | begin (int pin, unsigned long ton, unsigned long toff, int repeat, unsigned long period) |
Method to start flasher in repeat mode... More... | |
void | update () |
This function should be call periodicly. More... | |
void | reverseMode () |
Reverse the mode when it should be off it is on and conversely. More... | |
int | getChangeStateCpt () |
to stop flashing after a certain number of times More... | |
void | stop () |
this function stop LED More... | |
void | high () |
to put led allways at ON state More... | |
void | low () |
to put led allways at OFF state More... | |
a Class to flash a LED through nanoI2CIOExpander...
This class is for flashing led with no delay function call with diffrents ton and toff
In setup or elsewhere create a Flasher instance i and call i.begin( pin, ton, toff )
Or begin( pin, ton, toff, repeat, period ) to flash n time in the period.
reverseMode() can be used to inverse on and off times.
They are no default values.
In a loop call i.update();
To return to led off and stop flashing you can call i.stop()
i.getChangeStateCpt() can be used to flash a certain number of times
to put LEd allways on or off call i.high() and i.low() method
Definition at line 77 of file nanoI2CIOExpLib.h.
|
inline |
Definition at line 79 of file nanoI2CIOExpLib.h.
|
inline |
Definition at line 80 of file nanoI2CIOExpLib.h.
void CFlasherNanoExp::begin | ( | int | pin, |
unsigned long | ton, | ||
unsigned long | toff | ||
) |
to prepare Led Flashing...
pin | the pin number where the LED is connected (anode connection and cathod to ground) 0 to 7 |
ton | time during the LED is switched on in milliseconds |
toff | time during the LED is switched off in milliseconds |
Definition at line 190 of file nanoI2CIOExpLib.cpp.
void CFlasherNanoExp::begin | ( | int | pin, |
unsigned long | ton, | ||
unsigned long | toff, | ||
int | repeat, | ||
unsigned long | period | ||
) |
Method to start flasher in repeat mode...
pin | same as in the normal implementation of begin |
ton | same as in the normal implementation of begin |
toff | same as in the normal implementation of begin |
repeat | number of repetitions |
period | total period |
period shall be greter then repeat*( ton + toff )
and repeat shall be greater than 1
Definition at line 223 of file nanoI2CIOExpLib.cpp.
|
inline |
to stop flashing after a certain number of times
Definition at line 85 of file nanoI2CIOExpLib.h.
void CFlasherNanoExp::high | ( | ) |
to put led allways at ON state
Definition at line 323 of file nanoI2CIOExpLib.cpp.
void CFlasherNanoExp::low | ( | ) |
to put led allways at OFF state
Definition at line 334 of file nanoI2CIOExpLib.cpp.
void CFlasherNanoExp::reverseMode | ( | ) |
Reverse the mode when it should be off it is on and conversely.
A second call return to normal state
Definition at line 310 of file nanoI2CIOExpLib.cpp.
void CFlasherNanoExp::stop | ( | ) |
this function stop LED
Warning this function doesn't no prevent update() to work (except that the pin is in input mode)
Definition at line 288 of file nanoI2CIOExpLib.cpp.
void CFlasherNanoExp::update | ( | ) |
This function should be call periodicly.
Function check time with millis function and switch LED if necessary
Definition at line 242 of file nanoI2CIOExpLib.cpp.