Проблемы с DS1307 RTC на MacOS
- Войдите на сайт для отправки комментариев
Пт, 22/06/2018 - 08:43
Добрый день!
Столкнулся с проблемой с библиотекой DS1307 на MacOS. Под Виндой все работает, а под Маком не хочет компилиться один и тот же код. Может кто-то знает решение проблемы?
Это сделано:
#include <Time.h>
#include <Time.h>
#include <DS1307RTC.h>
Arduino: 1.8.5 (Mac OS X), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"
Build options changed, rebuilding all
In file included from /Users/wlodek/Google Диск/Arduino progs/Poliv_v2_5_test/Poliv_v2_5_test.ino:9:0:
/Users/wlodek/Documents/Arduino/libraries/DS1307RTC/DS1307RTC.h:19:22: error: 'tmElements_t' has not been declared
static bool read(tmElements_t &tm);
^
/Users/wlodek/Documents/Arduino/libraries/DS1307RTC/DS1307RTC.h:20:23: error: 'tmElements_t' has not been declared
static bool write(tmElements_t &tm);
^
Poliv_v2_5_test:55: error: 'tmElements_t' does not name a type
tmElements_t tm;
^
/Users/wlodek/Google Диск/Arduino progs/Poliv_v2_5_test/Poliv_v2_5_test.ino: In member function 'byte part::maxDay()':
Poliv_v2_5_test:112: error: expected primary-expression before '.' token
switch (tm.Month) {
^
/Users/wlodek/Google Диск/Arduino progs/Poliv_v2_5_test/Poliv_v2_5_test.ino: In member function 'void part::setDay()':
Poliv_v2_5_test:155: error: expected primary-expression before '.' token
if (lastOnDay <= tm.Day) valx = tm.Day;
^
Poliv_v2_5_test:155: error: expected primary-expression before '.' token
if (lastOnDay <= tm.Day) valx = tm.Day;
^
Poliv_v2_5_test:156: error: expected primary-expression before '.' token
else valx = tm.Day + maxDay();
^
Poliv_v2_5_test:173: error: expected primary-expression before '.' token
if (tm.Day % 2 == 0) dayStatus = true;
^
Poliv_v2_5_test:178: error: expected primary-expression before '.' token
if (tm.Day % 2 == 1) dayStatus = true;
^
/Users/wlodek/Google Диск/Arduino progs/Poliv_v2_5_test/Poliv_v2_5_test.ino: In member function 'void part::main()':
Poliv_v2_5_test:214: error: expected primary-expression before ')' token
RTC.read(tm);
^
Poliv_v2_5_test:218: error: expected primary-expression before '.' token
currentTime = tm.Hour * 60 + tm.Minute;
^
Poliv_v2_5_test:218: error: expected primary-expression before '.' token
currentTime = tm.Hour * 60 + tm.Minute;
^
/Users/wlodek/Google Диск/Arduino progs/Poliv_v2_5_test/Poliv_v2_5_test.ino: In member function 'void part::testMode()':
Poliv_v2_5_test:239: error: 'flow' was not declared in this scope
if (outStatus) predictOffTime = currentTime + int(moreVolume * 60.0 / flow());
^
Poliv_v2_5_test:254: error: 'volumeForAlgorythm' was not declared in this scope
previousVolume = volumeForAlgorythm();
^
/Users/wlodek/Google Диск/Arduino progs/Poliv_v2_5_test/Poliv_v2_5_test.ino: In member function 'void part::testCheck()':
Poliv_v2_5_test:265: error: 'volumeForAlgorythm' was not declared in this scope
doneVolume = volumeForAlgorythm() - previousVolume;
^
Poliv_v2_5_test:271: error: expected primary-expression before '.' token
lastOnDay = tm.Day;
^
Poliv_v2_5_test:275: error: 'volumeForAlgorythm' was not declared in this scope
previousVolume = volumeForAlgorythm() - doneVolume;
^
/Users/wlodek/Google Диск/Arduino progs/Poliv_v2_5_test/Poliv_v2_5_test.ino: In member function 'void part::testModeSettings()':
Poliv_v2_5_test:290: error: 'readButtons' was not declared in this scope
byte pressedButton = readButtons();
^
Poliv_v2_5_test:381: error: expected primary-expression before '.' token
onHour = tm.Hour;
^
Poliv_v2_5_test:382: error: expected primary-expression before '.' token
onMinute = tm.Minute;
^
/Users/wlodek/Google Диск/Arduino progs/Poliv_v2_5_test/Poliv_v2_5_test.ino: In member function 'void part::testModeMenu(bool)':
Poliv_v2_5_test:411: error: 'timeStr' was not declared in this scope
dataLine[0] += "Now " + timeStr() + " ";
^
Poliv_v2_5_test:424: error: expected primary-expression before '.' token
if (tm.Day < 10) todayStr = "0" + String(tm.Day);
^
Poliv_v2_5_test:424: error: expected primary-expression before '(' token
if (tm.Day < 10) todayStr = "0" + String(tm.Day);
^
Poliv_v2_5_test:424: error: expected primary-expression before '.' token
if (tm.Day < 10) todayStr = "0" + String(tm.Day);
^
Poliv_v2_5_test:425: error: expected primary-expression before '(' token
else todayStr = String(tm.Day);
^
Poliv_v2_5_test:425: error: expected primary-expression before '.' token
else todayStr = String(tm.Day);
^
/Users/wlodek/Google Диск/Arduino progs/Poliv_v2_5_test/Poliv_v2_5_test.ino: In member function 'long int part::minutesAgo()':
Poliv_v2_5_test:472: error: expected primary-expression before '.' token
if (lastOnMonth == tm.Month) val = (1440 * (tm.Day - lastOnDay) + currentTime) - (lastOnMinute + lastOnHour * 60);
^
Poliv_v2_5_test:472: error: expected primary-expression before '.' token
if (lastOnMonth == tm.Month) val = (1440 * (tm.Day - lastOnDay) + currentTime) - (lastOnMinute + lastOnHour * 60);
^
Poliv_v2_5_test:473: error: expected primary-expression before '.' token
else val = (1440 * (tm.Day + maxDay() - lastOnDay - 1) + currentTime) - (lastOnMinute + lastOnHour * 60);
^
/Users/wlodek/Google Диск/Arduino progs/Poliv_v2_5_test/Poliv_v2_5_test.ino: At global scope:
Poliv_v2_5_test:507: error: 'tmElements_t' does not name a type
tmElements_t tm;
^
Poliv_v2_5_test:513: error: 'Adafruit_BME280' does not name a type
Adafruit_BME280 bme;
^
/Users/wlodek/Google Диск/Arduino progs/Poliv_v2_5_test/Poliv_v2_5_test.ino: In function 'void setup()':
Poliv_v2_5_test:539: error: expected primary-expression before ')' token
RTC.read(tm);
^
Poliv_v2_5_test:545: error: 'bme' was not declared in this scope
bme.begin(0x76);
^
Poliv_v2_5_test:551: error: 'readBME' was not declared in this scope
readBME(true);
^
/Users/wlodek/Google Диск/Arduino progs/Poliv_v2_5_test/Poliv_v2_5_test.ino: In function 'void loop()':
Poliv_v2_5_test:608: error: expected primary-expression before ')' token
RTC.read(tm);
^
Poliv_v2_5_test:609: error: 'readBME' was not declared in this scope
readBME(false);
^
/Users/wlodek/Google Диск/Arduino progs/Poliv_v2_5_test/Poliv_v2_5_test.ino: In function 'void checkSD()':
Poliv_v2_5_test:771: error: 'tmYearToCalendar' was not declared in this scope
foldername += String(tmYearToCalendar(tm.Year));
^
Poliv_v2_5_test:771: error: expected primary-expression before '(' token
foldername += String(tmYearToCalendar(tm.Year));
^
Poliv_v2_5_test:771: error: expected primary-expression before '.' token
foldername += String(tmYearToCalendar(tm.Year));
^
Poliv_v2_5_test:772: error: expected primary-expression before '.' token
switch (tm.Month) {
^
/Users/wlodek/Google Диск/Arduino progs/Poliv_v2_5_test/Poliv_v2_5_test.ino: In function 'void writeSD()':
Poliv_v2_5_test:818: error: expected primary-expression before '.' token
if (tm.Minute %2 == 0 && valSD == false) {
^
Poliv_v2_5_test:847: error: expected primary-expression before '.' token
} else if (tm.Minute %2 != 0) valSD = false;
^
/Users/wlodek/Google Диск/Arduino progs/Poliv_v2_5_test/Poliv_v2_5_test.ino: In function 'String filename()':
Poliv_v2_5_test:854: error: expected primary-expression before '.' token
if (tm.Day<10) {val+="0"+String(tm.Day);}else{val+=String(tm.Day);}
^
Poliv_v2_5_test:854: error: expected primary-expression before '(' token
if (tm.Day<10) {val+="0"+String(tm.Day);}else{val+=String(tm.Day);}
^
Poliv_v2_5_test:854: error: expected primary-expression before '.' token
if (tm.Day<10) {val+="0"+String(tm.Day);}else{val+=String(tm.Day);}
^
Poliv_v2_5_test:854: error: expected primary-expression before '(' token
if (tm.Day<10) {val+="0"+String(tm.Day);}else{val+=String(tm.Day);}
^
Poliv_v2_5_test:854: error: expected primary-expression before '.' token
if (tm.Day<10) {val+="0"+String(tm.Day);}else{val+=String(tm.Day);}
^
Poliv_v2_5_test:855: error: expected primary-expression before '.' token
if (tm.Month<10) {val+="0"+String(tm.Month);}else{val+=String(tm.Month);}
^
Poliv_v2_5_test:855: error: expected primary-expression before '(' token
if (tm.Month<10) {val+="0"+String(tm.Month);}else{val+=String(tm.Month);}
^
Poliv_v2_5_test:855: error: expected primary-expression before '.' token
if (tm.Month<10) {val+="0"+String(tm.Month);}else{val+=String(tm.Month);}
^
Poliv_v2_5_test:855: error: expected primary-expression before '(' token
if (tm.Month<10) {val+="0"+String(tm.Month);}else{val+=String(tm.Month);}
^
Poliv_v2_5_test:855: error: expected primary-expression before '.' token
if (tm.Month<10) {val+="0"+String(tm.Month);}else{val+=String(tm.Month);}
^
Poliv_v2_5_test:856: error: 'tmYearToCalendar' was not declared in this scope
val+=String(tmYearToCalendar(tm.Year)-2000)+".csv";
^
Poliv_v2_5_test:856: error: expected primary-expression before '(' token
val+=String(tmYearToCalendar(tm.Year)-2000)+".csv";
^
Poliv_v2_5_test:856: error: expected primary-expression before '.' token
val+=String(tmYearToCalendar(tm.Year)-2000)+".csv";
^
/Users/wlodek/Google Диск/Arduino progs/Poliv_v2_5_test/Poliv_v2_5_test.ino: In function 'String timeStr()':
Poliv_v2_5_test:862: error: expected primary-expression before '.' token
if (tm.Hour<10) {val="0"+String(tm.Hour);}else{val=String(tm.Hour);}
^
Poliv_v2_5_test:862: error: expected primary-expression before '(' token
if (tm.Hour<10) {val="0"+String(tm.Hour);}else{val=String(tm.Hour);}
^
Poliv_v2_5_test:862: error: expected primary-expression before '.' token
if (tm.Hour<10) {val="0"+String(tm.Hour);}else{val=String(tm.Hour);}
^
Poliv_v2_5_test:862: error: expected primary-expression before '(' token
if (tm.Hour<10) {val="0"+String(tm.Hour);}else{val=String(tm.Hour);}
^
Poliv_v2_5_test:862: error: expected primary-expression before '.' token
if (tm.Hour<10) {val="0"+String(tm.Hour);}else{val=String(tm.Hour);}
^
Poliv_v2_5_test:864: error: expected primary-expression before '.' token
if (tm.Minute<10) {val+="0"+String(tm.Minute);}else{val+=String(tm.Minute);}
^
Poliv_v2_5_test:864: error: expected primary-expression before '(' token
if (tm.Minute<10) {val+="0"+String(tm.Minute);}else{val+=String(tm.Minute);}
^
Poliv_v2_5_test:864: error: expected primary-expression before '.' token
if (tm.Minute<10) {val+="0"+String(tm.Minute);}else{val+=String(tm.Minute);}
^
Poliv_v2_5_test:864: error: expected primary-expression before '(' token
if (tm.Minute<10) {val+="0"+String(tm.Minute);}else{val+=String(tm.Minute);}
^
Poliv_v2_5_test:864: error: expected primary-expression before '.' token
if (tm.Minute<10) {val+="0"+String(tm.Minute);}else{val+=String(tm.Minute);}
^
/Users/wlodek/Google Диск/Arduino progs/Poliv_v2_5_test/Poliv_v2_5_test.ino: In function 'String dateStr()':
Poliv_v2_5_test:870: error: expected primary-expression before '.' token
if (tm.Day<10) {val+="0"+String(tm.Day);}else{val+=String(tm.Day);}
^
Poliv_v2_5_test:870: error: expected primary-expression before '(' token
if (tm.Day<10) {val+="0"+String(tm.Day);}else{val+=String(tm.Day);}
^
Poliv_v2_5_test:870: error: expected primary-expression before '.' token
if (tm.Day<10) {val+="0"+String(tm.Day);}else{val+=String(tm.Day);}
^
Poliv_v2_5_test:870: error: expected primary-expression before '(' token
if (tm.Day<10) {val+="0"+String(tm.Day);}else{val+=String(tm.Day);}
^
Poliv_v2_5_test:870: error: expected primary-expression before '.' token
if (tm.Day<10) {val+="0"+String(tm.Day);}else{val+=String(tm.Day);}
^
Poliv_v2_5_test:872: error: expected primary-expression before '.' token
if (tm.Month<10) {val+="0"+String(tm.Month);}else{val+=String(tm.Month);}
^
Poliv_v2_5_test:872: error: expected primary-expression before '(' token
if (tm.Month<10) {val+="0"+String(tm.Month);}else{val+=String(tm.Month);}
^
Poliv_v2_5_test:872: error: expected primary-expression before '.' token
if (tm.Month<10) {val+="0"+String(tm.Month);}else{val+=String(tm.Month);}
^
Poliv_v2_5_test:872: error: expected primary-expression before '(' token
if (tm.Month<10) {val+="0"+String(tm.Month);}else{val+=String(tm.Month);}
^
Poliv_v2_5_test:872: error: expected primary-expression before '.' token
if (tm.Month<10) {val+="0"+String(tm.Month);}else{val+=String(tm.Month);}
^
Poliv_v2_5_test:873: error: 'tmYearToCalendar' was not declared in this scope
val+="/"+String(tmYearToCalendar(tm.Year));
^
Poliv_v2_5_test:873: error: expected primary-expression before '(' token
val+="/"+String(tmYearToCalendar(tm.Year));
^
Poliv_v2_5_test:873: error: expected primary-expression before '.' token
val+="/"+String(tmYearToCalendar(tm.Year));
^
exit status 1
'tmElements_t' does not name a type
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.