DS3231
Arduino: 1.8.4 (Windows 10), Πλακέτα:"Arduino/Genuino Uno"
Hello everybody
I use Arduino R3 Uno with DS3231 and 1.8 TFT spi 128X160 and this is my first project.
#include <Adafruit_GFX.h>
#include <Adafruit_ST7735.h>
#include <SPI.h>
#include <DS3231.h>
#include <Wire.h>
// Init the DS3231 using the hardware interface
DS3231 rtc(SDA, SCL);
#define TFT_CS 10
#define TFT_RST 9
#define TFT_DC 8
#define TFT_SCLK 13
#define TFT_MOSI 11
Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_RST);
void setup(void) {
// Setup Serial connection
Serial.begin(115200);
// Initialize the rtc object
rtc.begin();
// You will need to do this in every sketch
tft.initR(INITR_BLACKTAB); // Blank Screen
tft.fillScreen(ST7735_BLACK); // Set background BLACK
// Start writing colored text
tft.setTextColor(ST7735_RED);
tft.setTextSize(1);
tft.setCursor(5,10);
delay(1000); // pause for dramatic effect
tft.print("1.8 TFT with DS3231");
}
void loop() {
// Blank Screen
tft.initR(INITR_BLACKTAB);
// Send Day of Week
tft.setTextColor(ST7735_WHITE);
tft.setTextSize(2);
tft.setCursor(10,30);
tft.print(rtc.getDOWStr());
// Send date
tft.setTextColor(ST7735_WHITE);
tft.setTextSize(1);
tft.setCursor(10,50);
tft.print(rtc.getDateStr());
// Send time
tft.setTextColor(ST7735_WHITE);
tft.setTextSize(1);
tft.setCursor(10,70);
tft.println(rtc.getTimeStr());
// Send current temperature
tft.setTextColor(ST7735_YELLOW);
tft.setTextSize(1);
tft.setCursor(30,90);
tft.print("Temperature: ");
tft.setTextColor(ST7735_BLUE);
tft.setTextSize(2);
tft.setCursor(35,120);
tft.print(rtc.getTemp());
tft.println(" C");
}
Clicking for compilation illuminates the line 8
DS3231 rtc(SDA, SCL);
Software: arduino-1.8.4 windows 10
Libraries: DS3231 1.0.2
Libraries are up-to-date and when I ask to add again library DS3231 adds #include <Wire.h>
Please help. Where is the error?
D:\Τα ΞΞ³Ξ³Ο?αφά ΞΌΞΏΟ…\Arduino\@-NEW_Projects_OCT_2017\1.8TFT_with_DS3231\1.8TFT_with_DS3231.ino:8:21: note: candidates are:
In file included from D:\Τα ΞΞ³Ξ³Ο?αφά ΞΌΞΏΟ…\Arduino\@-NEW_Projects_OCT_2017\1.8TFT_with_DS3231\1.8TFT_with_DS3231.ino:4:0:
D:\Τα έγγραφά μου\Arduino\libraries\DS3231/DS3231.h:64:3: note: DS3231::DS3231()
DS3231();
^
D:\Τα έγγραφά μου\Arduino\libraries\DS3231/DS3231.h:64:3: note: candidate expects 0 arguments, 2 provided
D:\Τα έγγραφά μου\Arduino\libraries\DS3231/DS3231.h:60:7: note: constexpr DS3231::DS3231(const DS3231&)
class DS3231 {
^
D:\Τα έγγραφά μου\Arduino\libraries\DS3231/DS3231.h:60:7: note: candidate expects 1 argument, 2 provided
D:\Τα έγγραφά μου\Arduino\libraries\DS3231/DS3231.h:60:7: note: constexpr DS3231::DS3231(DS3231&&)
D:\Τα έγγραφά μου\Arduino\libraries\DS3231/DS3231.h:60:7: note: candidate expects 1 argument, 2 provided
D:\Τα ΞΞ³Ξ³Ο?αφά ΞΌΞΏΟ…\Arduino\@-NEW_Projects_OCT_2017\1.8TFT_with_DS3231\1.8TFT_with_DS3231.ino: In function 'void setup()':
1.8TFT_with_DS3231:24: error: 'class DS3231' has no member named 'begin'
D:\Τα ΞΞ³Ξ³Ο?αφά ΞΌΞΏΟ…\Arduino\@-NEW_Projects_OCT_2017\1.8TFT_with_DS3231\1.8TFT_with_DS3231.ino: In function 'void loop()':
1.8TFT_with_DS3231:47: error: 'class DS3231' has no member named 'getDOWStr'
1.8TFT_with_DS3231:53: error: 'class DS3231' has no member named 'getDateStr'
1.8TFT_with_DS3231:59: error: 'class DS3231' has no member named 'getTimeStr'
1.8TFT_with_DS3231:71: error: 'class DS3231' has no member named 'getTemp'
Χρησιμοποιώντας την βιβλιοθήκη Adafruit-GFX-Library-master στην έκδοση 1.2.2 στον φάκελο: D:\Τα έγγραφά μου\Arduino\libraries\Adafruit-GFX-Library-master
Χρησιμοποιώντας την βιβλιοθήκη Adafruit_ST3775 στον φάκελο: D:\Τα έγγραφά μου\Arduino\libraries\Adafruit_ST3775 (legacy)
Χρησιμοποιώντας την βιβλιοθήκη SPI στην έκδοση 1.0 στον φάκελο: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI
Χρησιμοποιώντας την βιβλιοθήκη DS3231 στην έκδοση 1.0.2 στον φάκελο: D:\Τα έγγραφά μου\Arduino\libraries\DS3231
Χρησιμοποιώντας την βιβλιοθήκη Wire στην έκδοση 1.0 στον φάκελο: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire
exit status 1
no matching function for call to 'DS3231::DS3231(const uint8_t&, const uint8_t&)'
Replies