11 #ifndef NANOI2CIOEXPANDER_H 12 #define NANOI2CIOEXPANDER_H 18 #define REGTEST3 0x03 // 0x55 (RO) 19 #define DDR 0x04 // DDR (R/W) 1 for output, default 0 20 #define DR 0x05 // digital DATA (R/W) a write on input bit has no effect 21 #define MINVER 0x06 // Minor version (RO) 22 #define PULLUP 0x07 // puulup reg (R/W) : 1 pullup is enable, default = 0 41 void begin(
int add = 0x5F );
42 void pinMode(
int output,
int mode );
51 int readRegister(
int add );
52 void writeRegister(
int add,
int val);
81 void begin(
int pin,
unsigned long ton,
unsigned long toff);
82 void begin(
int pin,
unsigned long ton,
unsigned long toff,
int repeat,
unsigned long period);
92 int _componentAdd = 0x5F;
95 unsigned long _period = 0;
99 unsigned long _previousMillis;
100 unsigned long _previousPeriod = 0;
102 unsigned long _changeStateCpt;
106 bool _flashingMode =
false;
int getChangeStateCpt()
to stop flashing after a certain number of times
a Class to flash a LED through nanoI2CIOExpander...
void pinMode(int output, int mode)
A method to set the pinMode but...
int digitalRead(int input)
Well knonwn function digitalRead applie to nanoI2CIOExpander but...
void begin(int add=0x5F)
function that start the I2C protocol with nanoI2CIOExpander
void begin(int pin, unsigned long ton, unsigned long toff)
to prepare Led Flashing...
void reverseMode()
Reverse the mode when it should be off it is on and conversely.
void digitalWrite(int output, int value)
CFlasherNanoExp(int compAdd)
void low()
to put led allways at OFF state
int analogRead(int input)
A method tha return 10bits value of one of the 6 analog inputs...
void stop()
this function stop LED
void high()
to put led allways at ON state
bool test()
A special test method that use 2 special register to write and read and display on the Serial monitor...
void update()
This function should be call periodicly.
A class to provide usual io functioon for nanoI2CIOExpander project...