This tutorial shows you how to deal with the I²C extension!
More...
This tutorial shows you how to deal with the I²C extension!
- Note
- To use this:
#define EBOARD_I2C 0x1
#define EBOARD_I2C_HELPER
If you use the ARDUINO MEGA the I2C pins are not A4 (SDA) and A5 (SDL). They are seperate (20-SDA;21-SDL)!
- It is possible to send Data via I2C with sendI2C()
- It is possible to read Data via I2C with readI2C()
- It is possible to scan for I2C addresses with pingI2C();
Example
An Example of how to scan for I2C addresses:
#define EBOARD_I2C 0x1
#define EBOARD_I2C_HELPER
#include <eBoard.h>
Serial.println(test[0]);
return 0;
}
Connected an PCF8591 this produces this output:
72
0 -- Exit Code.
Program has finished. Reset to start again
- Note
- The size of the optVAL_t array can be as big as you want to... If its smaller than the amount of addresses found, the addresses will be lost.