Hardware Reference
In-Depth Information
uploadFileInputs
.
set_AccessTokenSecret(
"accessTokenSecret"
)
uploadFileInputs
.
set_AppKey(
"appKey"
)
uploadFileInputs
.
set_FileContents(encoded_string)
uploadFileInputs
.
set_Root(
"sandbox"
)
And finally, upload the file on Dropbox:
uploadFileResults
=
uploadFileChoreo
.
execute_with_results(uploadFileInputs)
You can now save this code in a file named upload_picture.py. Note that all the files are
available inside the GitHub repository of the topic:
We will now work on the Arduino sketch. This is the complete code for this part:
// 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
loop
(
void
)
{