Skip to content

Commit a6ea68f

Browse files
committed
Use red LED to indicate errors
1 parent 5aa18d7 commit a6ea68f

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

libraries/Camera/examples/CameraCaptureWebSerial/CameraCaptureWebSerial.ino

+9-6
Original file line numberDiff line numberDiff line change
@@ -62,27 +62,30 @@ FrameBuffer fb;
6262

6363
/**
6464
* Blinks the LED a specified number of times.
65-
*
65+
* @param ledPin The pin number of the LED.
6666
* @param count The number of times to blink the LED. Default is 0xFFFFFFFF.
6767
*/
68-
void blinkLED(uint32_t count = 0xFFFFFFFF) {
68+
void blinkLED(int ledPin, uint32_t count = 0xFFFFFFFF) {
6969
while (count--) {
70-
digitalWrite(LED_BUILTIN, LOW); // turn the LED on (HIGH is the voltage level)
70+
digitalWrite(ledPin, LOW); // turn the LED on (HIGH is the voltage level)
7171
delay(50); // wait for a second
72-
digitalWrite(LED_BUILTIN, HIGH); // turn the LED off by making the voltage LOW
72+
digitalWrite(ledPin, HIGH); // turn the LED off by making the voltage LOW
7373
delay(50); // wait for a second
7474
}
7575
}
7676

7777
void setup() {
7878
pinMode(LED_BUILTIN, OUTPUT);
79+
pinMode(LEDR, OUTPUT);
80+
digitalWrite(LED_BUILTIN, HIGH);
81+
digitalWrite(LEDR, HIGH);
7982

8083
// Init the cam QVGA, 30FPS
8184
if (!cam.begin(RESOLUTION, IMAGE_MODE, 30)) {
82-
blinkLED();
85+
blinkLED(LEDR);
8386
}
8487

85-
blinkLED(5);
88+
blinkLED(LED_BUILTIN, 5);
8689
}
8790

8891
/**

0 commit comments

Comments
 (0)