mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Update ADC examples.
This commit is contained in:
parent
8dac6467a5
commit
cdb4712f03
@ -1,6 +1,6 @@
|
||||
# Read ADC Example
|
||||
# ADC Read Example.
|
||||
#
|
||||
# This example shows how to read the ADC on your OpenMV Cam.
|
||||
# This example shows how to use the ADC to read an analog pin.
|
||||
|
||||
import time
|
||||
from pyb import ADC
|
||||
@ -0,0 +1,8 @@
|
||||
# ADC Internal Channels Example
|
||||
#
|
||||
# This example shows how to read internal ADC channels.
|
||||
|
||||
import time, pyb
|
||||
|
||||
adc = pyb.ADCAll(12)
|
||||
print("VREF = %.1fv VREF = %.1fv Temp = %d" % (adc.read_core_vref(), adc.read_core_vbat(), adc.read_core_temp()))
|
||||
Loading…
Reference in New Issue
Block a user