i had been writing some code a few months ago, and now i wanted to get back to this project; I installed
version 1.0 of the arduino software and i encountered some problems with the wire library.
I have a twin relay connected to the arduino trough I2C and that worked ok when i used wire.send.
This is the information of the register :
Name: Relay A timed off
This command turns relay A off in n number of
200mS intervals. As an example if the relay is
required to go off 30 seconds after the
command then ( 30 / 0.2 = 150) the delay
would be 150.
This should be converted to hex and sent as
two bytes so the command in this case would
The number is a 16 bit value so the maximum
delay is 65535 200mS intervals or just over
218 minutes (3.6 hours). No checking is made
if the number entered is not within this range
so unpredictable results will occur if a number
is entered outside of this range.
So in my 0.22 arduino i programmed :
Wire.send(4); // Send register to write to
Wire.send(0x0); // send low value to be sent to it
Wire.send(0x3); // send high value to be sent to it
Worked perfectly. Now in arduino 1.0, i'm no longer able to use Wire.send , i had to use Wire.write .
When i change my .send to .write , i get the following error at the line wire.send (0x0);
"call of overloaded 'write(int) is ambigous"
so i tried :
wire.write ((byte) 0x0)
wire.write ((byte) 0x3)
but my relay does not respond to this
Any idea what's up with this ? thanks