Created
December 23, 2016 19:12
-
-
Save stefania11/4ca8d49344435b9c99b963b611a0cb56 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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