diff --git a/scripts/examples/02-Board-Control/read_adc.py b/scripts/examples/02-Board-Control/adc_read.py similarity index 72% rename from scripts/examples/02-Board-Control/read_adc.py rename to scripts/examples/02-Board-Control/adc_read.py index 2889248a0..1854226e0 100644 --- a/scripts/examples/02-Board-Control/read_adc.py +++ b/scripts/examples/02-Board-Control/adc_read.py @@ -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 diff --git a/scripts/examples/02-Board-Control/adc_read_int_channel.py b/scripts/examples/02-Board-Control/adc_read_int_channel.py new file mode 100644 index 000000000..43e0c60ba --- /dev/null +++ b/scripts/examples/02-Board-Control/adc_read_int_channel.py @@ -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()))