resolve CT merge conflict
This commit is contained in:
commit
a727962a53
3 changed files with 54 additions and 3 deletions
52
src/main.cpp
52
src/main.cpp
|
|
@ -24,6 +24,19 @@ RemoteVariable weather = RemoteVariable();
|
|||
RemoteVariable pm_switch = RemoteVariable();
|
||||
RemoteVariable pm_fan_speed = RemoteVariable();
|
||||
|
||||
float adc2current(uint16_t adc_val) {
|
||||
return adc_val * 1.0;
|
||||
}
|
||||
|
||||
#define CT_INTERVAL 5000
|
||||
|
||||
CurrentTransformerCard ct1 = CurrentTransformerCard(&analogCard, 0, &voltage, &adc2current, 5000);
|
||||
CurrentTransformerCard ct2 = CurrentTransformerCard(&analogCard, 1, &voltage, &adc2current, 5000);
|
||||
CurrentTransformerCard ct3 = CurrentTransformerCard(&analogCard, 2, &voltage, &adc2current, 5000);
|
||||
CurrentTransformerCard ct4 = CurrentTransformerCard(&analogCard, 3, &voltage, &adc2current, 5000);
|
||||
CurrentTransformerCard ct5 = CurrentTransformerCard(&analogCard, 4, &voltage, &adc2current, 5000);
|
||||
CurrentTransformerCard ct6 = CurrentTransformerCard(&analogCard, 5, &voltage, &adc2current, 5000);
|
||||
|
||||
// Light Configuration
|
||||
uint8_t row = 4;
|
||||
uint8_t column = 2;
|
||||
|
|
@ -117,6 +130,7 @@ void setup()
|
|||
|
||||
// // ------------ Factory Reset Routine ------------
|
||||
// Disable factory reset for now
|
||||
espmega.inputs.loop();
|
||||
// if (clear_fram)
|
||||
// {
|
||||
// Serial.print("boot_state.txt=\"Factory Resetting . . .\"");
|
||||
|
|
@ -161,6 +175,44 @@ void setup()
|
|||
espmega.outputs.setValue(i, 4095);
|
||||
}
|
||||
// ------------ End Inputs and Outputs Initialization Routine ------------
|
||||
espmega.outputs.setState(12, true);
|
||||
espmega.outputs.setValue(12,4095);
|
||||
espmega.installCard(2, &climateCard_daikin);
|
||||
climateCard_daikin.bindFRAM(&espmega.fram, 5000);
|
||||
climateCard_daikin.loadStateFromFRAM();
|
||||
climateCard_daikin.setFRAMAutoSave(true);
|
||||
espmega.display->bindClimateCard(&climateCard_daikin);
|
||||
|
||||
// Current Transformers
|
||||
espmega.installCard(4, &analogCard);
|
||||
|
||||
espmega.installCard(5, &ct1);
|
||||
ct1.bindFRAM(&espmega.fram, 6000);
|
||||
espmega.iot->registerCard(5);
|
||||
|
||||
espmega.installCard(6, &ct2);
|
||||
ct2.bindFRAM(&espmega.fram, 6100);
|
||||
espmega.iot->registerCard(6);
|
||||
|
||||
espmega.installCard(7, &ct3);
|
||||
ct3.bindFRAM(&espmega.fram, 6200);
|
||||
espmega.iot->registerCard(7);
|
||||
espmega.installCard(8, &ct4);
|
||||
ct4.bindFRAM(&espmega.fram, 6300);
|
||||
espmega.iot->registerCard(8);
|
||||
espmega.installCard(9, &ct5);
|
||||
ct5.bindFRAM(&espmega.fram, 6400);
|
||||
espmega.iot->registerCard(9);
|
||||
espmega.installCard(10, &ct6);
|
||||
ct6.bindFRAM(&espmega.fram, 6500);
|
||||
espmega.iot->registerCard(10);
|
||||
|
||||
// auto binded_display_update_on_pm25_out = std::bind(&display_update,0,std::placeholders::_1);
|
||||
// auto binded_display_update_on_pm25_in = std::bind(&display_update,1,std::placeholders::_1);
|
||||
// auto binded_display_update_on_temp_out = std::bind(&display_update,2,std::placeholders::_1);
|
||||
// auto binded_display_update_on_weather = std::bind(&display_update,3,std::placeholders::_1);
|
||||
// auto binded_display_update_on_pm_switch = std::bind(&display_update,4,std::placeholders::_1);
|
||||
// auto binded_display_update_on_pm_fan_speed = std::bind(&display_update,5,std::placeholders::_1);
|
||||
|
||||
|
||||
// ------------ Climate Cards Initialization Routine ------------
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ SET_LOOP_TASK_STACK_SIZE(32*1024);
|
|||
#include <ise_display.hpp>
|
||||
#include <ir_codes_daikin.hpp>
|
||||
#include <ir_codes_york.hpp>
|
||||
#include <CurrentTransformerCard.hpp>
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue