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.
18 lines
691 B
Python
18 lines
691 B
Python
# Hello World Example
|
|
#
|
|
# Welcome to the OpenMV IDE! Click on the gear button above to run the script!
|
|
|
|
import sensor, image, time
|
|
|
|
sensor.reset() # Initialize the camera sensor.
|
|
sensor.set_pixformat(sensor.RGB565) # or sensor.GRAYSCALE
|
|
sensor.set_framesize(sensor.QVGA) # or sensor.QQVGA (or others)
|
|
sensor.skip_frames() # Let new settings take affect.
|
|
clock = time.clock() # Tracks FPS.
|
|
|
|
while(True):
|
|
clock.tick() # Track elapsed milliseconds between snapshots().
|
|
img = sensor.snapshot() # Take a picture and return the image.
|
|
print(clock.fps()) # Note: Your OpenMV Cam runs about half as fast while
|
|
# connected to your computer. The FPS should increase once disconnected.
|