Facebook
From Unreliable Horse, 6 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 306
  1. #include <Wire.h>
  2.  
  3. void setup() {
  4.   Wire.begin(); // join i2c bus (address optional for master)
  5.   Serial.begin(9600);
  6. }
  7.  
  8.  
  9.  
  10. void loop() {
  11.   int x = 0;
  12.   Wire.beginTransmission(9); // transmit to device #8
  13.   Wire.write(x);              // sends one byte
  14.   Wire.endTransmission();    // stop transmitting
  15.   Serial.println("x");
  16.   x++;
  17.   if(x==6){x=0;}
  18.   delay(500);
  19. }