Go Down

Topic: compile error: RTC_DS3234 library on Due (Read 981 times) previous topic - next topic


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: [Select]
#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(' ');
    // following line sets the RTC to the date & time this sketch was compiled
    RTclock.adjust(DateTime(__DATE__, __TIME__));
    DateTime now = RTclock.now();
    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


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.

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131