Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Program
- #include <MD_Parola.h>
- #include <MD_MAX72xx.h>
- #include <SPI.h>
- #define HARDWARE_TYPE MD_MAX72XX::FC16_HW
- #define MAX_DEVICES 4
- #define CLK_PIN 13
- #define DATA_PIN 11
- #define CS_PIN 10
- MD_Parola P = MD_Parola(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);
- #include <Wire.h>
- #include <DS3231.h>
- DS3231 rtc;
- RTCDateTime datumCas;
- byte showtime;
- void setup(void)
- {
- Serial.begin(9600);
- P.begin();
- // Set the brightness of the led, 0= minimum, 15= maximum
- P.setIntensity(2);
- rtc.begin();
- rtc.setDateTime(__DATE__, __TIME__);
- }
- void loop(void)
- {
- Serial.print("Datum a cas DS3231: ");
- Serial.print(datumCas.year); Serial.print("-");
- Serial.print(datumCas.month); Serial.print("-");
- Serial.print(datumCas.day); Serial.print(" ");
- Serial.print(datumCas.hour); Serial.print(":");
- Serial.print(datumCas.minute); Serial.print(":");
- Serial.print(datumCas.second); Serial.println("");
- //-----------------------------------------------------------
- //P.print(datumCas.hour && datumCas.minute && datumCas.second);
- delay(1000);
- datumCas = rtc.getDateTime();
- showtime = datumCas.second ;
- P.print(showtime);
- Serial.print("Kopie displeje na serial: ");
- Serial.print(showtime); Serial.println("");
- //-----------------------------------------------------------
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement