Update ADC examples.

This commit is contained in:
iabdalkader 2019-10-11 20:40:28 +02:00
parent 8dac6467a5
commit cdb4712f03
2 changed files with 10 additions and 2 deletions

View File

@ -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

View File

@ -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()))