Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 1dea705

Browse filesBrowse files
committed
Replace boolean type with bool in examples
This is part of a move to encourage use of the standard bool type over Arduino's non-standard boolean type alias.
1 parent c3fef83 commit 1dea705
Copy full SHA for 1dea705

File tree

Expand file treeCollapse file tree

3 files changed

+4
-4
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+4
-4
lines changed

‎examples/04.Communication/SerialEvent/SerialEvent.ino

Copy file name to clipboardExpand all lines: examples/04.Communication/SerialEvent/SerialEvent.ino
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*/
2020

2121
String inputString = ""; // a String to hold incoming data
22-
boolean stringComplete = false; // whether the string is complete
22+
bool stringComplete = false; // whether the string is complete
2323

2424
void setup() {
2525
// initialize serial:

‎examples/09.USB/Mouse/JoystickMouseControl/JoystickMouseControl.ino

Copy file name to clipboardExpand all lines: examples/09.USB/Mouse/JoystickMouseControl/JoystickMouseControl.ino
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ int responseDelay = 5; // response delay of the mouse, in ms
4444
int threshold = range / 4; // resting threshold
4545
int center = range / 2; // resting position value
4646

47-
boolean mouseIsActive = false; // whether or not to control the mouse
47+
bool mouseIsActive = false; // whether or not to control the mouse
4848
int lastSwitchState = LOW; // previous switch state
4949

5050
void setup() {

‎examples/10.StarterKit_BasicKit/p12_KnockLock/p12_KnockLock.ino

Copy file name to clipboardExpand all lines: examples/10.StarterKit_BasicKit/p12_KnockLock/p12_KnockLock.ino
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const int quietKnock = 10;
4646
const int loudKnock = 100;
4747

4848
// variable to indicate if locked or not
49-
boolean locked = false;
49+
bool locked = false;
5050
// how many valid knocks you've received
5151
int numberOfKnocks = 0;
5252

@@ -146,7 +146,7 @@ void loop() {
146146
}
147147

148148
// this function checks to see if a detected knock is within max and min range
149-
boolean checkForKnock(int value) {
149+
bool checkForKnock(int value) {
150150
// if the value of the knock is greater than the minimum, and larger
151151
// than the maximum
152152
if (value > quietKnock && value < loudKnock) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.