/* Blink */ void setup() { pinMode(LED_BUILTIN, OUTPUT); } void loop() { digitalWrite(LED_BUILTIN, HIGH); delay(100); digitalWrite(LED_BUILTIN, LOW); delay(100); } |
/* # SEMÁFORO PARA RASPBERRY PI PICO # SETA43 # seta43.duckdns.org # seta43.blogspot.com # Palencia / España # 25-08-2022 */ #define sROJO 18 #define sAMARILLO 19 #define sVERDE 20 #define pVERDE 17 #define pROJO 16 int tPARPADEO=400; int tSEMAFORO=10000; int tAMARILLO=3000; long tPEATON=6000; void setup() { pinMode(sROJO, OUTPUT); pinMode(sAMARILLO, OUTPUT); pinMode(sVERDE, OUTPUT); pinMode(pVERDE, OUTPUT); pinMode(pROJO, OUTPUT); //#INICIALIZAR digitalWrite(sAMARILLO, HIGH); digitalWrite(sROJO, HIGH); digitalWrite(sVERDE, LOW); digitalWrite(pROJO, HIGH); digitalWrite(pVERDE, LOW); delay(2); } void loop() { digitalWrite(sAMARILLO, LOW); digitalWrite(sROJO, HIGH); digitalWrite(pROJO, LOW); digitalWrite(pVERDE, HIGH); delay(tPEATON); //Parpadeo verde peatón for(int z=0;z<=7;++z) { digitalWrite(pVERDE, LOW); delay(tPARPADEO); digitalWrite(pVERDE, HIGH); delay(tPARPADEO); } digitalWrite(pROJO, HIGH); delay(1000); digitalWrite(sVERDE, HIGH); digitalWrite(sROJO, LOW); delay(tSEMAFORO); digitalWrite(sAMARILLO, HIGH); digitalWrite(sVERDE, LOW); delay(tAMARILLO); } |
#python # 74 KHz import machine led = machine.Pin(17, machine.Pin.OUT) while True: led.value(0) led.value(1) |
// IDE arduino // sin goto 606 KHz // con goto 798 KHz void setup() { pinMode(17, OUTPUT); } void loop() { volver: digitalWrite(17, HIGH); digitalWrite(17, LOW); goto volver; } |