_adc.py 670 B

1234567891011121314151617181920212223242526272829
  1. def adc_read_pin_value(pin: int) -> int:
  2. '''
  3. Read the raw value from the ADC channel.
  4. :param pin: The pin to read (e.g. :const:`GPIO_PIN_PC1`).
  5. :returns: The raw value between 0 and 4095.
  6. .. versionadded:: 1.3.0
  7. .. hint::
  8. Don't forget to initialize the pin first.
  9. '''
  10. pass
  11. def adc_read_pin_voltage(pin: int) -> float:
  12. '''
  13. Read the voltage from the ADC channel.
  14. :param pin: The pin to read (e.g. :const:`GPIO_PIN_PC1`).
  15. :returns: The voltage between 0 - 2.048 V with a precision of ~0.1%.
  16. .. versionadded:: 1.3.0
  17. .. hint::
  18. Don't forget to initialize the pin first.
  19. '''
  20. pass