Skip to content

Commit 374e177

Browse files
sandeepmistrycmaglie
authored andcommitted
Example sketches: Avoid double negatives and correct &'s to &&
1 parent f0ce153 commit 374e177

File tree

12 files changed

+40
-40
lines changed

12 files changed

+40
-40
lines changed

examples/GPRSPing/GPRSPing.ino

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ void setup() {
3939

4040
Serial.println("Starting Arduino GPRS ping.");
4141
// connection state
42-
boolean notConnected = true;
42+
boolean connected = false;
4343

4444
// After starting the modem with GSM.begin()
4545
// attach the shield to the GPRS network with the APN, login and password
46-
while (notConnected) {
47-
if ((gsmAccess.begin(PINNUMBER) == GSM_READY) &
46+
while (!connected) {
47+
if ((gsmAccess.begin(PINNUMBER) == GSM_READY) &&
4848
(gprs.attachGPRS(GPRS_APN, GPRS_LOGIN, GPRS_PASSWORD) == GPRS_READY)) {
49-
notConnected = false;
49+
connected = true;
5050
} else {
5151
Serial.println("Not connected");
5252
delay(1000);

examples/GPRSUdpNtpClient/GPRSUdpNtpClient.ino

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,14 @@ void setup()
5656

5757
Serial.println("Starting Arduino GPRS NTP client.");
5858
// connection state
59-
boolean notConnected = true;
59+
boolean connected = false;
6060

6161
// After starting the modem with GSM.begin()
6262
// attach the shield to the GPRS network with the APN, login and password
63-
while (notConnected) {
64-
if ((gsmAccess.begin(PINNUMBER) == GSM_READY) &
63+
while (!connected) {
64+
if ((gsmAccess.begin(PINNUMBER) == GSM_READY) &&
6565
(gprs.attachGPRS(GPRS_APN, GPRS_LOGIN, GPRS_PASSWORD) == GPRS_READY)) {
66-
notConnected = false;
66+
connected = true;
6767
} else {
6868
Serial.println("Not connected");
6969
delay(1000);

examples/GsmLocation/GsmLocation.ino

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ void setup() {
4040

4141
Serial.println("Starting GSM location.");
4242
// connection state
43-
boolean notConnected = true;
43+
boolean connected = false;
4444

4545
// After starting the modem with GSM.begin()
4646
// attach the shield to the GPRS network with the APN, login and password
47-
while (notConnected) {
48-
if ((gsmAccess.begin(PINNUMBER) == GSM_READY) &
47+
while (!connected) {
48+
if ((gsmAccess.begin(PINNUMBER) == GSM_READY) &&
4949
(gprs.attachGPRS(GPRS_APN, GPRS_LOGIN, GPRS_PASSWORD) == GPRS_READY)) {
50-
notConnected = false;
50+
connected = true;
5151
} else {
5252
Serial.println("Not connected");
5353
delay(1000);

examples/GsmSSLWebClient/GsmSSLWebClient.ino

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,14 @@ void setup() {
4545

4646
Serial.println("Starting Arduino web client.");
4747
// connection state
48-
boolean notConnected = true;
48+
boolean connected = false;
4949

5050
// After starting the modem with GSM.begin()
5151
// attach the shield to the GPRS network with the APN, login and password
52-
while (notConnected) {
53-
if ((gsmAccess.begin(PINNUMBER) == GSM_READY) &
52+
while (!connected) {
53+
if ((gsmAccess.begin(PINNUMBER) == GSM_READY) &&
5454
(gprs.attachGPRS(GPRS_APN, GPRS_LOGIN, GPRS_PASSWORD) == GPRS_READY)) {
55-
notConnected = false;
55+
connected = true;
5656
} else {
5757
Serial.println("Not connected");
5858
delay(1000);

examples/GsmWebClient/GsmWebClient.ino

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,14 @@ void setup() {
4545

4646
Serial.println("Starting Arduino web client.");
4747
// connection state
48-
boolean notConnected = true;
48+
boolean connected = false;
4949

5050
// After starting the modem with GSM.begin()
5151
// attach the shield to the GPRS network with the APN, login and password
52-
while (notConnected) {
53-
if ((gsmAccess.begin(PINNUMBER) == GSM_READY) &
52+
while (!connected) {
53+
if ((gsmAccess.begin(PINNUMBER) == GSM_READY) &&
5454
(gprs.attachGPRS(GPRS_APN, GPRS_LOGIN, GPRS_PASSWORD) == GPRS_READY)) {
55-
notConnected = false;
55+
connected = true;
5656
} else {
5757
Serial.println("Not connected");
5858
delay(1000);

examples/GsmWebServer/GsmWebServer.ino

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@ void setup() {
4242
}
4343

4444
// connection state
45-
boolean notConnected = true;
45+
boolean connected = false;
4646

4747
// Start GSM shield
4848
// If your SIM has PIN, pass it as a parameter of begin() in quotes
49-
while (notConnected) {
50-
if ((gsmAccess.begin(PINNUMBER) == GSM_READY) &
49+
while (!connected) {
50+
if ((gsmAccess.begin(PINNUMBER) == GSM_READY) &&
5151
(gprs.attachGPRS(GPRS_APN, GPRS_LOGIN, GPRS_PASSWORD) == GPRS_READY)) {
52-
notConnected = false;
52+
connected = true;
5353
} else {
5454
Serial.println("Not connected");
5555
delay(1000);

examples/MakeVoiceCall/MakeVoiceCall.ino

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ void setup() {
4343
Serial.println("Make Voice Call");
4444

4545
// connection state
46-
boolean notConnected = true;
46+
boolean connected = false;
4747

4848
// Start GSM shield
4949
// If your SIM has PIN, pass it as a parameter of begin() in quotes
50-
while (notConnected) {
50+
while (!connected) {
5151
if (gsmAccess.begin(PINNUMBER) == GSM_READY) {
52-
notConnected = false;
52+
connected = true;
5353
} else {
5454
Serial.println("Not connected");
5555
delay(1000);

examples/ReceiveSMS/ReceiveSMS.ino

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ void setup() {
3838
Serial.println("SMS Messages Receiver");
3939

4040
// connection state
41-
boolean notConnected = true;
41+
boolean connected = false;
4242

4343
// Start GSM connection
44-
while (notConnected) {
44+
while (!connected) {
4545
if (gsmAccess.begin(PINNUMBER) == GSM_READY) {
46-
notConnected = false;
46+
connected = true;
4747
} else {
4848
Serial.println("Not connected");
4949
delay(1000);

examples/ReceiveVoiceCall/ReceiveVoiceCall.ino

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ void setup() {
3838
Serial.println("Receive Voice Call");
3939

4040
// connection state
41-
boolean notConnected = true;
41+
boolean connected = false;
4242

4343
// Start GSM shield
4444
// If your SIM has PIN, pass it as a parameter of begin() in quotes
45-
while (notConnected) {
45+
while (!connected) {
4646
if (gsmAccess.begin(PINNUMBER) == GSM_READY) {
47-
notConnected = false;
47+
connected = true;
4848
} else {
4949
Serial.println("Not connected");
5050
delay(1000);

examples/SendSMS/SendSMS.ino

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ void setup() {
3939
Serial.println("SMS Messages Sender");
4040

4141
// connection state
42-
boolean notConnected = true;
42+
boolean connected = false;
4343

4444
// Start GSM shield
4545
// If your SIM has PIN, pass it as a parameter of begin() in quotes
46-
while (notConnected) {
46+
while (!connected) {
4747
if (gsmAccess.begin(PINNUMBER) == GSM_READY) {
48-
notConnected = false;
48+
connected = true;
4949
} else {
5050
Serial.println("Not connected");
5151
delay(1000);

0 commit comments

Comments
 (0)