Skip to content

Commit

Permalink
Examples: Update ADC()
Browse files Browse the repository at this point in the history
  • Loading branch information
helgibbons committed Jul 2, 2024
1 parent f18f1ba commit b5d496b
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
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

0 comments on commit b5d496b

Please sign in to comment.