openmv/usr/examples/02-Board-Control/dac_control.py
Kwabena W. Agyeman 2006cf9746 Example Work
* 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.
2016-04-20 17:10:44 -04:00

18 lines
389 B
Python

# DAC Control Example
#
# This example shows how to use the DAC pin output onboard your OpenMV Cam.
import time
from pyb import DAC
dac = DAC("P6") # Must always be "P6".
while(True):
# The DAC has 8-12 bits of resolution (default 8-bits).
for i in range(256):
dac.write(i)
time.sleep(20)
for i in range(256):
dac.write(255-i)
time.sleep(20)