mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
* Filled in all the board control examples. Everything works except for DAC. * Moved test drawing scripts to drawing dir and renamed them and added comments. * Filled in all the image filter stuff. There are still some tests that can be renamed, commented, and added to this folder. But, I will do that later. * Fixed motion detection thresholds. * Fixed LCD script comments. * Fixed BLE return value.
14 lines
299 B
Python
14 lines
299 B
Python
# Read ADC Example
|
|
#
|
|
# This example shows how to read the ADC on your OpenMV Cam.
|
|
|
|
import time
|
|
from pyb import ADC
|
|
|
|
adc = ADC("P6") # Must always be "P6".
|
|
|
|
while(True):
|
|
# The ADC has 12-bits of resolution for 4096 values.
|
|
print("ADC = %fv" % ((adc.read() * 3.3) / 4095))
|
|
time.sleep(100)
|