Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 10 of 10

Thread: ReadTest example in DS1307 library doesn't compile

Threaded View

  1. #1
    Join Date
    Feb 2019
    Vancouver, BC

    ReadTest example in DS1307 library doesn't compile

    With no modification, the example doesn't compile. It begins
    #include <Wire.h>
    #include <TimeLib.h>
    #include <DS1307RTC.h>
    and that's enough to make the compiler complain. The compiler says
    . . . arduino-1.8.8\hardware\teensy\avr\libraries\DS1307RTC\DS1307RTC.cpp:217:11: error: redefinition of 'DS1307RTC RTC'
    DS1307RTC RTC = DS1307RTC(); // create an instance for the user
    In file included from ...arduino-1.8.8\hardware\teensy\avr\libraries\DS1307RTC\DS1307RTC.cpp:32:0:
    ... arduino-1.8.8\hardware\teensy\avr\libraries\DS1307RTC\DS1307RTC.h:37:11: note: DS1307RTC RTC previously declared here
    Not surprisingly, the same thing happens with the SetTime example.
    Last edited by Fenichel; 01-13-2020 at 07:12 PM. Reason: added note re SetTime

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts