Super Danke!
Wäre ja auch zu schön gewesen, jetzt kommt das shit :
/Users/robi/Documents/Arduino/MeineSketches/WEG_Uhr/robi_uhr_rtc/robi_uhr_rtc.ino: In function 'void ReadDS3231()':
robi_uhr_rtc:30: error: 'class DS3231' has no member named 'getSecond'
second=Clock.getSecond();
^
robi_uhr_rtc:35: error: 'class DS3231' has no member named 'getMinute'
minute=Clock.getMinute();
^
robi_uhr_rtc:36: error: 'class DS3231' has no member named 'getHour'
hour=Clock.getHour(h12, PM);
^
exit status 1
'class DS3231' has no member named 'getSecond'
#include "LedControl.h"
#include <Wire.h>
#include <DS3231.h>
/*
LedControl Anschluss
D6 / GPIO 12 / PIN 12 is connected to DIN
D5 / GPIO 14 / PIN 14 is connected to CLK
D4 / GPIO 2 / PIN 2 is connected to CS
*/
/* MODUL RTC DS3231
Gnd = masse
Vcc = +5V
SDA = GPIO4 (D2)
SCL = GPIO5 (D1)
*/
LedControl lc=LedControl(12,14,2,1);
DS3231 Clock;
/* we always wait a bit between updates of the display */
unsigned long delaytime=10;
unsigned long m;
void ReadDS3231()
{
static int oldsecond;
static long oldmillis;
int second,minute,hour,hlast,mlast,slast,tens,hundreds;
bool PM, h12;
second=Clock.getSecond();
if ( second != oldsecond ) {
oldmillis = millis();
oldsecond = second;
}
minute=Clock.getMinute();
hour=Clock.getHour(h12, PM);
slast = second % 10;
mlast = minute % 10;
hlast = hour % 10;
second = (second - slast) / 10;
minute = (minute - mlast) / 10;
hour = (hour - hlast) / 10;
tens = (millis()-oldmillis)/100;
hundreds = ((millis()-oldmillis)/10)%10;
lc.setDigit(0,7,hour,false);
lc.setDigit(0,6,hlast,true);
lc.setDigit(0,5,minute,false);
lc.setDigit(0,4,mlast,true);
lc.setDigit(0,3,second,false);
lc.setDigit(0,2,slast,true);
lc.setDigit(0,1,tens,false);
lc.setDigit(0,0,hundreds,false);
}
void setup() {
/*
The MAX72XX is in power-saving mode on startup,
we have to do a wakeup call
*/
Wire.begin();
lc.shutdown(0,false);
/* Set the brightness to a medium values */
lc.setIntensity(0,6);
/* and clear the display */
lc.clearDisplay(0);
Serial.begin(9600);
}
void loop() {
m=millis();
ReadDS3231();
Serial.println(millis()-m,DEC);
delay(delaytime-m); //start with delaytime and change
// to delaytime - m only once you assure m < delaytime
}