If this is your first time using the Grand Central board, please begin with our Introducing the Adafruit Grand Central M4 Express guide. This will walk you through setting up the Arduino IDE for use with this board.
Do not continue until you have at least the basic “blink” sketch working on Grand Central.
Our OV7670 library can be installed from the Arduino Library Manager:
Sketch→Include Library→Manage Libraries…
Enter “OV7670” in the search field. You’ll see more than one library returned…others are working on the idea too…but specifically install the Adafruit_OV7670 library because this one works with the SAMD51 Parallel Capture Controller.
Select Grand Central as the board type from the Tools menu:
Tools→Board→Adafruit Grand Central M4
Our example sketches can then be accessed from the File menu:
There are two examples to begin with:
- cameratest works with the 2.8" TFT Touch Shield (resistive or capacitive doesn’t matter — the example doesn’t use touch, just the display). This displays live video from the camera at 320x240 pixel resolution.
- selfie works with the 1.8" TFT Shield (V2). A live camera feed is displayed at 160x120 pixel resolution. With a FAT-formatted microSD card in Grand Central’s card slot (not the slot on the shield!), tap the “A” button to capture a still image at 320x240 pixels in BMP format.
Important notes about the “selfie” example
- Use the microSD card slot on Grand Central. Do not use the card slot on the TFT shield.
- Each time you run it and take stills, the code will sequentially overwrite any existing BMP images in the “selfies” folder on the card! Rude. This is a quick demo and not a Real Photography Tool™.
- The BMPs it writes are a lesser-seen variant that not everything can read. Photoshop, Preview on Mac and ImageMagick should all handle it.
Can this work with other boards besides Grand Central?
The examples, for now, are written for Grand Central, but perhaps others will come later.
In theory, any “M4” board should work with the library, provided the hardware exposes all of the PCC pins plus a Timer/Counter pin. But few if any boards besides Grand Central will have enough extra pins left to also connect much else.