Skip to content

Commit 6e0ddec

Browse files
committed
Add blink function
1 parent a850ad0 commit 6e0ddec

File tree

1 file changed

+12
-0
lines changed
  • content/hardware/04.pro/shields/portenta-vision-shield/tutorials/camera-to-bitmap-sd-card

1 file changed

+12
-0
lines changed

content/hardware/04.pro/shields/portenta-vision-shield/tutorials/camera-to-bitmap-sd-card/content.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,17 @@ void saveImage(unsigned char *imageData, const char* imagePath){
224224
}
225225
```
226226
227+
Then to have visual feedback lets add a blink function to make 3 blinks after the photo is taken, once the blue LED is ON it means the picture was taken.
228+
```cpp
229+
void countDownBlink(){
230+
for (int i = 0; i < 6; i++){
231+
digitalWrite(LEDG, i % 2);
232+
delay(500);
233+
}
234+
digitalWrite(LEDG, HIGH);
235+
digitalWrite(LEDB, LOW);
236+
}
237+
```
227238
Now that you have all the functions to be used, inside the `setup()` its call them only once after the board restarts.
228239
```cpp
229240
void setup(){
@@ -239,6 +250,7 @@ void setup(){
239250
Serial.println("Unable to find the camera");
240251
}
241252

253+
countDownBlink();
242254
Serial.println("Fetching camera image...");
243255
unsigned char *imageData = captureImage();
244256

0 commit comments

Comments
 (0)