Adafruit NeoPixel 60 Ring Clock Project - Error Message When Compiling Sketch

I am taking my first tentative steps into an Arduino project at 41 and hope that some of the more experienced users can help me:

When I try to compile/upload the sketch I get the following:

Error Message:

Arduino: 1.8.7 (Windows 10), Board: “Arduino Gemma”

C:\Users\Simon\AppData\Local\Temp\arduino_modified_sketch_177552\ds1307.ino: In function ‘void setup()’:

ds1307:10:11: error: ‘Serial’ was not declared in this scope

while (!Serial); // for Leonardo/Micro/Zero


ds1307:12:3: error: ‘Serial’ was not declared in this scope



C:\Users\Simon\AppData\Local\Temp\arduino_modified_sketch_177552\ds1307.ino: In function ‘void loop()’:

ds1307:31:5: error: ‘Serial’ was not declared in this scope

Serial.print(now.year(), DEC);


exit status 1
‘Serial’ was not declared in this scope


Adafruit Trinket 5V (Adafruit Trinket - Mini Microcontroller - 5V Logic : ID 1501 : $6.95 : Adafruit Industries, Unique & fun DIY electronics and kits)
Adafruit Neo Pixel Ring (NeoPixel 1/4 60 Ring - 5050 RGB LED w/ Integrated Drivers : ID 1768 : $9.95 : Adafruit Industries, Unique & fun DIY electronics and kits)
Tiny RTC i2c module (

Wiring Schematic: (using Tiny RTC instead of Adafruit RTC - wired same way)


// Date and time functions using a DS1307 RTC connected via I2C and Wire lib
#include <Wire.h>
#include "RTClib.h"

RTC_DS1307 rtc;

char daysOfTheWeek[7][12] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};

void setup () {
  while (!Serial); // for Leonardo/Micro/Zero

  if (! rtc.begin()) {
    Serial.println("Couldn't find RTC");
    while (1);

  if (! rtc.isrunning()) {
    Serial.println("RTC is NOT running!");
    // following line sets the RTC to the date & time this sketch was compiled
    rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));
    // This line sets the RTC with an explicit date & time, for example to set
    // January 21, 2014 at 3am you would call:
    // rtc.adjust(DateTime(2014, 1, 21, 3, 0, 0));

void loop () {
    DateTime now =;
    Serial.print(now.year(), DEC);
    Serial.print(now.month(), DEC);
    Serial.print(, DEC);
    Serial.print(" (");
    Serial.print(") ");
    Serial.print(now.hour(), DEC);
    Serial.print(now.minute(), DEC);
    Serial.print(now.second(), DEC);
    Serial.print(" since midnight 1/1/1970 = ");
    Serial.print("s = ");
    Serial.print(now.unixtime() / 86400L);
    // calculate a date which is 7 days and 30 seconds into the future
    DateTime future (now + TimeSpan(7,12,30,6));
    Serial.print(" now + 7d + 30s: ");
    Serial.print(future.year(), DEC);
    Serial.print(future.month(), DEC);
    Serial.print(, DEC);
    Serial.print(' ');
    Serial.print(future.hour(), DEC);
    Serial.print(future.minute(), DEC);
    Serial.print(future.second(), DEC);

The Trinket does not have a hardware serial port. So you will need to remove all the Serial commands from your code.

This is a bit unfortunate because it's nice to be able to get some debug output. It is probably possible to use a library to add a software serial port but the memory of the Trinket's ATtiny85 microcontroller is extremely limited so you may not have enough room for that.


Arduino: 1.8.7 (Windows 10), Board: "Arduino Gemma"

Make sure to select the correct board from the Tools > Board menu. I know the Gemma and Trinket use the same microcontroller, so maybe this will work. I don't have any experience with these boards. There are instructions on the Adafruit site that show you how to add support for the Trinket to the Arduino IDE.

This is a bit unfortunate because it's nice to be able to get some debug output.

Why not use the LED pixels themselves as debug output?

First, forget about making the timekeeping work, and just see if you can light up the LED pixels in a pattern of your choice. Once you've done that, then you can use the pixels to display information.