Saturday, 4 March 2023

TTB04: Create a Binary Counter Using the Pico W

from machine import Pin from time import sleep led1 = Pin(15, Pin.OUT) led2 = Pin(14, Pin.OUT) led3 = Pin(13, Pin.OUT) led4 = Pin(12, Pin.OUT) while True: led1.value(0) led2.value(0) led3.value(0) led4.value(0) sleep(.5) led1.value(0) led2.value(0) led3.value(0) led4.value(1) sleep(.5) led1.value(0) led2.value(0) led3.value(1) led4.value(0) sleep(.5) led1.value(0) led2.value(0) led3.value(1) led4.value(1) sleep(.5) led1.value(0) led2.value(1) led3.value(0) led4.value(0) sleep(.5) led1.value(0) led2.value(1) led3.value(0) led4.value(1) sleep(.5) led1.value(0) led2.value(1) led3.value(1) led4.value(0) sleep(.5) led1.value(0) led2.value(1) led3.value(1) led4.value(1) sleep(.5) led1.value(1) led2.value(0) led3.value(0) led4.value(0) sleep(.5) led1.value(1) led2.value(0) led3.value(0) led4.value(1) sleep(.5) led1.value(1) led2.value(0) led3.value(1) led4.value(0) sleep(.5) led1.value(1) led2.value(0) led3.value(1) led4.value(1) sleep(.5) led1.value(1) led2.value(1) led3.value(0) led4.value(0) sleep(.5) led1.value(1) led2.value(1) led3.value(0) led4.value(1) sleep(.5) led1.value(1) led2.value(1) led3.value(1) led4.value(0) sleep(.5) led1.value(1) led2.value(1) led3.value(1) led4.value(1) sleep(.5) https://www.youtube.com/watch?v=P1dzHNgAtvg&list=PLGs0VKk2DiYz8js1SJog21cDhkBqyAhC5&index=4

No comments: