Loading...
Pages: [1]   Go Down
Author Topic: ### Solved - wire.h error on Arduino 1.0 ###  (Read 1239 times)
0 Members and 1 Guest are viewing this topic.
Chennai, India
Offline Offline
God Member
*****
Karma: 0
Posts: 751
Peace!!!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The following piece of code compiles fine on Arduino 23, however throws up a specific error on Arudino 1.0
The error "Call of Overloaded 'write(int)' is ambiguous" is thrown for the line "Wire.write(0);"
Can someone throw some light?

Code:
void setup()
{
  Serial.begin(9600);
  Wire.begin(i2c_da);
//Serial.println("1");
  delay(500);

  Wire.beginTransmission(i2c_da);
  Wire.write(0);
  Wire.write(0x57);  // sec = 57
  Wire.write(0x53);  // min = 59
  Wire.write(0x56);  // hour = 11
  Wire.write(0x05);  // day = 5
  Wire.write(0x10);  // date = 31
  Wire.write(0x12);  // month = 12
  Wire.write(0x10); // year = 10
  Wire.endTransmission();  
  //Serial.println("2");

}

Cheers,
Pracas
« Last Edit: December 21, 2011, 06:39:57 am by pracas » Logged

Be The Change...

Global Moderator
Melbourne, Australia
Offline Offline
Shannon Member
*****
Karma: 219
Posts: 13896
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You probably have to typecast it, untested, but something like:

Code:
  Wire.write((byte) 0x57);  // sec = 57
Logged


Chennai, India
Offline Offline
God Member
*****
Karma: 0
Posts: 751
Peace!!!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

@Nick... Yes.. thats what i did and it worked...
Logged

Be The Change...

Pages: [1]   Go Up
Print
 
Jump to: