Merge pull request #966 from pimoroni/examples-fix-adc

Examples: Update ADC()
pull/873/merge
Philip Howard 2024-10-31 12:13:24 +00:00 zatwierdzone przez GitHub
commit b8f4bd3f67
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
5 zmienionych plików z 8 dodań i 8 usunięć

Wyświetl plik

@ -12,7 +12,7 @@ display = PicoGraphics(display=DISPLAY_PICO_DISPLAY, rotate=0)
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

Wyświetl plik

@ -13,7 +13,7 @@ display = PicoGraphics(display=DISPLAY_PICO_DISPLAY, rotate=0)
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

Wyświetl plik

@ -13,7 +13,7 @@ display = PicoGraphics(display=DISPLAY_PICO_EXPLORER)
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

Wyświetl plik

@ -32,9 +32,9 @@ button_a = Button(7, invert=False)
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)

Wyświetl plik

@ -10,8 +10,8 @@ display = PicoGraphics(display=DISPLAY_TUFTY_2040)
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)