From 4e25d17f780d4677088e501a5eca9efe496ef22a Mon Sep 17 00:00:00 2001 From: "Mikael Falkvidd git@mjo.se" Date: Sat, 6 Aug 2016 12:05:34 +0200 Subject: [PATCH] Use bool instead of boolean in examples In the Arduino IDE, boolean is an alias for bool. The Arduino IDE might deprecate boolean in the future, see https://github.com/arduino/Arduino/issues/4673 for details. --- .../DallasTemperatureSensor.ino | 4 ++-- .../DhtTemperatureAndHumiditySensor.ino | 2 +- examples/DistanceSensor/DistanceSensor.ino | 2 +- .../IrrigationController/IrrigationController.ino | 14 +++++++------- .../MAX6875TemperatureSensor.ino | 2 +- examples/PressureSensor/PressureSensor.ino | 2 +- examples/RFIDLockSensor/RFIDLockSensor.ino | 4 ++-- examples/RainGauge/RainGauge.ino | 8 ++++---- .../RealTimeClockDisplaySensor.ino | 2 +- examples/SMSGatewayNode/SMSGatewayNode.ino | 4 ++-- examples/TimeAwareSensor/TimeAwareSensor.ino | 2 +- .../TouchDisplaySceneControllerSensor.ino | 2 +- .../WeatherStationSensor/WeatherStationSensor.ino | 2 +- 13 files changed, 25 insertions(+), 25 deletions(-) diff --git a/examples/DallasTemperatureSensor/DallasTemperatureSensor.ino b/examples/DallasTemperatureSensor/DallasTemperatureSensor.ino index c9fd64c..30f09cf 100644 --- a/examples/DallasTemperatureSensor/DallasTemperatureSensor.ino +++ b/examples/DallasTemperatureSensor/DallasTemperatureSensor.ino @@ -46,8 +46,8 @@ OneWire oneWire(ONE_WIRE_BUS); // Setup a oneWire instance to communicate with a DallasTemperature sensors(&oneWire); // Pass the oneWire reference to Dallas Temperature. float lastTemperature[MAX_ATTACHED_DS18B20]; int numSensors=0; -boolean receivedConfig = false; -boolean metric = true; +bool receivedConfig = false; +bool metric = true; // Initialize temperature message MyMessage msg(0,V_TEMP); diff --git a/examples/DhtTemperatureAndHumiditySensor/DhtTemperatureAndHumiditySensor.ino b/examples/DhtTemperatureAndHumiditySensor/DhtTemperatureAndHumiditySensor.ino index 32a1d80..edfc618 100644 --- a/examples/DhtTemperatureAndHumiditySensor/DhtTemperatureAndHumiditySensor.ino +++ b/examples/DhtTemperatureAndHumiditySensor/DhtTemperatureAndHumiditySensor.ino @@ -66,7 +66,7 @@ float lastTemp; float lastHum; uint8_t nNoUpdatesTemp; uint8_t nNoUpdatesHum; -boolean metric = true; +bool metric = true; MyMessage msgHum(CHILD_ID_HUM, V_HUM); MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP); diff --git a/examples/DistanceSensor/DistanceSensor.ino b/examples/DistanceSensor/DistanceSensor.ino index f076314..4f5de6a 100644 --- a/examples/DistanceSensor/DistanceSensor.ino +++ b/examples/DistanceSensor/DistanceSensor.ino @@ -46,7 +46,7 @@ unsigned long SLEEP_TIME = 5000; // Sleep time between reads (in milliseconds) NewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE); // NewPing setup of pins and maximum distance. MyMessage msg(CHILD_ID, V_DISTANCE); int lastDist; -boolean metric = true; +bool metric = true; void setup() { diff --git a/examples/IrrigationController/IrrigationController.ino b/examples/IrrigationController/IrrigationController.ino index 29e9251..8d9302a 100644 --- a/examples/IrrigationController/IrrigationController.ino +++ b/examples/IrrigationController/IrrigationController.ino @@ -145,10 +145,10 @@ int lastValve; unsigned long startMillis; const int ledPin = 5; const int waterButtonPin = 3; -boolean buttonPushed = false; -boolean showTime = true; -boolean clockUpdating = false; -boolean recentUpdate = true; +bool buttonPushed = false; +bool showTime = true; +bool clockUpdating = false; +bool recentUpdate = true; const char *dayOfWeek[] = { "Null", "Sunday ", "Monday ", "Tuesday ", "Wednesday ", "Thursday ", "Friday ", "Saturday " }; @@ -246,7 +246,7 @@ void setup() lcd.setCursor(0, 1); lcd.print(F(" Valve Data: ")); lcd.print(i); - boolean flashIcon = false; + bool flashIcon = false; DEBUG_PRINT(F("Calling for Valve ")); DEBUG_PRINT(i); DEBUG_PRINTLN(F(" Data...")); @@ -542,7 +542,7 @@ void slowToggleLED () // void receive(const MyMessage &message) { - boolean zoneTimeUpdate = false; + bool zoneTimeUpdate = false; if (message.isAck()) { DEBUG_PRINTLN(F("This is an ack from gateway")); @@ -656,7 +656,7 @@ void receive(const MyMessage &message) void updateDisplay() { static unsigned long lastUpdateTime; - static boolean displayToggle = false; + static bool displayToggle = false; //static byte toggleCounter = 0; static SprinklerStates lastDisplayState; if (state != lastDisplayState || millis() - lastUpdateTime >= 3000UL) diff --git a/examples/MAX6875TemperatureSensor/MAX6875TemperatureSensor.ino b/examples/MAX6875TemperatureSensor/MAX6875TemperatureSensor.ino index eb9e5b2..a2f91fb 100644 --- a/examples/MAX6875TemperatureSensor/MAX6875TemperatureSensor.ino +++ b/examples/MAX6875TemperatureSensor/MAX6875TemperatureSensor.ino @@ -53,7 +53,7 @@ uint8_t units = 1; // Units to readout temp (0 = ˚F, 1 = ˚C) float temperature = 0.0; // Temperature output variable float lastTemperature; unsigned long SLEEP_TIME = 30000; -boolean metric = true; +bool metric = true; MyMessage msg(0, V_TEMP); diff --git a/examples/PressureSensor/PressureSensor.ino b/examples/PressureSensor/PressureSensor.ino index 22c80a3..5d15114 100644 --- a/examples/PressureSensor/PressureSensor.ino +++ b/examples/PressureSensor/PressureSensor.ino @@ -79,7 +79,7 @@ float pressureAvg; float pressureAvg2; float dP_dt; -boolean metric; +bool metric; MyMessage tempMsg(TEMP_CHILD, V_TEMP); MyMessage pressureMsg(BARO_CHILD, V_PRESSURE); MyMessage forecastMsg(BARO_CHILD, V_FORECAST); diff --git a/examples/RFIDLockSensor/RFIDLockSensor.ino b/examples/RFIDLockSensor/RFIDLockSensor.ino index d705c5c..1344c80 100644 --- a/examples/RFIDLockSensor/RFIDLockSensor.ino +++ b/examples/RFIDLockSensor/RFIDLockSensor.ino @@ -107,7 +107,7 @@ void presentation() { } void loop() { - boolean success; + bool success; uint8_t key[] = { 0, 0, 0, 0, 0, 0, 0 }; // Buffer to store the returned UID uint8_t currentKeyLength; // Length of the UID (4 or 7 bytes depending on ISO14443A card type) @@ -132,7 +132,7 @@ void loop() { Serial.println(""); - boolean valid = false; + bool valid = false; // Compare this key to the valid once registered here in sketch for (int i=0;i #include -boolean timeReceived = false; +bool timeReceived = false; unsigned long lastUpdate=0, lastRequest=0; // Initialize display. Google the correct settings for your display. diff --git a/examples/SMSGatewayNode/SMSGatewayNode.ino b/examples/SMSGatewayNode/SMSGatewayNode.ino index c18e3d9..7f0b6e8 100644 --- a/examples/SMSGatewayNode/SMSGatewayNode.ino +++ b/examples/SMSGatewayNode/SMSGatewayNode.ino @@ -122,8 +122,8 @@ // variables -boolean KnowMyOwner = false; -boolean MsgReceived = false; +bool KnowMyOwner = false; +bool MsgReceived = false; uint16_t smslen = 0; int8_t smsnum = 0; int bufferindex = 0; diff --git a/examples/TimeAwareSensor/TimeAwareSensor.ino b/examples/TimeAwareSensor/TimeAwareSensor.ino index 92e7d24..c8df071 100644 --- a/examples/TimeAwareSensor/TimeAwareSensor.ino +++ b/examples/TimeAwareSensor/TimeAwareSensor.ino @@ -36,7 +36,7 @@ #include #include -boolean timeReceived = false; +bool timeReceived = false; unsigned long lastUpdate=0, lastRequest=0; void setup() diff --git a/examples/TouchDisplaySceneControllerSensor/TouchDisplaySceneControllerSensor.ino b/examples/TouchDisplaySceneControllerSensor/TouchDisplaySceneControllerSensor.ino index 1c1a9b0..8129410 100644 --- a/examples/TouchDisplaySceneControllerSensor/TouchDisplaySceneControllerSensor.ino +++ b/examples/TouchDisplaySceneControllerSensor/TouchDisplaySceneControllerSensor.ino @@ -100,7 +100,7 @@ MyMessage off(CHILD_ID, V_SCENE_OFF); UTFT myGLCD(ITDB32S,38,39,40,41); UTouch myTouch( 6, 5, 4, 3, 2); UTFT_Buttons myButtons(&myGLCD, &myTouch); -boolean timeReceived = false; +bool timeReceived = false; unsigned long lastTimeUpdate=0, lastRequest=0; char timeBuf[20]; diff --git a/examples/WeatherStationSensor/WeatherStationSensor.ino b/examples/WeatherStationSensor/WeatherStationSensor.ino index ed19ee9..0d0f3aa 100644 --- a/examples/WeatherStationSensor/WeatherStationSensor.ino +++ b/examples/WeatherStationSensor/WeatherStationSensor.ino @@ -75,7 +75,7 @@ const float SEALEVEL_PRESSURE = 1013.25; DHT dht; float lastTemp; float lastHum; -boolean metric = true; +bool metric = true; MyMessage msgHum(CHILD_ID_HUM, V_HUM); MyMessage msgTemp(CHILD_ID_TEMP2, V_TEMP);