Loading
Loading
IoT Lab content is currently available in Arabic only. We're working on an English version.
عرض بالعربية →How to build code with hundreds of lines without everything becoming chaos.
unsigned long lastTime = 0;
void setup() { }
void loop() {
if(millis() - lastTime > 1000) {
lastTime = millis();
readSensors();
}
checkButtons(); // يعمل باستمرار بدون بلوك
}
void readSensors() { /* كود الحساسات */ }
void checkButtons() { /* كود الأزرار */ }Using delay(5000) to read a sensor every 5 seconds — this means the board won't respond to any button press or Wi-Fi message for those 5 seconds.