diff --git a/micropython/examples/pico_lipo_shim/battery_pico.py b/micropython/examples/pico_lipo_shim/battery_pico.py index ad2e1ed8b..096f3c5f5 100644 --- a/micropython/examples/pico_lipo_shim/battery_pico.py +++ b/micropython/examples/pico_lipo_shim/battery_pico.py @@ -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 diff --git a/micropython/examples/pimoroni_pico_lipo/battery_pico_display.py b/micropython/examples/pimoroni_pico_lipo/battery_pico_display.py index 373e314af..c3501f229 100644 --- a/micropython/examples/pimoroni_pico_lipo/battery_pico_display.py +++ b/micropython/examples/pimoroni_pico_lipo/battery_pico_display.py @@ -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 diff --git a/micropython/examples/pimoroni_pico_lipo/battery_pico_explorer.py b/micropython/examples/pimoroni_pico_lipo/battery_pico_explorer.py index 5630141d0..ab030d0fd 100644 --- a/micropython/examples/pimoroni_pico_lipo/battery_pico_explorer.py +++ b/micropython/examples/pimoroni_pico_lipo/battery_pico_explorer.py @@ -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 diff --git a/micropython/examples/tufty2040/autobright.py b/micropython/examples/tufty2040/autobright.py index 0f035b160..1cc819ca4 100644 --- a/micropython/examples/tufty2040/autobright.py +++ b/micropython/examples/tufty2040/autobright.py @@ -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) diff --git a/micropython/examples/tufty2040/battery.py b/micropython/examples/tufty2040/battery.py index c881c2625..03c85d77e 100644 --- a/micropython/examples/tufty2040/battery.py +++ b/micropython/examples/tufty2040/battery.py @@ -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)