Skip to content

Instantly share code, notes, and snippets.

@stefania11
Created December 23, 2016 19:12
Show Gist options
  • Save stefania11/4ca8d49344435b9c99b963b611a0cb56 to your computer and use it in GitHub Desktop.
Save stefania11/4ca8d49344435b9c99b963b611a0cb56 to your computer and use it in GitHub Desktop.
#include <Wire.h>
void setup() {
Wire.begin(); // join i2c bus (address optional for master)
}
byte x = 0;
void loop() {
Wire.beginTransmission(8); // transmit to device #8
Wire.write("x is "); // sends five bytes
Wire.write(x); // sends one byte
Wire.endTransmission(); // stop transmitting
x++;
delay(500);
if (x >10) {
x=0;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment