digital output card
This commit is contained in:
parent
85f789e216
commit
09aee8d5f8
|
@ -32,7 +32,7 @@ DigitalOutputCard::DigitalOutputCard(uint8_t address) : change_callbacks(){
|
||||||
* @param bit4 The position of the fifth switch on the dip switch
|
* @param bit4 The position of the fifth switch on the dip switch
|
||||||
*/
|
*/
|
||||||
DigitalOutputCard::DigitalOutputCard(bool bit0, bool bit1, bool bit2, bool bit3, bool bit4) :
|
DigitalOutputCard::DigitalOutputCard(bool bit0, bool bit1, bool bit2, bool bit3, bool bit4) :
|
||||||
DigitalOutputCard(0x20+bit0+bit1*2+bit2*4+bit3*8+bit4*16)
|
DigitalOutputCard(0x40+bit0+bit1*2+bit2*4+bit3*8+bit4*16)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -19,18 +19,22 @@
|
||||||
// #define RTC_DEBUG
|
// #define RTC_DEBUG
|
||||||
// #define WRITE_DEFAULT_NETCONF
|
// #define WRITE_DEFAULT_NETCONF
|
||||||
// #define CLIMATE_CARD_ENABLE
|
// #define CLIMATE_CARD_ENABLE
|
||||||
//#define MQTT_CARD_REGISTER
|
#define MQTT_CARD_REGISTER
|
||||||
// #define DISPLAY_ENABLE
|
// #define DISPLAY_ENABLE
|
||||||
//#define WEB_SERVER_ENABLE
|
#define WEB_SERVER_ENABLE
|
||||||
// #define LCD_OTA_ENABLE
|
// #define LCD_OTA_ENABLE
|
||||||
// #define REMOTE_VARIABLE_ENABLE
|
// #define REMOTE_VARIABLE_ENABLE
|
||||||
// #define CT_ENABLE
|
// #define CT_ENABLE
|
||||||
// #define SMART_VARIABLE_ENABLE
|
// #define SMART_VARIABLE_ENABLE
|
||||||
|
#define EXTERNAL_DIGITAL_OUTPUT_CARD_ENABLE
|
||||||
// Demo PLC firmware using the ESPMegaPRO OOP library
|
// Demo PLC firmware using the ESPMegaPRO OOP library
|
||||||
|
|
||||||
ESPMegaPRO espmega = ESPMegaPRO();
|
ESPMegaPRO espmega = ESPMegaPRO();
|
||||||
|
|
||||||
|
#ifdef EXTERNAL_DIGITAL_OUTPUT_CARD_ENABLE
|
||||||
|
DigitalOutputCard externalDigitalOutputCard = DigitalOutputCard(1, 0, 1, 1, 0);
|
||||||
|
#endif
|
||||||
|
|
||||||
// Remote Variable
|
// Remote Variable
|
||||||
#ifdef REMOTE_VARIABLE_ENABLE
|
#ifdef REMOTE_VARIABLE_ENABLE
|
||||||
RemoteVariable testVar = RemoteVariable();
|
RemoteVariable testVar = RemoteVariable();
|
||||||
|
@ -166,6 +170,9 @@ void setup()
|
||||||
{
|
{
|
||||||
ESP_LOGI("Initializer", "Starting ESPMegaPRO OOP demo");
|
ESP_LOGI("Initializer", "Starting ESPMegaPRO OOP demo");
|
||||||
espmega.begin();
|
espmega.begin();
|
||||||
|
#ifdef EXTERNAL_DIGITAL_OUTPUT_CARD_ENABLE
|
||||||
|
espmega.installCard(6, &externalDigitalOutputCard);
|
||||||
|
#endif
|
||||||
espmega.setTimezone("UTC-7");
|
espmega.setTimezone("UTC-7");
|
||||||
ESP_LOGI("Initializer", "Enabling IOT module");
|
ESP_LOGI("Initializer", "Enabling IOT module");
|
||||||
espmega.enableIotModule();
|
espmega.enableIotModule();
|
||||||
|
@ -205,6 +212,10 @@ void setup()
|
||||||
espmega.iot->registerCard(0);
|
espmega.iot->registerCard(0);
|
||||||
ESP_LOGI("Initializer", "Registering cards 1");
|
ESP_LOGI("Initializer", "Registering cards 1");
|
||||||
espmega.iot->registerCard(1);
|
espmega.iot->registerCard(1);
|
||||||
|
#ifdef EXTERNAL_DIGITAL_OUTPUT_CARD_ENABLE
|
||||||
|
ESP_LOGI("Initializer", "Registering cards 6");
|
||||||
|
espmega.iot->registerCard(6);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
ESP_LOGI("Initializer", "Registering Input change callback");
|
ESP_LOGI("Initializer", "Registering Input change callback");
|
||||||
espmega.inputs.registerCallback(input_change_callback);
|
espmega.inputs.registerCallback(input_change_callback);
|
||||||
|
|
Loading…
Reference in New Issue