Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 6746

General • Re: Help with Pico ADC project

$
0
0
OK well first test was unsuccessful.

I wired the PICO as per my previous diagram, or as per this diagram, and used this code, but all I got was a readout of 3v3 without any chnage.

Any ideas?

Code:

from machine import Pin, ADCimport time# Create an ADC object linked to pin 26adc = ADC(Pin(26, mode=Pin.IN))while True:    # Read ADC and convert to voltage    val = adc.read_u16()    val = val * (3.3 / 65535)    print(round(val, 2), "V") # Keep only 2 digits    # Wait a bit before taking another reading    time.sleep_ms(100)
Untitled2 (Medium).png

Statistics: Posted by deanfourie1 — Wed Jun 19, 2024 6:08 am



Viewing all articles
Browse latest Browse all 6746

Trending Articles