3 Ekim 2022 Pazartesi

traffic light mblock5 text code and circuit work



#include <Arduino.h>
#include <Wire.h>
#include <SoftwareSerial.h>

void _delay(float seconds) {
long endTime = millis() + seconds * 1000;
while(millis() < endTime) _loop();
}

void setup() {
pinMode(2,OUTPUT);
pinMode(3,OUTPUT);
pinMode(4,OUTPUT);
while(1) {
digitalWrite(2,1);
digitalWrite(3,0);
digitalWrite(4,0);
_delay(5);
digitalWrite(2,0);
digitalWrite(3,1);
digitalWrite(4,0);
_delay(1);
digitalWrite(2,0);
digitalWrite(3,0);
digitalWrite(4,1);
_delay(5);

_loop();
}

}

void _loop() {
}

void loop() {
_loop();
}




python collection_counter and named_tuple