Search found 2 matches

by d3Ex22
Fri Mar 18, 2022 8:04 am
Forum: ESP32 Arduino
Topic: Unable to understand what is happening in this code
Replies: 2
Views: 1462

Re: Unable to understand what is happening in this code

I can't explain why one does work, but I can tell you why the other doesn't: the C compiler assumes that variables can only change after some specific events, e.g. a function call. In your while loop, if trigger is false, there is no function call in the 'path' the code takes, so the compiler assum...
by d3Ex22
Thu Mar 17, 2022 12:23 pm
Forum: ESP32 Arduino
Topic: Unable to understand what is happening in this code
Replies: 2
Views: 1462

Unable to understand what is happening in this code

Hello everyone, i have a question that might be trivial for some of you but i really can't understand what is going on. Do you understand why this work well: #include <Arduino.h> #define LED 12 #define R1 27 #define NO 14 bool RUNNING = true; bool TRIGGER = false; void IRAM_ATTR NO_trigger() { if(!T...