No
I have
PlatformIO: C/C++ Project Index (for Autocomplete, Linter) has been successfully rebuilt.
I just want to test the Atom with a simple program that I know is working.
this is my code :
#include <Wire.h>
void setup() {
Wire.begin(7); // join i2c bus (address optional for master)
Serial.begin(9600); // start serial for output
Wire.onReceive(ReceiveRq);
}
void loop() {
Wire.beginTransmission(8);
Wire.write("COUCOU de 8 ");
Wire.endTransmission();
delay(2000);
Wire.requestFrom(8, 6); // request 6 bytes from slave device #8
while (Wire.available()) { // slave may send less than requested
char c = Wire.read(); // receive a byte as character
Serial.print(c); // print the character
}
}
void ReceiveRq(int numBytes)
{
Serial.println("reception");
while (Wire.available())
{ // slave may send less than requested
char c = Wire.read(); // receive a byte as character
Serial.print(c); // print the character
}
}