openmv/usr/examples/01-Basics/main.py
Kwabena W. Agyeman 0abd5d3688 Working on scripts...
Moved feature detection scripts into their own folders and added explict
frame_skip value per Ibrahim's request.

Finished working on snapshot and video recording scripts for next
release.

... From CMUcam4 work I learned that people will just want examples that
do "X" thing. So, in general, our examples should include a simple
script showing off a feature and then a more complex script that does "X"
where "X" is some app that a person would want. For example, we'll get
reuqests for face tracking with servos, and movement detection with
servos. So, instead of answering this question a million times with an
example script we'll just have examples for all kinds of things people
will want.

Gotta automate dealing with help support at the end of the day...
2016-04-02 11:18:20 -04:00

34 lines
834 B
Python

# Main Module Example
#
# When your OpenMV Cam is disconnected from your computer it will either run the
# main.py script on the SD card (if attached) or the main.py script on
# your OpenMV Cam's internal flash drive.
import time, pyb
led = pyb.LED(3) # Red LED = 1, Green LED = 2, Blue LED = 3, IR LEDs = 4.
usb = pyb.USB_VCP() # This is a serial port object that allows you to
# communciate with your computer. While it is not open the code below runs.
while(not usb.isconnected()):
led.on()
time.sleep(150)
led.off()
time.sleep(100)
led.on()
time.sleep(150)
led.off()
time.sleep(600)
led = pyb.LED(2) # Switch to using the green LED.
while(usb.isconnected()):
led.on()
time.sleep(150)
led.off()
time.sleep(100)
led.on()
time.sleep(150)
led.off()
time.sleep(600)