Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [main.cpp]
- #include <PVinverter.h>
- // inverter lib constructor
- PV_INVERTER inverter(Serial2);
- #include <PVinverterLCD.h>
- //U8G2_ST7920_128X64_F_SW_SPI u8g2(U8G2_R0, /* clock=*/ 25, /* data= /R/w */ 33, /* CS=*/ 32, /* reset= */ U8X8_PIN_NONE ); // ESP32
- PVinverterLCD lcd( 25, 33,32, U8X8_PIN_NONE);
- [....]
- [pvinverter.h]
- class PV_INVERTER
- {
- public:
- [...]
- typedef struct DevStatus_t
- {
- bool changingFloatMode = 0 ;
- bool SwitchOn = 0 ;
- bool dustProof = 0 ;
- bool SBUpriority = 0 ;
- bool ConfigStatus = 0 ;
- bool FwUpdate = 0 ;
- bool LoadStatus = 0 ;
- bool BattVoltSteady = 0 ;
- bool Chargingstatus = 0 ;
- bool SCCcharge = 0 ;
- bool ACcharge = 0 ;
- } DevStatus_t;
- devStatus_t DevStatus;
- [...]
- [PVinverterlcd.h]
- #ifndef INVERTERLCD_H
- #define INVERTERLCD_H
- #ifndef ARDUINO_H
- #include <Arduino.h>
- #endif
- #include <PVinverter.h>
- #include <U8g2lib.h>
- #ifdef U8X8_HAVE_HW_SPI
- #include <SPI.h>
- #endif
- class PVinverterLCD
- {
- [...]
- [PVinverterLCD.CPP]
- extern struct DevStatus_t DevStatus;
- void PVinverterLCD::QPIGS()
- {
- [...]
- u8g2.setFont(_INVLCD_DISP_font);
- bool a = DevStatus.ACcharge; // error: invalid use of incomplete type 'struct DevStatus_t'
- u8g2.drawStr(0,10,(const char*)a);
- u8g2.sendBuffer
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement