ID photo of Ciro Santilli taken in 2013 right eyeCiro Santilli OurBigBook logoOurBigBook.com  Sponsor 中国独裁统治 China Dictatorship 新疆改造中心、六四事件、法轮功、郝海东、709大抓捕、2015巴拿马文件 邓家贵、低端人口、西藏骚乱
rpi-pico-w/upython/adc.py: analog-to-digital converter.
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__3
rpi-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 (16)

  1. Raspberry Pi Pico W MicroPython example
  2. Program Raspberry Pi Pico W with MicroPython
  3. Program Raspberry Pi Pico W with X
  4. Raspberry Pi Pico W
  5. Raspberry Pi Pico variant
  6. Raspberry Pi Pico
  7. Raspberry Pi
  8. Raspberry Pi Foundation project
  9. Raspberry Pi Foundation
  10. Computer manufacturer
  11. Computer hardware
  12. Computer
  13. Information technology
  14. Area of technology
  15. Technology
  16. Home