The program continuously prints to the USB the value of the ADC on GPIO 26 once every 0.2 seconds.
The onboard LED is blinked as a heartbeat.
The hello world is with a potentiometer: extremes on GND and VCC pins of the Pi, and middle output on pin GIO26, then as you turn the knob, the uart value goes from about 0 to about 64k.
The 0 side is quite noisy and varies between 0 and 300 for some reason.
In Ciro's ASCII art circuit diagram notation:
RPI_PICO_W__gnd__gpio26Adc__3.3V@36
| | |
| | |
| +-+ |
| | |
| | +---------+
| | |
P__1__2__3rpi-pico-w/upython/adc.py
from machine import ADC, Pin
from time import sleep
led = Pin('LED', Pin.OUT)
adc = ADC(Pin(26))
while True:
print(adc.read_u16())
led.toggle()
sleep(0.2)
Ancestors
- Raspberry Pi Pico W MicroPython example
- Program Raspberry Pi Pico W with MicroPython
- Program Raspberry Pi Pico W with X
- Raspberry Pi Pico W
- Raspberry Pi Pico variant
- Raspberry Pi Pico
- Raspberry Pi
- Raspberry Pi Foundation project
- Raspberry Pi Foundation
- Computer manufacturer
- Computer hardware
- Computer
- Information technology
- Area of technology
- Technology
- Home
Ciro Santilli