Hi to all,
I tried to connect an arduino to a cubecell using this scketches:
The cubecell has this one
#include "Arduino.h"
#include <Wire.h>
#define I2C_YO 0x80
#define I2C_MONO_2 0x50
void setup()
{
Wire.begin(I2C_YO);
Serial.begin(115200);
}
void loop()
{
Wire.beginTransmission(I2C_MONO_2);
Wire.write("NAVIGATION");
Wire.endTransmission();
Serial.println("sending via i2c");
delay (2000);
}
And in the Arduino this is the code:
#include <Wire.h>
#define I2C_MONO_1 0x80
#define I2C_YO 0x50
String datos ="";
void setup()
{
Serial.begin(115200);
Wire.begin(I2C_YO);
Wire.onReceive(receiveI2C);
Serial.println("mono ready");
}
void loop() {}
void receiveI2C(int howMany)
{
datos ="";
while (Wire.available() > 0) {
datos += (char)Wire.read();
}
Serial.println(datos);
}
Running both scketches into arduinos works ok.
Using a Cubecell and an Arduino the cubecell sends or at least appears each two seconds the “sending via i2c” in the serial monitor, but the Arduino only write “mono ready” and no more.
I tried to scan the i2c bus and it can not find the cubecell. Maybe is something not defined…
any idea? thanks!
PD: I use an special Arduino UNO with two system pwr, it can works on 5v or 3.3v. then is not a problem of different voltages in the bus.