method names in i2c class changed at Arduino 1.0
authorRobert Garbee <robert@gag.com>
Sun, 7 Apr 2013 18:47:28 +0000 (12:47 -0600)
committerRobert Garbee <robert@gag.com>
Sun, 7 Apr 2013 18:47:28 +0000 (12:47 -0600)
greenhouse.ino

index 206e5d23dc156d28e5a526f16cde38290f7c6009..65fc7e13cb922171085b4a72166b6dd39e54728c 100644 (file)
@@ -245,9 +245,9 @@ static void i2c_eeprom_write_byte( int deviceaddress, unsigned int eeaddress, by
 
   int rdata = data;
   Wire.beginTransmission(deviceaddress);
-  Wire.send((int)(eeaddress >> 8)); // MSB
-  Wire.send((int)(eeaddress & 0xFF)); // LSB
-  Wire.send(rdata);
+  Wire.write((int)(eeaddress >> 8)); // MSB
+  Wire.write((int)(eeaddress & 0xFF)); // LSB
+  Wire.write(rdata);
   Wire.endTransmission();
 }
 
@@ -255,11 +255,11 @@ static byte i2c_eeprom_read_byte( int deviceaddress, unsigned int eeaddress ) {
   delay(5);
   byte rdata = 0xFF;
   Wire.beginTransmission(deviceaddress);
-  Wire.send((int)(eeaddress >> 8)); // MSB
-  Wire.send((int)(eeaddress & 0xFF)); // LSB
+  Wire.write((int)(eeaddress >> 8)); // MSB
+  Wire.write((int)(eeaddress & 0xFF)); // LSB
   Wire.endTransmission();
   Wire.requestFrom(deviceaddress,1);
 
-  if (Wire.available()) rdata = Wire.receive();
+  if (Wire.available()) rdata = Wire.read();
   return rdata;
 }