olehs / PZEM004T

Arduino communication library for Peacefair PZEM-004T Energy monitor
MIT License
226 stars 114 forks source link

Compiler error when used with Arduino UNO Wifi REV 2 #70

Closed MikeHales1 closed 3 years ago

MikeHales1 commented 3 years ago

When attempting to use with the Arduino UNO Wifi Rev 2 module, the compiler generates the following errors:

O:\Documents\Arduino\libraries\PZEM004Tv30\PZEM004Tv30.cpp:54:23: error: conflicting declaration 'arduino::HardwareSerial Serial' extern HardwareSerial Serial; ^~ In file included from C:\Users\Mike\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.7\cores\arduino/Arduino.h:140:0, from O:\Documents\Arduino\libraries\PZEM004Tv30\PZEM004Tv30.h:47, from O:\Documents\Arduino\libraries\PZEM004Tv30\PZEM004Tv30.cpp:23: C:\Users\Mike\AppData\Local\Arduino15\packages\arduino\hardware\megaavr\1.8.7\cores\arduino/UART.h:182:20: note: previous declaration as 'UartClass Serial' extern UartClass Serial; ^~ exit status 1 Error compiling for board Arduino Uno WiFi Rev2.

I've previously compiler to Arduino MEGA without any problems. I used the Example file 'PZEMHardSerial' with Serial3 changed to Serial1.

Please advise. Thanks.

olehs commented 3 years ago

PZEM004Tv30 ? Are you sure this is the right repo ? ;)

MikeHales1 commented 3 years ago

Olehs, Sorry you are correct.