I2C-Functionality
a tutorial for the I²C-Extension
- Todo:
- examples and sections for all functions
- Note
- To use this:
- 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:
#include <Wire.h>
#define EBOARD_I2C 0x1
#include <SPI.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.
SHIFT-Functionality
A tutorial for the Pin-Extension
- Note
- To use this:
#define EBOARD_SHIFT_REGISTER 0x1
Pin extensions
It is possible to extend the amount of available pins via SN74HC595 Shift-Registers. Connect them like this:
- Note
- it is possible to extend the amount of shiftregisters. This version of eBoard supports up to 32 (64) additional pins.
But it is possible to connect even more!
To assign this pins with the special values you can use the SoccerBoard::power() [SoccerBoard::powerOn(); SoccerBoard::powerOff()] Syntax with pinIDs >99 [100 => 0 etc.] This is an example-program:
#define EBOARD_SHIFT_REGISTER 0x1
#include <SPI.h>
return 0;
}
This will set the Output value of Pin 100 (Q0 on the first SN74HC595) to HIGH.
specific
store_bits can be modified via bitSet()/bitClear() or long assignment (like = 1000);
BLUETOOTH-Connection
A tutorial for the Bluetooth-Extension
- Note
- To use this:
#include <SoftwareSerial.h>
#define EBOARD_BLUETOOTH 0x1
-
Why using SoftwareSerial?
The 0 and 1 pins on the Arduino are the same used for communicate with your PC hence, ond every Upload the HC-05 would has to be unplugged.
Furthermore Debugging would create a lot of problems ^^
How to use Bluetooth-Communication:
- Warning
- it is important to identify the layout of the HC-05 it is different from the one showed below the wiring may not apply [KEY is probably represented by a button]!
- Warning
- mistakes were made ^^ - somethings wrong with the power connection....
- Todo:
- don't be stupid^^
You can replace the 1kΩ- with a 1.1kΩ-Resistor
- Todo:
- fill bluetooth