// Wire Master Writer // by Nicholas Zambetti // Demonstrates use of the Wire library // Writes data to an I2C/TWI slave device // Refer to the "Wire Slave Receiver" example for use with this // Created 29 March 2006 // This example code is in the public domain. #include #include const int rs = 10, en = 9, d4 = 8, d5 = 7, d6 = 6, d7 = 5; LiquidCrystal lcd(rs, en, d4, d5, d6, d7); void setup() { Wire.begin(); // join i2c bus (address optional for master) // set up the LCD's number of columns and rows: lcd.begin(16, 2); // Print a message to the LCD. lcd.print("hello, world!"); } void loop() { Wire.beginTransmission(8); // transmit to device #8 Wire.write("hello, world!"); // sends 13 bytes Wire.endTransmission(); // stop transmitting lcd.setCursor(0, 1); lcd.print(millis() / 1000); delay(500); }