Controlling a snapshot from Raspberry Pi
Now that we have seen how to communicate between Arduino and Raspberry Pi, to control the board, we can apply this to our security system project. We need to do this for communicating with and controlling our camera from the Raspberry Pi:
Connect the Arduino and Raspberry Pi to each other
Create a serial connection at 9,600 mbps
Call the function that will take the picture and save it in the micro SD
On the Raspberry Pi we need to do the following:
Create the script for calling the function in the Arduino that will take the picture
Open and execute the script using your PuTTY terminal
The following section is the sketch that should be download in the Arduino board:
First we start the serial communication:
void setup () { Serial.begin(9600); }
This is the function that will tell the camera to take the picture:
void loop () { if (Serial.available() > 0) { char c = Serial.read(); if (c == 'T') { ...