openmv/usr/examples/02-Board-Control/pin_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

14 lines
358 B
Python

# Pin Control Example
#
# This example shows how to use the I/O pins in GPIO mode on your OpenMV Cam.
from pyb import Pin
# Connect a switch to pin 0 that will pull it low when the switch is closed.
# Pin 1 will then light up.
pin0 = Pin('P0', Pin.IN, Pin.PULL_UP)
pin1 = Pin('P1', Pin.OUT_PP, Pin.PULL_NONE)
while(True):
pin1.value(not pin0.value())