change constructor

This commit is contained in:
Siwat Sirichai 2024-01-11 21:47:03 +07:00
parent c718750c45
commit b4db37a8d6
3 changed files with 12 additions and 10 deletions

View file

@ -35,7 +35,7 @@ AirConditioner ac = {
***********************************************/
ESPMegaPRO espmega = ESPMegaPRO();
CUDDisplay cudDisplay = CUDDisplay();
CUDDisplay cudDisplay = CUDDisplay(&cudDisplayAdapter);
ClimateCard climateCard = ClimateCard(AIR_CONDITIONER_IR_PIN, ac,
AIR_CONDITIONER_SENSOR_TYPE, AIR_CONDITIONER_SENSOR_PIN,
@ -62,11 +62,12 @@ void setup() {
espmega.iot->registerCard(3);
cudDisplayAdapter.begin(CUD_DISPLAY_BAUD_RATE, SERIAL_8N1, CUD_DISPLAY_RX_PIN, CUD_DISPLAY_TX_PIN);
auto bindedGetTime = std::bind(&ESPMegaPRO::getTime, &espmega);
cudDisplay.begin(bindedGetTime, &cudDisplayAdapter, &espmega.inputs, &espmega.outputs, &climateCard);
cudDisplay.begin(bindedGetTime, &espmega.inputs, &espmega.outputs, &climateCard);
}
void loop() {
espmega.loop();
cudDisplay.loop();
}
void on_pin_change(uint8_t pin, uint8_t value) {