Прошу помощи или совета.
Суть вот в чем, хочу сделать контроль показаний температуры и влажности в 8-ми помещениях (16 переменных).
В каждом помещении по 3 исполнительных устройства ( 24 реле, 24 переменных)
Итого 40 переменных, 24 буля и 16 стрингов.
Вывод этих показаний на панель Nextion и с нее же индивидуальное управление каждым реле (Dual-Button).
В FLProg gробно создал один датчик 18b20, опрос раз с секунду, при изменении отправка в переменную на панель.
В Nextion создал три кнопки с фиксацией нажатия и отправка состояния в булеановские переменные FLProg.
Управление через скачанный блок от Sancho PCF8574-OUT
Проверил работу, все ок, температура на экран выводится, светодиоды подключенные к pcf8574 управляются.
Скопипастил кол-во кнопок и выходов до 24, управление выходами пошло с задержкой на пару секунд
Добавил еще 7 датчиков 18b20, плату ds3231 и начались полные тормоза. Ардуино ругается что мало памяти осталось, возможны глюки.
В листинге ардуино такое вот
[hide]
Код: Выделить всё
[shadow=blue]#include <Wire.h>
#include <Wire.h>[/shadow]
#include <OneWire.h>
byte _d18x2x2Addr[8]={0x28, 0xAC, 0x57, 0xB1, 0x1, 0x0, 0x0, 0x4E};
byte _d18x2x3Addr[8]={0x28, 0xA3, 0xD9, 0xB2, 0x1, 0x0, 0x0, 0x8B};
byte _d18x2x4Addr[8]={0x28, 0x25, 0xF1, 0xB1, 0x1, 0x0, 0x0, 0x9D};
byte _d18x2x5Addr[8]={0x28, 0x19, 0xB5, 0xAF, 0x1, 0x0, 0x0, 0xD6};
byte _d18x2x6Addr[8]={0x28, 0x25, 0x85, 0xE5, 0x0, 0x0, 0x0, 0x92};
byte _d18x2x1Addr[8]={0x28, 0x10, 0xCD, 0xE5, 0x0, 0x0, 0x0, 0x43};
byte _d18x2x7Addr[8]={0x28, 0xBE, 0x1A, 0xB0, 0x1, 0x0, 0x0, 0xF1};
byte _d18x2x8Addr[8]={0x28, 0xD7, 0xA4, 0xB2, 0x1, 0x0, 0x0, 0x4E};
OneWire _ow4(4);
bool P0_196714420_1;
bool P1_196714420_1;
bool P2_196714420_1;
bool P3_196714420_1;
bool P4_196714420_1;
bool P5_196714420_1;
bool P6_196714420_1;
bool P7_196714420_1;
byte byte_in_196714420_1;
byte byte_out_196714420_1;
bool P0_196714420_2;
bool P1_196714420_2;
bool P2_196714420_2;
bool P3_196714420_2;
bool P4_196714420_2;
bool P5_196714420_2;
bool P6_196714420_2;
bool P7_196714420_2;
byte byte_in_196714420_2;
byte byte_out_196714420_2;
bool P0_196714420_3;
bool P1_196714420_3;
bool P2_196714420_3;
bool P3_196714420_3;
bool P4_196714420_3;
bool P5_196714420_3;
bool P6_196714420_3;
bool P7_196714420_3;
byte byte_in_196714420_3;
byte byte_out_196714420_3;
String _nextionSaveDataTXT_P0_E4;
String _nextionSaveDataTXT_P0_E30;
String _nextionSaveDataTXT_P0_E32;
String _nextionSaveDataTXT_P0_E34;
String _nextionSaveDataTXT_P0_E36;
String _nextionSaveDataTXT_P0_E38;
String _nextionSaveDataTXT_P0_E40;
String _nextionSaveDataTXT_P0_E42;
struct _nextionLissenStruct{
char code;
String result;
long number;
};
_nextionLissenStruct _nextionTempLissen;
struct _I2CRealRimeClockTime
{
byte seconds = 0;
byte minutes = 0;
byte Hours = 0;
byte weekday = 0;
byte day = 0;
byte month = 0;
byte year = 0;
unsigned long startTime = 0;
};
_I2CRealRimeClockTime _RTC1;
int _PWDC = 0;
bool _gtv1 = 0;
bool _gtv2 = 0;
bool _gtv3 = 0;
bool _gtv4 = 0;
bool _gtv5 = 0;
bool _gtv6 = 0;
bool _gtv7 = 0;
bool _gtv8 = 0;
bool _gtv10 = 0;
bool _gtv11 = 0;
bool _gtv12 = 0;
bool _gtv13 = 0;
bool _gtv14 = 0;
bool _gtv15 = 0;
bool _gtv16 = 0;
bool _gtv18 = 0;
bool _gtv19 = 0;
bool _gtv20 = 0;
bool _gtv21 = 0;
bool _gtv22 = 0;
bool _gtv23 = 0;
bool _gtv24 = 0;
bool _gtv58 = 0;
bool _gtv17 = 0;
float _gtv25 = 0;
float _gtv26 = 0;
float _gtv27 = 0;
float _gtv28 = 0;
float _gtv29 = 0;
float _gtv30 = 0;
float _gtv31 = 0;
float _gtv32 = 0;
bool _gtv33 = 0;
String _gtv9;
String _gtv35;
bool _nextionGetValue19_outputValue;
long _nextionGetValue19_StartTime;
bool _nextionGetValue19_isNU = 0;
bool _changeNumber9_Out = 0;
int _changeNumber9_OLV;
unsigned long _d18x2x1Tti = 0UL;
float _d18x2x1O = 0.00;
bool _nextionGetValue16_outputValue;
long _nextionGetValue16_StartTime;
bool _nextionGetValue16_isNU = 0;
bool _nextionGetValue13_outputValue;
long _nextionGetValue13_StartTime;
bool _nextionGetValue13_isNU = 0;
bool _nextionGetValue10_outputValue;
long _nextionGetValue10_StartTime;
bool _nextionGetValue10_isNU = 0;
String _GSFS8 = "0";
String _GSFS7 = "0";
String _GSFS6 = "0";
bool _nextionSetAttr6_isNU = 0;
bool _nextionSetAttr6_oldState = 0;
bool _nextionGetValue24_outputValue;
long _nextionGetValue24_StartTime;
bool _nextionGetValue24_isNU = 0;
bool _nextionSetAttr3_isNU = 0;
bool _nextionSetAttr3_oldState = 0;
unsigned long _d18x2x6Tti = 0UL;
float _d18x2x6O = 0.00;
bool _nextionSetAttr2_isNU = 0;
bool _nextionSetAttr2_oldState = 0;
bool _nextionGetValue21_outputValue;
long _nextionGetValue21_StartTime;
bool _nextionGetValue21_isNU = 0;
unsigned long _d18x2x3Tti = 0UL;
float _d18x2x3O = 0.00;
bool _nextionGetValue18_outputValue;
long _nextionGetValue18_StartTime;
bool _nextionGetValue18_isNU = 0;
bool _nextionGetValue15_outputValue;
long _nextionGetValue15_StartTime;
bool _nextionGetValue15_isNU = 0;
String _RTC1_GetTime2_StrOut;
String _GSFS2 = "0";
bool _nextionSetAttr8_isNU = 0;
bool _nextionSetAttr8_oldState = 0;
bool _nextionGetValue7_outputValue;
long _nextionGetValue7_StartTime;
bool _nextionGetValue7_isNU = 0;
unsigned long _d18x2x8Tti = 0UL;
float _d18x2x8O = 0.00;
bool _nextionGetValue23_outputValue;
long _nextionGetValue23_StartTime;
bool _nextionGetValue23_isNU = 0;
bool _nextionGetValue4_outputValue;
long _nextionGetValue4_StartTime;
bool _nextionGetValue4_isNU = 0;
unsigned long _d18x2x5Tti = 0UL;
float _d18x2x5O = 0.00;
unsigned long _d18x2x2Tti = 0UL;
float _d18x2x2O = 0.00;
bool _nextionGetValue2_outputValue;
long _nextionGetValue2_StartTime;
bool _nextionGetValue2_isNU = 0;
bool _changeNumber2_Out = 0;
int _changeNumber2_OLV;
String _GSFS1 = "0";
bool _nextionGetValue6_outputValue;
long _nextionGetValue6_StartTime;
bool _nextionGetValue6_isNU = 0;
unsigned long _d18x2x7Tti = 0UL;
float _d18x2x7O = 0.00;
bool _nextionGetValue3_outputValue;
long _nextionGetValue3_StartTime;
bool _nextionGetValue3_isNU = 0;
unsigned long _d18x2x4Tti = 0UL;
float _d18x2x4O = 0.00;
String _GSFS5 = "0";
bool _nextionGetValue1_outputValue;
long _nextionGetValue1_StartTime;
bool _nextionGetValue1_isNU = 0;
String _GSFS4 = "0";
String _GSFS3 = "0";
bool _changeNumber1_Out = 0;
int _changeNumber1_OLV;
bool _nextionSetAttr1_isNU = 0;
bool _nextionSetAttr1_oldState = 0;
bool _nextionGetValue12_outputValue;
long _nextionGetValue12_StartTime;
bool _nextionGetValue12_isNU = 0;
bool _nextionGetValue9_outputValue;
long _nextionGetValue9_StartTime;
bool _nextionGetValue9_isNU = 0;
bool _nextionGetValue8_outputValue;
long _nextionGetValue8_StartTime;
bool _nextionGetValue8_isNU = 0;
bool _nextionGetValue5_outputValue;
long _nextionGetValue5_StartTime;
bool _nextionGetValue5_isNU = 0;
bool _nextionSetAttr5_isNU = 0;
bool _nextionSetAttr5_oldState = 0;
bool _nextionGetValue20_outputValue;
long _nextionGetValue20_StartTime;
bool _nextionGetValue20_isNU = 0;
bool _nextionGetValue17_outputValue;
long _nextionGetValue17_StartTime;
bool _nextionGetValue17_isNU = 0;
bool _nextionGetValue14_outputValue;
long _nextionGetValue14_StartTime;
bool _nextionGetValue14_isNU = 0;
bool _nextionGetValue11_outputValue;
long _nextionGetValue11_StartTime;
bool _nextionGetValue11_isNU = 0;
String _RTC1_GetTime1_StrOut;
bool _changeNumber6_Out = 0;
int _changeNumber6_OLV;
bool _changeNumber5_Out = 0;
int _changeNumber5_OLV;
bool _changeNumber4_Out = 0;
int _changeNumber4_OLV;
bool _changeNumber3_Out = 0;
int _changeNumber3_OLV;
bool _nextionSetAttr7_isNU = 0;
bool _nextionSetAttr7_oldState = 0;
bool _nextionSetAttr4_isNU = 0;
bool _nextionSetAttr4_oldState = 0;
bool _nextionGetValue22_outputValue;
long _nextionGetValue22_StartTime;
bool _nextionGetValue22_isNU = 0;
bool _changeNumber10_Out = 0;
int _changeNumber10_OLV;
void setup()
{
Wire.begin();
delay(10);
TCCR2A = 0x00;
TCCR2B = 0x07;
TIMSK2=0x01;
TCNT2=100;
Wire.beginTransmission(68);
Wire.write(0x0E);
Wire.write(B00000000);
Wire.write(B10001000);
Wire.endTransmission();
_RTC1.startTime = millis() - 1000;
[dropshadow=blue]Serial.begin(9600);
Serial.begin(9600);
Serial.begin(9600);
Serial.begin(9600);
Serial.begin(9600);
Serial.begin(9600);
Serial.begin(9600);
Serial.begin(9600);
Serial.begin(9600);
Serial.begin(9600);
Serial.begin(9600);
Serial.begin(9600);
Serial.begin(9600);
Serial.begin(9600);
Serial.begin(9600);
Serial.begin(9600);
Serial.begin(9600);
Serial.begin(9600);
Serial.begin(9600);
Serial.begin(9600);
Serial.begin(9600);
Serial.begin(9600);
Serial.begin(9600);
Serial.begin(9600);
Serial.begin(9600);
Serial.begin(9600);
Serial.begin(9600);
Serial.begin(9600);
Serial.begin(9600);
Serial.begin(9600);
Serial.begin(9600);
Serial.begin(9600);[/dropshadow]
nextionSendCommand("", 0);
nextionSendCommand("page 0", 0);
_nextionGetValue1_StartTime = millis();
_nextionGetValue2_StartTime = millis();
_nextionGetValue3_StartTime = millis();
_nextionGetValue4_StartTime = millis();
_nextionGetValue5_StartTime = millis();
_nextionGetValue6_StartTime = millis();
_nextionGetValue7_StartTime = millis();
_nextionGetValue8_StartTime = millis();
_nextionGetValue9_StartTime = millis();
_nextionGetValue10_StartTime = millis();
_nextionGetValue11_StartTime = millis();
_nextionGetValue12_StartTime = millis();
_nextionGetValue13_StartTime = millis();
_nextionGetValue14_StartTime = millis();
_nextionGetValue15_StartTime = millis();
_nextionGetValue16_StartTime = millis();
_nextionGetValue17_StartTime = millis();
_nextionGetValue18_StartTime = millis();
_nextionGetValue19_StartTime = millis();
_nextionGetValue20_StartTime = millis();
_nextionGetValue21_StartTime = millis();
_nextionGetValue22_StartTime = millis();
_nextionGetValue23_StartTime = millis();
_nextionGetValue24_StartTime = millis();
[dropshadow=blue] Wire.begin();
Wire.begin();
Wire.begin();[/dropshadow]
}
void loop()
{String _tempVariable_String;
int _tempVariable_int;
_PWDC = 0;
Это нормально, или где-то косяк искать?
В дальнейшем планировалось два режима, ручной и автомат. В автомате работа одного реле по гистерезису температуры, второго по влажности. Но теперь бооольшие сомнения, а потянет ли UNO это?