Skip to content

Commit a6a9cb9

Browse files
committed
camera-to-bitmap updated
1 parent 725c8bb commit a6a9cb9

File tree

1 file changed

+27
-5
lines changed
  • content/hardware/04.pro/shields/portenta-vision-shield/tutorials/camera-to-bitmap-sd-card

1 file changed

+27
-5
lines changed

content/hardware/04.pro/shields/portenta-vision-shield/tutorials/camera-to-bitmap-sd-card/content.md

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,16 @@ You will be using the **Himax HM-01B0 camera module** which has a resolution of
4949
Inside the sketch, you can use these libraries to access the camera APIs, also compatible with the [Arduino Nicla Vision](https://docs.arduino.cc/hardware/nicla-vision)
5050
```cpp
5151
#include "camera.h" // Multi Media Card APIs
52-
#include "himax.h" // API to read from the Himax camera found on the Portenta Vision Shield
52+
53+
//For the Vision Shield Rev.1
54+
#include "himax.h" // API to read from the Himax camera found on the Portenta Vision Shield Rev.1
55+
56+
//For the Vision Shield Rev.2
57+
#include "hm0360.h" // API to read from the Himax camera found on the Portenta Vision Shield Rev.2
5358
```
5459

60+
***Left uncommented the library of your Vision Shield version.***
61+
5562
#### Bitmap File Format
5663

5764
The bitmap binary file needs to contain some information in order to tell the computer for example the resolution of the picture and the bit-depth (bpp). Bit depth refers to the color information stored in the image. The higher the bit depth of an image, the more colors it can store. As the bit depth increases, the file size of the image also increases, because more color information has to be stored for each pixel in the image.
@@ -80,7 +87,10 @@ First you need to include the needed libraries
8087
#include "FATFileSystem.h" // Mbed API for portable and embedded systems
8188

8289
#include "camera.h" // Arduino Mbed Core Camera APIs
83-
#include "himax.h" // API to read from the Himax camera found on the Portenta Vision Shield
90+
91+
#include "himax.h" // API to read from the Himax camera found on the Portenta Vision Shield Rev.1
92+
// OR
93+
#include "hm0360.h" // API to read from the Himax camera found on the Portenta Vision Shield Rev.2
8494
```
8595

8696
Then define the following objects with their respective constructor (`blockDevice` and `fileSystem` objects), needed for getting access to the SD Card and the file system.
@@ -92,8 +102,13 @@ SDMMCBlockDevice blockDevice;
92102
mbed::FATFileSystem fileSystem("fs");
93103

94104
#include "camera.h" // Arduino Mbed Core Camera APIs
95-
#include "himax.h" // API to read from the Himax camera found on the Portenta Vision Shield
105+
106+
#include "himax.h" // API to read from the Himax camera found on the Portenta Vision Shield Rev.1
96107
HM01B0 himax;
108+
// OR
109+
#include "hm0360.h" // API to read from the Himax camera found on the Portenta Vision Shield Rev.2
110+
HM0360 himax;
111+
97112
Camera cam(himax);
98113

99114
FrameBuffer frameBuffer; // Buffer to save the camera stream
@@ -288,8 +303,15 @@ SDMMCBlockDevice blockDevice;
288303
mbed::FATFileSystem fileSystem("fs");
289304

290305
#include "camera.h" // Arduino Mbed Core Camera APIs
291-
#include "himax.h" // API to read from the Himax camera found on the Portenta Vision Shield
292-
HM01B0 himax;
306+
307+
/*-----Uncomment the library and class for your specific hardware-----*/
308+
309+
//#include "himax.h" // API to read from the Himax camera found on the Portenta Vision Shield Rev.1
310+
//HM01B0 himax;
311+
312+
#include "hm0360.h" // API to read from the Himax camera found on the Portenta Vision Shield Rev.2
313+
HM0360 himax;
314+
293315
Camera cam(himax);
294316

295317
FrameBuffer frameBuffer; // Buffer to save the camera stream

0 commit comments

Comments
 (0)