The code the students used they got from a sample project given on adafruit below the product (shown below):
Code: Select all
int trig = 2;
int led = 13;
void setup() {
// initialize the digital pins as output.
pinMode(led, OUTPUT);
pinMode(trig, OUTPUT);
digitalWrite(led, HIGH);
digitalWrite(trig, HIGH);
}
// Hold HIGH and trigger quick (<250ms) LOW to take a photo. Holding LOW and trigger HIGH starts/stops video recording
void loop() {
digitalWrite(trig, LOW);
digitalWrite(led, LOW);
delay(50);
digitalWrite(trig, HIGH);
digitalWrite(led, HIGH);
//Delay between pictures
delay(10000);
}