Pages: [1]   Go Down
Author Topic: Arduino 1.0 no longer works for RTC RX8025  (Read 1324 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
« Last Edit: December 24, 2011, 06:00:55 am by jputcu » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 212
Posts: 13531
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


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
Logged

Rob Tillaart

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

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@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.
Logged

Pages: [1]   Go Up
Jump to: