Skip to content

Commit 0032518

Browse files
committed
Hello World
1 parent 37cc238 commit 0032518

File tree

6 files changed

+68
-0
lines changed

6 files changed

+68
-0
lines changed
290 KB
Loading
-23.8 KB
Loading
-47.1 KB
Loading
3.86 MB
Loading
750 KB
Loading

content/hardware/04.pro/shields/portenta-vision-shield/tutorials/user-manual/content.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,3 +126,71 @@ If you overwrite the __main.py__ script on your Portenta H7, then it will run wh
126126
**Blinking White:** Your Portenta H7 firmware is panicking because of a hardware failure. Please check that your Vision Shield's camera module is installed securely.
127127

128128
***If you tap the Portenta H7 reset button once, the board resets. If you tap it twice, the board enters Device Firmware Upgrade (DFU) mode and its green LED starts blinking and fading.***
129+
130+
### Pinout
131+
132+
![Vision Shield simple pinout](assets/ethernet-pinout.png)
133+
134+
The full pinout is available and downloadable as PDF from the link below:
135+
136+
- [Vision Shield full pinout](https://docs.arduino.cc/resources/pinouts/ABX00051-full-pinout.pdf)
137+
138+
### Datasheet
139+
140+
The complete datasheet is available and downloadable as PDF from the link below:
141+
142+
- [Vision Shield datasheet](https://docs.arduino.cc/resources/datasheets/ASX00021-ASX00026-datasheet.pdf)
143+
144+
### Schematics
145+
146+
The complete schematics are available and downloadable as PDF from the links below:
147+
148+
- [Vision Shield - Ethernet schematics](https://docs.arduino.cc/resources/schematics/ASX00021-schematics.pdf)
149+
- [Vision Shield - LoRa® schematics](https://docs.arduino.cc/resources/schematics/ASX00026-schematics.pdf)
150+
151+
### STEP Files
152+
153+
The complete STEP files are available and downloadable from the link below:
154+
155+
- [Vision Shield STEP files](https://docs.arduino.cc/static/c1c3c72a51d20228fe415ac8717615f6/visionShields-step.zip)
156+
157+
## First Use
158+
159+
### Hello World Example
160+
161+
Working with camera modules, the `Hello World` classic example is not an LED blink but the simplest sketch to capture images. We will use this example to verify the board's connection to the IDEs and that the Vision Shield itself is working as expected.
162+
163+
The following example script can be found on **File > Examples > HelloWorld > helloworld.py** in the OpenMV IDE.
164+
165+
```python
166+
import sensor
167+
import time
168+
169+
sensor.reset() # Reset and initialize the sensor.
170+
sensor.set_pixformat(sensor.GRAYSCALE) # Set pixel format to RGB565 (or GRAYSCALE)
171+
sensor.set_framesize(sensor.QVGA) # Set frame size to QVGA (320x240)
172+
sensor.skip_frames(time=2000) # Wait for settings take effect.
173+
clock = time.clock() # Create a clock object to track the FPS.
174+
175+
while True:
176+
clock.tick() # Update the FPS clock.
177+
img = sensor.snapshot() # Take a picture and return the image.
178+
print(clock.fps()) # Note: OpenMV Cam runs about half as fast when connected
179+
# to the IDE. The FPS should increase once disconnected.
180+
```
181+
182+
![Camera streaming demo](assets/helloworld.gif)
183+
184+
From the above example script, we can highlight the main functions:
185+
186+
- `sensor.set_pixformat(<Sensor>)` lets you set the pixel format for the camera sensor. The Vision Shield is compatible with these: `sensor.GRAYSCALE`, and `sensor.BAYER`.
187+
188+
To define the pixel format to any of the supported ones, just add it to the `set_pixformat` function argument.
189+
190+
- `sensor.set_framesize(<Resolution>)` lets you define the image frame size in terms of pixels. [Here](https://docs.openmv.io/library/omv.sensor.html#sensor.set_framesize) you can find all the different options.
191+
192+
To leverage full sensor resolution with the Vision Shield camera module `HM01B0`, use `sensor.B320X320`.
193+
194+
![Different resolutions examples](assets/resolutions.png)
195+
196+
- `sensor.snapshot()` lets you take a picture and return the image so you can save it, stream it or process it.

0 commit comments

Comments
 (0)