Pages: [1]   Go Down
Author Topic: compile error: RTC_DS3234 library on Due  (Read 368 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
I am trying to get the RTC_DS3234 library working with the Due and have a compile error I don't understand.   I've had some success with other libraries but this is a new error that I don't know how to approach.  A simple code is below along with the error generated.   It works fine when compiled for the Mega.   I can't seem to see how '_BV' is defined or used though...  any help greatly appreciated.

Code:
#include <SPI.h>
#include <Wire.h>
#include <RTC_DS3234.h>

RTC_DS3234 RTclock(7);

void setup()
{
  Serial.print("Starting RTC...");
  if (RTclock.begin())
  {
    Serial.print("Setting time to ");
    Serial.print(__DATE__);
    Serial.print(' ');
    Serial.println(__TIME__);
    // following line sets the RTC to the date & time this sketch was compiled
    RTclock.adjust(DateTime(__DATE__, __TIME__));
    Serial.println("ok");
    DateTime now = RTclock.now();
  }
  else
  {
    Serial.println("RTC failed to Initialise");
  }
}

void loop() {
  // put your main code here, to run repeatedly:
 
}

Arduino: 1.5.4 (Windows 7), Board: "Arduino Due (Programming Port)"

C:\Users\fe112331\Documents\Arduino\libraries\RTClib\RTC_DS3234.cpp: In member function 'uint8_t RTC_DS3234::isrunning()':
C:\Users\fe112331\Documents\Arduino\libraries\RTClib\RTC_DS3234.cpp:69: error: '_BV' was not declared in this scope

Logged

US
Offline Offline
Full Member
***
Karma: 4
Posts: 183
Electronics are the new Legos
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The _BV code is in the library and is coding low level on the AVR ("classic") Arduinos.   You should see if anyone has made a SAM/Due compatible library.  If not, you'll need to read up on AVR code and equivalent SAM code (yuck).

If you just need a RTC module, the Adafruit DS1307 breakout has a library that will work with AVR and Due.
Logged

Pages: [1]   Go Up
Jump to: