Skip to content

Commit 45e422c

Browse files
authored
Update hid_camerashutter.ino
1 parent 9791ea6 commit 45e422c

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

libraries/Bluefruit52Lib/examples/Peripheral/hid_camerashutter/hid_camerashutter.ino

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
*********************************************************************/
1414

1515
/*
16-
* Sketch use HID Consumer Key API to send Volume Down key when
17-
* PIN_SHUTTER is grounded. Which cause mobile to capture photo
18-
* when you are in Camera App
16+
* This sketch uses the HID Consumer Key API to send the Volume Down
17+
* key when PIN_SHUTTER is grounded. This will cause your mobile device
18+
* to capture a photo when you are in Camera App
1919
*/
2020
#include <bluefruit.h>
2121

@@ -35,10 +35,10 @@ void setup()
3535

3636
Serial.println();
3737
Serial.println("Go to your phone's Bluetooth settings to pair your device");
38-
Serial.println("then open an Camera application");
38+
Serial.println("then open the camera application");
3939

4040
Serial.println();
41-
Serial.printf("Wire your Pin %d to GND to capture picture\n", PIN_SHUTTER);
41+
Serial.printf("Set pin %d to GND to capture a photo\n", PIN_SHUTTER);
4242
Serial.println();
4343

4444
Bluefruit.begin();
@@ -50,11 +50,12 @@ void setup()
5050
bledis.begin();
5151

5252
/* Start BLE HID
53-
* Note: Apple requires BLE device must have min connection interval >= 20m
54-
* ( The smaller the connection interval the faster we could send data).
55-
* However for HID and MIDI device, Apple could accept min connection interval
56-
* up to 11.25 ms. Therefore BLEHidAdafruit::begin() will try to set the min and max
57-
* connection interval to 11.25 ms and 15 ms respectively for best performance.
53+
* Note: Apple requires BLE devices to have a min connection interval >= 20m
54+
* (The smaller the connection interval the faster we can send data).
55+
* However for HID and MIDI device, Apple will accept a min connection interval
56+
* as low as 11.25 ms. Therefore BLEHidAdafruit::begin() will try to set
57+
* the min and max connection interval to 11.25 ms and 15 ms respectively
58+
* for the best performance.
5859
*/
5960
blehid.begin();
6061

@@ -87,31 +88,30 @@ void setupAdv(void)
8788

8889
void loop()
8990
{
90-
// Connected and Bonded/Paired
91+
// Make sure you are connected and bonded/paired
9192
if ( Bluefruit.connected() && Bluefruit.connPaired() )
9293
{
93-
// Pin is wired to GND
94+
// Check if pin GND'ed
9495
if ( digitalRead(PIN_SHUTTER) == 0 )
9596
{
96-
// Turn on LED Red when start sending
97+
// Turn on red LED when we start sending data
9798
digitalWrite(LED_RED, 1);
9899

99-
// Send Volumn Down key press
100-
// Check BLEHidGerneric.h for list of defined consumer usage code
100+
// Send the 'volume down' key press
101+
// Check BLEHidGerneric.h for list of defined consumer usage codes
101102
blehid.consumerKeyPress(HID_USAGE_CONSUMER_VOLUME_DECREMENT);
102103

103-
// Delay a bit between repots
104+
// Delay a bit between reports
104105
delay(10);
105106

106107
// Send key release
107108
blehid.consumerKeyRelease();
108109

109-
// Turn off LED Red
110+
// Turn off the red LED
110111
digitalWrite(LED_RED, 0);
111112

112113
// Delay to avoid constant capturing
113114
delay(500);
114115
}
115116
}
116117
}
117-

0 commit comments

Comments
 (0)