From: Robert Garbee Date: Sun, 7 Apr 2013 18:47:28 +0000 (-0600) Subject: method names in i2c class changed at Arduino 1.0 X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=9e31be671111b44df1e9192b69902f29479ca59b;p=hw%2Fgreenhouse method names in i2c class changed at Arduino 1.0 --- diff --git a/greenhouse.ino b/greenhouse.ino index 206e5d2..65fc7e1 100644 --- a/greenhouse.ino +++ b/greenhouse.ino @@ -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; }