Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "SevSeg.h"
- #include <Wire.h>
- #include "RTClib.h"
- SevSeg Display;
- RTC_DS1307 rtc;
- unsigned int aa;
- unsigned int Time;
- //char daysOfTheWeek[7][12] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};
- void setup()
- {
- // Wire.begin();
- rtc.begin();
- byte numDigits = 4;
- byte digitPins[] = {10, 11, 12, 13};
- byte segmentPins[] = {2, 3, 4, 5, 6, 7, 8, 9};
- bool resistorsOnSegments = true;
- bool updateWithDelaysIn = true;
- byte hardwareConfig = COMMON_ANODE;
- Display.begin(hardwareConfig, numDigits, digitPins, segmentPins, resistorsOnSegments);
- Display.setBrightness(100);
- Serial.begin(57600);
- // rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));
- }
- void loop()
- {
- DateTime now = rtc.now;
- Serial.println(now.hour(), DEC);
- // Time = now.hour() *100 + now.minute();
- // Display.setNumber(Time);
- // Display.setChars(Time);
- // Serial.println(Time);
- Serial.println();
- delay(3000);
- Display.refreshDisplay();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement