GavinTryz / EasyPCF8563

Arduino library built to communicate with the PCF8563 Real Time Clock chip via I2C.
GNU General Public License v3.0
0 stars 0 forks source link

esp32 can not use #1

Open soontai opened 7 months ago

soontai commented 7 months ago

win10 + arduino 2.2.1 name=easyPCF8563 url= https://github.com/GavinTryz/EasyPCF8563 ide board: NodeMcu-32s (ESP32S)

I like EasyPCF8563 lib But in compile error:

In file included from c:\Users\mis.SOONTAITECH\Documents\Arduino\libraries\EasyPCF8563-master\EasyPCF8563.h:15, from c:\Users\mis.SOONTAITECH\Documents\Arduino\libraries\EasyPCF8563-master\EasyPCF8563.cpp:11: C:\Users\mis.SOONTAITECH\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11\libraries\Wire\src/Wire.h: In member function 'uint8_t EasyPCF8563::_readFromAddress(uint16_t)': C:\Users\mis.SOONTAITECH\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11\libraries\Wire\src/Wire.h:127:13: note: candidate 1: 'uint8_t TwoWire::requestFrom(int, int)' uint8_t requestFrom(int address, int size); ^~~ C:\Users\mis.SOONTAITECH\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.11\libraries\Wire\src/Wire.h:125:13: note: candidate 2: 'uint8_t TwoWire::requestFrom(uint8_t, uint8_t)' uint8_t requestFrom(uint8_t address, uint8_t size); ^~~

GavinTryz commented 7 months ago

Hi, please include your code, or tell me which file from examples/ you are using. Please note this library is very old, so I can’t guarantee I will be able to solve the issue.

soontai commented 7 months ago

Hi, please include your code, or tell me which file from examples/ you are using. Please note this library is very old, so I can’t guarantee I will be able to solve the issue.

I use setTime.ino Or this can only be performed on ESP8266? Is there any new pcf8563 library developed?

`/*

/*

include

include

// Create an instance of the real time clock, at address 0x51 // If it doesn't work and you're unsure what address to use, run an I2C scanner sketch. EasyPCF8563 rtc(0x51);

void setup() { Serial.begin(9600);

Serial.println("What is the current second?"); while(!Serial.available()){} // Wait for user input rtc.setSecond(Serial.parseInt()); // Set the current second onto the chip

Serial.println("What is the current minute?"); while(!Serial.available()){} // Wait for user input rtc.setMinute(Serial.parseInt()); // Set the current minute onto the chip

Serial.println("What is the current hour? (in 24-hour format)"); while(!Serial.available()){} // Wait for user input rtc.setHour(Serial.parseInt()); // Set the current hour onto the chip

Serial.println("What is the current day?"); while(!Serial.available()){} // Wait for user input rtc.setDay(Serial.parseInt()); // Set the current day onto the chip

Serial.println("What is the current month?"); while(!Serial.available()){} // Wait for user input rtc.setMonth(Serial.parseInt()); // Set the current month onto the chip

Serial.println("What is the current year?"); while(!Serial.available()){} // Wait for user input rtc.setYear(Serial.parseInt()); // Set the current year onto the chip

rtc.setWeekday(weekdayFromDate(rtc.getDay(), rtc.getMonth(), rtc.getYear())); // Automatically set the weekday using weekdayFromDate() }

void loop() { Serial.println("The current date and time is"); Serial.print(valueToWeekday(rtc.getWeekday())); // Gets the weekday number, then converts it to a string and prints it Serial.print(", "); Serial.println(rtc.getDateTime(FORMAT_MDY, FORMAT_12HR)); // Print date and time in month/day/year format and 12-hour format delay(5000); }`