mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Tried to emulate Arduino's 11 folders... I'd perfer to have all the shield scripts in one folder... but, that might not make sense. I don't really want one script per folder however. So, I might merge some more stuff in the future. I have a grand idea here that will become evident as I work though the examples. Anyway, the current structure is not final. It will be in flux for a little while. As for Git History, folder history is the best we're going to get. Git and GitHub don't seem to deal with moves too well.
22 lines
614 B
Python
22 lines
614 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)
|