Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define MAX_THERMOS 20
- boolean Therm_has_Done = false;
- typedef struct {
- uint16_t Set_Temp;
- uint16_t Min;
- uint16_t Hour;
- uint16_t Week;
- uint16_t Room_Temp;
- boolean Szelep_is_ON = false;
- long StartedTime = 0;
- } THERM_Struct;
- THERM_Struct * Smart_THERM[MAX_THERMOS] = {0};
- int Szelep_Timer_Counter = 0;
- static const inline void Thermos_Szelep_Timer_Checker(){
- if(Therm_has_Done){
- if(Smart_THERM[Szelep_Timer_Counter] != 0){
- if(Smart_THERM[Szelep_Timer_Counter]->Szelep_is_ON){
- if(millis() - Smart_THERM[Szelep_Timer_Counter]->StartedTime >= 20000){
- Smart_THERM[Szelep_Timer_Counter]->Timer_Is_On = true;
- Serial.println("Valahogy bejöttünk ide úgy hogy elméletileg a tömb minden eleme 0");
- }
- }
- }
- Szelep_Timer_Counter++;if(Szelep_Timer_Counter > MAX_THERMOS){Szelep_Timer_Counter = 0;}
- }
- }
- static const inline void Init_Structs(){
- for(int i = 0; i < MAX_THERMOS; i++){
- Smart_THERM[i] = new THERM_Struct;
- Smart_THERM[i] = 0;
- }
- }
- void setup(){
- Serial.begin(115200);
- Init_Structs();
- }
- void loop(){
- Thermos_Szelep_Timer_Checker();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement