Hi,
I wrote a mArduino library for Arduino.
mArduino is a simple library for Arduino.
mArduino uses multiple Arduinos and I2C Protocol to expand Arduino's IO capacity.
By using mArduino, master arduino can read and write slave's I/O very straightforwardly.
Master can make slave's LED in a nearly identical manner to writing an arduino sketch,
for example, the following sketch will blink slave's LED:
#include "Wire.h" // You need to include both Wire.h and mArduino.h
#include "mArduino.h"
const int SLAVE_ADDRESS = 1;
const int ledPin = 13;
void setup()
{
mArduino(); // join I2C bus as a Master
pinMode(SLAVE_ADDRESS, ledPin, OUTPUT);
}
void loop() {
digitalWrite(SLAVE_ADDRESS, ledPin, HIGH);
delay(100);
digitalWrite(SLAVE_ADDRESS, ledPin, LOW);
delay(100);
}
And here is a general slave sketch:
// General_slave.ino
// Refer to master examples for use with this
#include <Wire.h> // You need to include both Wire.h and mArduino.h
#include "mArduino.h"
const int SLAVE_ADDRESS = 1;
void setup()
{
mArduino(SLAVE_ADDRESS); // join I2C bus as a slave with address 1
}
void loop()
{
}
For more information, see: