DIY Projects Lab
Published © CC BY-NC-SA

How to use ADC On Raspberry Pi Pico using MicroPython

In this guide we will show you how to use the ADC on your Raspberry Pi Pico using MicroPython. We will also go over some of the basic concpt

BeginnerFull instructions provided1 hour9,773
How to use ADC On Raspberry Pi Pico using MicroPython

Things used in this project

Hardware components

Raspberry pi pico
×1
Rotary potentiometer (generic)
Rotary potentiometer (generic)
×1
Jumper wires (generic)
Jumper wires (generic)
×1
LED (generic)
LED (generic)
×1
Arduino Nano R3
Arduino Nano R3
×1

Software apps and online services

thonny

Story

Read more

Schematics

Schematics

Code

Code

Python
import machine
import utime
 
led_red = machine.PWM(machine.Pin(10))
potentiometer = machine.ADC(26)
 
led_red.freq(1000)
 
while True:
    led_red.duty_u16(potentiometer.read_u16())

Credits

DIY Projects Lab

DIY Projects Lab

41 projects • 156 followers
I am a DIY hobbyist by passion and an Electronics Engineer by profession. Sponsor (PCB Manufacturer) - www.nextpcb.com

Comments