From 8b11b5875368002a92cd200712d8f558560138d6 Mon Sep 17 00:00:00 2001 From: per1234 Date: Wed, 30 May 2018 04:30:13 -0700 Subject: [PATCH] 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. --- .../examples/04.Communication/SerialEvent/SerialEvent.ino | 2 +- .../Mouse/JoystickMouseControl/JoystickMouseControl.ino | 2 +- .../10.StarterKit_BasicKit/p12_KnockLock/p12_KnockLock.ino | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build/shared/examples/04.Communication/SerialEvent/SerialEvent.ino b/build/shared/examples/04.Communication/SerialEvent/SerialEvent.ino index 43f9eaf4e55..1ec4049e376 100644 --- a/build/shared/examples/04.Communication/SerialEvent/SerialEvent.ino +++ b/build/shared/examples/04.Communication/SerialEvent/SerialEvent.ino @@ -19,7 +19,7 @@ */ String inputString = ""; // a String to hold incoming data -boolean stringComplete = false; // whether the string is complete +bool stringComplete = false; // whether the string is complete void setup() { // initialize serial: diff --git a/build/shared/examples/09.USB/Mouse/JoystickMouseControl/JoystickMouseControl.ino b/build/shared/examples/09.USB/Mouse/JoystickMouseControl/JoystickMouseControl.ino index 1405322eea7..aa608f870b1 100644 --- a/build/shared/examples/09.USB/Mouse/JoystickMouseControl/JoystickMouseControl.ino +++ b/build/shared/examples/09.USB/Mouse/JoystickMouseControl/JoystickMouseControl.ino @@ -44,7 +44,7 @@ int responseDelay = 5; // response delay of the mouse, in ms int threshold = range / 4; // resting threshold int center = range / 2; // resting position value -boolean mouseIsActive = false; // whether or not to control the mouse +bool mouseIsActive = false; // whether or not to control the mouse int lastSwitchState = LOW; // previous switch state void setup() { diff --git a/build/shared/examples/10.StarterKit_BasicKit/p12_KnockLock/p12_KnockLock.ino b/build/shared/examples/10.StarterKit_BasicKit/p12_KnockLock/p12_KnockLock.ino index 9486725a286..95027ec25d6 100644 --- a/build/shared/examples/10.StarterKit_BasicKit/p12_KnockLock/p12_KnockLock.ino +++ b/build/shared/examples/10.StarterKit_BasicKit/p12_KnockLock/p12_KnockLock.ino @@ -46,7 +46,7 @@ const int quietKnock = 10; const int loudKnock = 100; // variable to indicate if locked or not -boolean locked = false; +bool locked = false; // how many valid knocks you've received int numberOfKnocks = 0; @@ -146,7 +146,7 @@ void loop() { } // this function checks to see if a detected knock is within max and min range -boolean checkForKnock(int value) { +bool checkForKnock(int value) { // if the value of the knock is greater than the minimum, and larger // than the maximum if (value > quietKnock && value < loudKnock) {