Introduction: Grove Serial Camera With Linkit ONE
This is my first Instructable and it is designed for those who are in need to connect the Grove Serial Camera to a Mediatek Labs Linkit ONE. Although the official SeeedStudio wiki says it's not compatible, it does work properly. I didn't had the time to play with it longer, but I'll show here what I have achieved in my first experiment with it.
Step 1: What You'll Need
To test the code, you'll need the following parts:
1x Grove Serial Camera
1x Grove cable (usually comes with the camera)
1x MediaTek Labs Linkit ONE
1x Pushbutton or dupont wire
Step 2: Setup
Connect the grove cable to the camera and to the grove connector on the board. Note that there are two connectors on the board, one is for serial communication (labeled with RX and TX) and the other one is for i2C (labeled SDA and SCL). You must use the serial one, as this is a serial device. The pins on this connector are the same as D0 and D1, which is the second serial port available on the Linkit ONE, but using the connector makes it more pretty. If you have a pushbutton, connect one pin to D4 and the other one to GND, or you can use a simple dupont wire to make this connection.
Step 3: Code
Unpack the file, open SerialCam.ino in your preferred Arduino editor (Arduino IDE or Visual Studio/Visual Micro) and flash it to the board. This code is based on the Arduino example available here, with a few modifications to make it work on Linkit ONE. Here they are:
1) The original code uses the SoftwareSerial implementation, which is not available on the Linkit ONE, but this board does have a second serial (called Serial1), that is what we are using instead.
2) Linkit ONE access to storage (SD or internal) is made with its own specific libraries;
3) Storage CS pin (to SD or internal) is 10, instead of 4.
Here we will be using the internal storage, but you can use a SD card by commenting this line:
#define SD LFlash // use Internal 10M Flash
And uncommenting this one:
//#define SD LSD // use SD card
Note that you'll need a Class10 SD Card to use with Linkit ONE (I tried several non-Class10 and it doesn't recognize them).
Step 4: Test and Results
After flashing the code, open the Serial Monitor and press the pushbutton (or ground PIN4) to take a picture. Note that it can take several seconds to take the picture (you'll see the red light on your camera), I haven't had the time to improve the transfer speed (if anyone can figure it out, leave in the comments, please!). After taking the shot, turn off Linkit ONE and change the switch from UART to MS (mass storage) and plug it again. You'll be seeing the internal storage just like a USB thumbdrive and in there should be your taken shots. Have fun!
Please, leave a comment if you have any issues or suggestions!