/**
Raspberry Pi Pico LED Bar Graph Binary Counter
https://wokwi.com/arduino/projects/309828467927548481
Copyright (C) 2021 Uri Shaked
*/
const int pins[] = { 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
void setup() {
for (int i = 0; i < 10; i++) {
pinMode(pins[i], OUTPUT);
}
}
int counter = 0;
void loop() {
for (int i = 0; i < 10; i++) {
digitalWrite(pins[i], bitRead(counter, i) ? HIGH : LOW);
}
counter++;
delay(50);
}
pico:GP0
pico:GP1
pico:GND.1
pico:GP2
pico:GP3
pico:GP4
pico:GP5
pico:GND.2
pico:GP6
pico:GP7
pico:GP8
pico:GP9
pico:GND.3
pico:GP10
pico:GP11
pico:GP12
pico:GP13
pico:GND.4
pico:GP14
pico:GP15
pico:GP16
pico:GP17
pico:GND.5
pico:GP18
pico:GP19
pico:GP20
pico:GP21
pico:GND.6
pico:GP22
pico:RUN
pico:GP26
pico:GP27
pico:GND.7
pico:GP28
pico:ADC_VREF
pico:3V3
pico:3V3_EN
pico:GND.8
pico:VSYS
pico:VBUS
bargraph1:A1
bargraph1:A2
bargraph1:A3
bargraph1:A4
bargraph1:A5
bargraph1:A6
bargraph1:A7
bargraph1:A8
bargraph1:A9
bargraph1:A10
bargraph1:C1
bargraph1:C2
bargraph1:C3
bargraph1:C4
bargraph1:C5
bargraph1:C6
bargraph1:C7
bargraph1:C8
bargraph1:C9
bargraph1:C10