Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Examples: Update ADC() #966

Merged
merged 1 commit into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion micropython/examples/pico_lipo_shim/battery_pico.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

display.set_backlight(0.8)

vsys = ADC(29) # reads the system input voltage
vsys = ADC(Pin(29)) # reads the system input voltage
charging = Pin(24, Pin.IN) # reading GP24 tells us whether or not USB power is connected
conversion_factor = 3 * 3.3 / 65535

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

display.set_backlight(0.8)

vsys = ADC(29) # reads the system input voltage
vsys = ADC(Pin(29)) # reads the system input voltage
charging = Pin(24, Pin.IN) # reading GP24 tells us whether or not USB power is connected
conversion_factor = 3 * 3.3 / 65535

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

buzzer = Buzzer(0)

vsys = ADC(29) # reads the system input voltage
vsys = ADC(Pin(29)) # reads the system input voltage
charging = Pin(24, Pin.IN) # reading GP24 tells us whether or not USB power is connected
conversion_factor = 3 * 3.3 / 65535

Expand Down
6 changes: 3 additions & 3 deletions micropython/examples/tufty2040/autobright.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
button_b = Button(8, invert=False)
# Pins and analogue-digital converters we need to set up to measure sensors.
lux_vref_pwr = Pin(27, Pin.OUT)
lux = ADC(26)
vbat_adc = ADC(29)
vref_adc = ADC(28)
lux = ADC(Pin(26))
vbat_adc = ADC(Pin(29))
vref_adc = ADC(Pin(28))
usb_power = Pin(24, Pin.IN)

display = PicoGraphics(display=DISPLAY_TUFTY_2040)
Expand Down
4 changes: 2 additions & 2 deletions micropython/examples/tufty2040/battery.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
display.set_backlight(0.8)

# set up the ADCs for measuring battery voltage
vbat_adc = ADC(29)
vref_adc = ADC(28)
vbat_adc = ADC(Pin(29))
vref_adc = ADC(Pin(28))
vref_en = Pin(27)
vref_en.init(Pin.OUT)
vref_en.value(0)
Expand Down