Saving pictures to Dropbox
Finally, we are going to make our first application using the hardware that we built. There will be two parts here: an Arduino sketch and a Python script. The Arduino sketch will be in charge of taking a picture in case motion is detected and call the Python script. The Python script will actually upload the pictures to Temboo every time it is called by the Arduino sketch.
This is the complete Arduino sketch:
// Sketch to upload pictures to Dropbox when motion is detected #include <Bridge.h> #include <Process.h> // Picture process Process picture; // Filename String filename; // Pin int pir_pin = 8; // Path String path = "/mnt/sda1/"; void setup() { // Bridge Bridge.begin(); // Set pin mode pinMode(pir_pin,INPUT); } void ...
Get Arduino: Building exciting LED based projects and espionage devices now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.