First let’s have a look at the pinout of the connectors labeled as PORTC and PORTD on the V3 boards.
“PORTC” :
| PIN | NAME | FUNCTION | ARDUINO PIN | ARDUINO PIN |
| 1 | PC0 | ADC0 | analog IN 0 | digital IN/OUT 14 |
| 2 | PC1 | ADC1 | analog IN 1 | digital IN/OUT 15 |
| 3 | PC2 | ADC2 | analog IN 2 | digital IN/OUT 16 |
| 4 | PC3 | ADC3 | analog IN 3 | digital IN/OUT 17 |
| 5 | PC4 | ADC4, SDA | analog IN 4 | digital IN/OUT 18 |
| 6 | PC5 | ADC5, SCL | analog IN 5 | digital IN/OUT 19 |
| 7 | ADC6 | ADC6 | analog IN 6 | (only on SMD boards) |
| 8 | ADC7 | ADC7 | analog IN 7 | (only on SMD boards) |
| 9 | + | 5V | - | - |
| 10 | - | GND | - | - |
“PORTD” :
| PIN | NAME | FUNCTION | ARDUINO PIN | ARDUINO PIN |
| 1 | PD0 | RXD | RXD | digital IN/OUT 0 |
| 2 | PD1 | TXD | TXD | digital IN/OUT 1 |
| 3 | PD2 | INT0 | - | digital IN/OUT 2 |
| 4 | PD3 | INT1, OC2B | PWM | digital IN/OUT 3 |
| 5 | PD4 | XCK, T0 | - | digital IN/OUT 4 |
| 6 | PD5 | T1, OC0B | PWM | digital IN/OUT 5 |
| 7 | PD6 | AIN0, OC0A | PWM | digital IN/OUT 6 |
| 8 | PD7 | AIN1 | - | digital IN/OUT 7 |
| 9 | + | 5V | - | - |
| 10 | - | GND | - | - |
- The button “SW” is connected to PB0 / digital IN/OUT 8
- The LED is connected to PD4 / digital IN/OUT 4
Now lets take two of these V3 boards and have even more fun.
One board is the slave device on the I²C bus, the other one will be master. The master is connected to my computer and can receive commands if necessary. It sends commands to the slave with the LED matrix.
Here is a very simple demonstration based on the examples that come with the Arduino IDE. The +5V / GND lines and the SDA / SCL lines are connected 1:1 between two boards.
The matrix V3 board with the blue LED and no LED matrix attached is the master and is loaded with this code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | #define __led 4 #define __button 8 // no external pull-up resistor on the board ! #define PRESSED LOW #include <Wire.h> void setup() { Wire.begin(); // join i2c bus (address optional for master) pinMode(__led,OUTPUT); pinMode(__button,INPUT); digitalWrite(__button,HIGH); // turn on internal pull-up. reads as LOW when pressed } void loop() { Wire.beginTransmission(0x16); // transmit to device 0x16 if( digitalRead(__button) == PRESSED ) { digitalWrite(__led,HIGH); // turn on local LED Wire.send(0x01); // turn on remote LED } else { digitalWrite(__led,LOW); // turn off local LED Wire.send(0x00); // turn off remote LED } Wire.endTransmission(); // stop transmitting } |
The I²C related part on the slave:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | #define __led 4 #define __button 8 // no external pull-up resistor on the board ! #define PRESSED LOW #include <Wire.h> void setup(void) { pinMode(__led,OUTPUT); pinMode(__button,INPUT); digitalWrite(__button,HIGH); // turn on internal pull-up. reads as LOW when pressed Wire.begin(0x16); // join the bus with address 0x16 Wire.onReceive(receiveEvent); // register event } void loop(void) { } void receiveEvent(int dummy) { byte data = 0; if( Wire.available() ) { data = Wire.receive(); digitalWrite(__led,data); if( data == 1 ) { smile_on(150); } else { frown(0); } } } |
Please also have a look at my projects page.
Related posts:

Nice post Robert. Good example.
Hopefully I will make use of it sooner or later. Having only got my Duino last week, all I have done sofar is the ‘toggle LED with a button’ tutorial. I am waiting on some more hardware (like my breadboard) so I can have some more fun.
And you will.
BTW, my comment about “maybe not user friendly” seems a bit exaggerated in retrospective :-)
I’ve been helping someone in Arduino matters for the past weeks and that quite stressed me out. I was just afraid I’d have to do remote support for this one 24/7. It really isn’t any worse than other Arduino clones without auto reset that need a USB/TTL serial cable. And it helps to accept that writing code is the job of the owner.
I hope you won’t have to wait too long for the Rainbowduino.
Yes… they said it will be released in the next 2 weeks approx. Meanwhile I have a lot of learning to do first anyway! I just got a bunch of new stuff from DigiKey, but am too afraid to plug any of it in because I do not want to fry it!!
Anyhow, I am not totally afraid of your little driver here, + i have a good friend that does EE so I would not be relying on your much at all for support. I am only waiting for the Rainbow at the moment to see if it may be more user friendly, but it does not look like that will be the case at all!