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.
This commit is contained in:
@@ -52,7 +52,7 @@
|
||||
|
||||
unsigned long SEND_FREQUENCY = 20000; // Minimum time between send (in milliseconds). We don't wnat to spam the gateway.
|
||||
double ppwh = ((double)PULSE_FACTOR)/1000; // Pulses per watt hour
|
||||
boolean pcReceived = false;
|
||||
bool pcReceived = false;
|
||||
volatile unsigned long pulseCount = 0;
|
||||
volatile unsigned long lastBlink = 0;
|
||||
volatile unsigned long watt = 0;
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
|
||||
// Global Vars
|
||||
unsigned long SLEEP_TIME = 900000; // Sleep time between reads (in milliseconds)
|
||||
boolean metric = true;
|
||||
bool metric = true;
|
||||
long randNumber;
|
||||
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ void presentation() {
|
||||
void loop()
|
||||
{
|
||||
// Read digital motion value
|
||||
boolean tripped = digitalRead(DIGITAL_INPUT_SENSOR) == HIGH;
|
||||
bool tripped = digitalRead(DIGITAL_INPUT_SENSOR) == HIGH;
|
||||
|
||||
Serial.println(tripped);
|
||||
send(msg.set(tripped?"1":"0")); // Send tripped value to gw
|
||||
|
||||
@@ -79,7 +79,7 @@ void presentation() {
|
||||
void loop()
|
||||
{
|
||||
// Read digital motion value
|
||||
boolean tripped = digitalRead(DIGITAL_INPUT_SENSOR) == HIGH;
|
||||
bool tripped = digitalRead(DIGITAL_INPUT_SENSOR) == HIGH;
|
||||
|
||||
Serial.println(tripped);
|
||||
send(msg.set(tripped?"1":"0")); // Send tripped value to gw
|
||||
|
||||
@@ -36,8 +36,8 @@
|
||||
|
||||
unsigned long SLEEP_TIME = 60000; // Sleep time between reads (in milliseconds)
|
||||
float lastPH;
|
||||
boolean receivedConfig = false;
|
||||
boolean metric = true;
|
||||
bool receivedConfig = false;
|
||||
bool metric = true;
|
||||
// Initialize PH message
|
||||
MyMessage msg(0, V_PH);
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ const int knockComplete = 1200; // Longest time to wait for a knock before we
|
||||
byte secretCode[maximumKnocks] = {50, 25, 25, 50, 100, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; // Initial setup: "Shave and a Hair Cut, two bits."
|
||||
int knockReadings[maximumKnocks]; // When someone knocks this array fills with the delays between knocks.
|
||||
int knockSensorValue = 0; // Last reading of the knock sensor.
|
||||
boolean programModeActive = false; // True if we're trying to program a new knock.
|
||||
bool programModeActive = false; // True if we're trying to program a new knock.
|
||||
|
||||
bool lockStatus;
|
||||
|
||||
@@ -242,7 +242,7 @@ void setLockState(bool state, bool doSend){
|
||||
|
||||
// Checks to see if our knock matches the secret.
|
||||
// Returns true if it's a good knock, false if it's not.
|
||||
boolean validateKnock(){
|
||||
bool validateKnock(){
|
||||
int i = 0;
|
||||
|
||||
int currentKnockCount = 0;
|
||||
|
||||
@@ -65,7 +65,7 @@ double ppl = ((double)PULSE_FACTOR)/1000; // Pulses per liter
|
||||
volatile unsigned long pulseCount = 0;
|
||||
volatile unsigned long lastBlink = 0;
|
||||
volatile double flow = 0;
|
||||
boolean pcReceived = false;
|
||||
bool pcReceived = false;
|
||||
unsigned long oldPulseCount = 0;
|
||||
unsigned long newBlink = 0;
|
||||
double oldflow = 0;
|
||||
|
||||
Reference in New Issue
Block a user