RTC1307 library error

I have set the time on my RTC1307 and I am now trying to use the RTClib library to display the time on my LCD. The issue is that the RTC_DS1307 does not name a type. I am writing the code in the online arduino editor and have added the library to use the included example, but it does not get past the third line. Any ideas?

Here's the clue to the cause of the bug:

Multiple libraries were found for "RTClib.h"

Used: /home/admin/builder/opt/libraries/latest/rtclib-by-neiron-1-5-4

Not used: /home/admin/builder/opt/libraries/latest/rtclib-1-2-0

There are two libraries in the Library Manager index that contain a file named RTClib.h and the wrong library is being included.

This happens even though I have only "favorited" the correct library, which is supposed to give include preference to that library.

The bug has been previously reported: http://forum.arduino.cc/index.php?topic=450612

Here's the workaround:

  • Download https://github.com/adafruit/RTClib/archive/1.2.0.zip
  • In the Arduino Web Editor, click the "Libraries" tab.
  • Click the import button, which is the button to the right of the "Library Manager" button.
  • If a note pops up about importing your whole sketchbook, click the "Import" button
  • Select the downloaded file.
  • Click "Open"

Imported libraries are given include priority so this will cause the correct file to be included instead of the one from the "rtclib-by-neiron" library.

Since this is an Arduino Web Editor specific problem, I'm requesting that it be moved to that forum section.

Excellent. Thank you. I'll give that a try.

This fixed the error where the name is a type but once uploaded it displays random symbols on the serial monitor.

Set the baud rate menu on the Serial Monitor to 57600. It defaults to 9600.

Great. Thanks!