Go Down

Topic: Arduino 1.0 no longer works for RTC RX8025 (Read 1 time) previous topic - next topic

jputcu

Dec 24, 2011, 11:28 am Last Edit: Dec 24, 2011, 12:00 pm by jputcu Reason: 1
Hello

I'm using Seeeduino Stalker v2 and have recently switched to Arduino 1.0 but now I'm unable to read out my I2C RTC RX8025.

Using the "Wire->Master_reader" example I have a basic version which works for 0.23 but not voor 1.0:
Quote

#include <Wire.h>

void setup()
{
 Wire.begin();        // join i2c bus (address optional for master)
 Serial.begin(9600);  // start serial for output
}

void loop()
{
 Wire.requestFrom(0x32, 8 );    // request 6 bytes from slave device #2

 while(Wire.available())    // slave may send less than requested
 {
#if ARDUINO >= 100
   char c = Wire.read();
#else
   char c = Wire.receive(); // receive a byte as character
#endif
   Serial.print(c, HEX);         // print the character
 }
 Serial.println("");

 delay(500);
}



On the other hand, the I2C tmp102 temperature sensor still works!

Greetings

Joris

indyeric

I'm having the same problem.  Did you get this figured out?

robtillaart


Have you checked - http://arduino.cc/en/Main/ReleaseNotes - ?

* The Wire library has also been modified to use the standard read() and
  write() functions instead of send() and receive(). You can also use
  print() and println() for outgoing data.


furthermore:

Wire.requestFrom(0x32, 8 );    // request 6 bytes from slave device #2

If the code is in conflict with the comments==> code wins ...

IF you hardcode for 1.0 (without the #if) does it work ?

// I saw it done this way ... #if defined(ARDUINO) && ARDUINO >= 100
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

jputcu

@indyeric,
I've not been able to get it working. I switched to the newer Seeeduino Stalker v2.1 wich uses another RTC that works with Arduino-1.0.

@robtillaart,
I tried with hardcoded 1.0 code, if my defines were wrong, the compiler would complain about the old receive() method.

Go Up