Skip to content

Commit a21c4e1

Browse files
committed
review of typos a and small errors in some examples
1 parent b89ef09 commit a21c4e1

File tree

17 files changed

+56
-85
lines changed

17 files changed

+56
-85
lines changed

build/shared/examples/08.Strings/StringAppendOperator/StringAppendOperator.ino

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
1212
This example code is in the public domain.
1313
*/
14+
1415
String stringOne, stringTwo;
1516

1617
void setup() {

build/shared/examples/08.Strings/StringLength/StringLength.ino

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
1212
This example code is in the public domain.
1313
*/
14+
1415
String txtMsg = ""; // a string for incoming text
1516
int lastStringLength = txtMsg.length(); // previous length of the String
1617

hardware/arduino/avr/libraries/Ethernet/examples/CosmClient/CosmClient.ino

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,11 @@ EthernetClient client;
4949
//IPAddress server(216,52,233,121); // numeric IP for api.cosm.com
5050
char server[] = "api.cosm.com"; // name address for cosm API
5151

52-
unsigned long lastConnectionTime = 0; // last time you connected to the server, in milliseconds
53-
boolean lastConnected = false; // state of the connection last time through the main loop
54-
const unsigned long postingInterval = 10*1000; //delay between updates to cosm.com
52+
unsigned long lastConnectionTime = 0; // last time you connected to the server, in milliseconds
53+
boolean lastConnected = false; // state of the connection last time through the main loop
54+
const unsigned long postingInterval = 10L*1000L; // delay between updates to cosm.com
55+
// the "L" is needed to use long type numbers
56+
5557

5658
void setup() {
5759
// start serial port:

hardware/arduino/avr/libraries/Ethernet/examples/CosmClientString/CosmClientString.ino

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ EthernetClient client;
5151
//IPAddress server(216,52,233,121); // numeric IP for api.cosm.com
5252
char server[] = "api.cosm.com"; // name address for Cosm API
5353

54-
unsigned long lastConnectionTime = 0; // last time you connected to the server, in milliseconds
55-
boolean lastConnected = false; // state of the connection last time through the main loop
56-
const unsigned long postingInterval = 10*1000; //delay between updates to Cosm.com
57-
54+
unsigned long lastConnectionTime = 0; // last time you connected to the server, in milliseconds
55+
boolean lastConnected = false; // state of the connection last time through the main loop
56+
const unsigned long postingInterval = 10L*1000L; // delay between updates to Cosm.com
57+
// the "L" is needed to use long type numbers
5858
void setup() {
5959
// start serial port:
6060
Serial.begin(9600);

hardware/arduino/avr/libraries/Ethernet/examples/WebClientRepeating/WebClientRepeating.ino

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,10 @@ EthernetClient client;
3939

4040
char server[] = "www.arduino.cc";
4141

42-
unsigned long lastConnectionTime = 0; // last time you connected to the server, in milliseconds
43-
boolean lastConnected = false; // state of the connection last time through the main loop
44-
const unsigned long postingInterval = 60*1000; // delay between updates, in milliseconds
42+
unsigned long lastConnectionTime = 0; // last time you connected to the server, in milliseconds
43+
boolean lastConnected = false; // state of the connection last time through the main loop
44+
const unsigned long postingInterval = 60L*1000L; // delay between updates, in milliseconds
45+
// the "L" is needed to use long type numbers
4546

4647
void setup() {
4748
// start serial port:

hardware/arduino/sam/libraries/Ethernet/examples/CosmClient/CosmClient.ino

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,18 @@ EthernetClient client;
4646

4747
// if you don't want to use DNS (and reduce your sketch size)
4848
// use the numeric IP instead of the name for the server:
49-
//IPAddress server(216,52,233,121); // numeric IP for api.cosm.com
49+
// IPAddress server(216,52,233,121); // numeric IP for api.cosm.com
5050
char server[] = "api.cosm.com"; // name address for cosm API
5151

52-
unsigned long lastConnectionTime = 0; // last time you connected to the server, in milliseconds
53-
boolean lastConnected = false; // state of the connection last time through the main loop
54-
const unsigned long postingInterval = 10*1000; //delay between updates to cosm.com
52+
unsigned long lastConnectionTime = 0; // last time you connected to the server, in milliseconds
53+
boolean lastConnected = false; // state of the connection last time through the main loop
54+
const unsigned long postingInterval = 10L*1000L; // delay between updates to cosm.com
55+
// the "L" is needed to use long type numbers
5556

5657
void setup() {
5758
// start serial port:
5859
Serial.begin(9600);
59-
// start the Ethernet connection:
60+
// start the Ethernet connection:
6061
if (Ethernet.begin(mac) == 0) {
6162
Serial.println("Failed to configure Ethernet using DHCP");
6263
// DHCP failed, so use a fixed IP address:

hardware/arduino/sam/libraries/Ethernet/examples/CosmClientString/CosmClientString.ino

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
// assign a MAC address for the ethernet controller.
3838
// fill in your address here:
39-
byte mac[] = {
39+
byte mac[] = {
4040
0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};
4141

4242
// fill in an available IP address on your network here,
@@ -48,12 +48,13 @@ EthernetClient client;
4848

4949
// if you don't want to use DNS (and reduce your sketch size)
5050
// use the numeric IP instead of the name for the server:
51-
//IPAddress server(216,52,233,121); // numeric IP for api.cosm.com
51+
// IPAddress server(216,52,233,121); // numeric IP for api.cosm.com
5252
char server[] = "api.cosm.com"; // name address for Cosm API
5353

54-
unsigned long lastConnectionTime = 0; // last time you connected to the server, in milliseconds
55-
boolean lastConnected = false; // state of the connection last time through the main loop
56-
const unsigned long postingInterval = 10*1000; //delay between updates to Cosm.com
54+
unsigned long lastConnectionTime = 0; // last time you connected to the server, in milliseconds
55+
boolean lastConnected = false; // state of the connection last time through the main loop
56+
const unsigned long postingInterval = 10L*1000L; // delay between updates to Cosm.com
57+
// the "L" is needed to use long type numbers
5758

5859
void setup() {
5960
// start serial port:

hardware/arduino/sam/libraries/Ethernet/examples/DhcpAddressPrinter/DhcpAddressPrinter.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ byte mac[] = {
2828
EthernetClient client;
2929

3030
void setup() {
31-
// Open serial communications and wait for port to open:
31+
// Open serial communications and wait for port to open:
3232
Serial.begin(9600);
3333
// this check is only needed on the Leonardo:
3434
while (!Serial) {

hardware/arduino/sam/libraries/Ethernet/examples/DhcpChatServer/DhcpChatServer.ino

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
DHCP Chat Server
2+
DHCP Chat Server
33
44
A simple server that distributes any incoming messages to all
55
connected clients. To use telnet to your device's IP address and type.
@@ -26,9 +26,9 @@
2626
// gateway and subnet are optional:
2727
byte mac[] = {
2828
0x00, 0xAA, 0xBB, 0xCC, 0xDE, 0x02 };
29-
IPAddress ip(192,168,1, 177);
30-
IPAddress gateway(192,168,1, 1);
31-
IPAddress subnet(255, 255, 0, 0);
29+
IPAddress ip(192,168,1,177);
30+
IPAddress gateway(192,168,1,1);
31+
IPAddress subnet(255,255,0,0);
3232

3333
// telnet defaults to port 23
3434
EthernetServer server(23);

hardware/arduino/sam/libraries/Ethernet/examples/DnsWebClient/DnsWebClient.ino

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
// Enter a MAC address for your controller below.
2121
// Newer Ethernet shields have a MAC address printed on a sticker on the shield
22-
byte mac[] = { 0x00, 0xAA, 0xBB, 0xCC, 0xDE, 0x02 };
22+
byte mac[] = { 0x00, 0xAA, 0xBB, 0xCC, 0xDE, 0x02 };
2323
char serverName[] = "www.google.com";
2424

2525
// Initialize the Ethernet client library
@@ -28,7 +28,7 @@ char serverName[] = "www.google.com";
2828
EthernetClient client;
2929

3030
void setup() {
31-
// Open serial communications and wait for port to open:
31+
// Open serial communications and wait for port to open:
3232
Serial.begin(9600);
3333
while (!Serial) {
3434
; // wait for serial port to connect. Needed for Leonardo only
@@ -45,16 +45,15 @@ void setup() {
4545
delay(1000);
4646
Serial.println("connecting...");
4747

48-
// if you get a connection, report back via serial:
49-
48+
// if you get a connection, report back via serial:
5049
if (client.connect(serverName, 80)) {
5150
Serial.println("connected");
5251
// Make a HTTP request:
5352
client.println("GET /search?q=arduino HTTP/1.0");
5453
client.println();
5554
}
5655
else {
57-
// kf you didn't get a connection to the server:
56+
// if you didn't get a connection to the server:
5857
Serial.println("connection failed");
5958
}
6059
}

hardware/arduino/sam/libraries/Ethernet/examples/TelnetClient/TelnetClient.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ EthernetClient client;
3939
void setup() {
4040
// start the Ethernet connection:
4141
Ethernet.begin(mac, ip);
42-
// Open serial communications and wait for port to open:
42+
// Open serial communications and wait for port to open:
4343
Serial.begin(9600);
4444
while (!Serial) {
4545
; // wait for serial port to connect. Needed for Leonardo only

hardware/arduino/sam/libraries/Ethernet/examples/UDPSendReceiveString/UDPSendReceiveString.ino

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/*
2-
UDPSendReceive.pde:
2+
UDPSendReceive
3+
34
This sketch receives UDP message strings, prints them to the serial port
45
and sends an "acknowledge" string back to the sender
56
@@ -10,24 +11,25 @@
1011
by Michael Margolis
1112
1213
This code is in the public domain.
14+
1315
*/
1416

1517

16-
#include <SPI.h> // needed for Arduino versions later than 0018
18+
#include <SPI.h> // needed for Arduino versions later than 0018
1719
#include <Ethernet.h>
18-
#include <EthernetUdp.h> // UDP library from: bjoern@cs.stanford.edu 12/30/2008
20+
#include <EthernetUdp.h> // UDP library from: bjoern@cs.stanford.edu 12/30/2008
1921

2022

2123
// Enter a MAC address and IP address for your controller below.
2224
// The IP address will be dependent on your local network:
2325
byte mac[] = {
2426
0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
25-
IPAddress ip(192, 168, 1, 177);
27+
IPAddress ip(192, 168,1,177);
2628

27-
unsigned int localPort = 8888; // local port to listen on
29+
unsigned int localPort = 8888; // local port to listen on
2830

2931
// buffers for receiving and sending data
30-
char packetBuffer[UDP_TX_PACKET_MAX_SIZE]; //buffer to hold incoming packet,
32+
char packetBuffer[UDP_TX_PACKET_MAX_SIZE]; //buffer to hold incoming packet,
3133
char ReplyBuffer[] = "acknowledged"; // a string to send back
3234

3335
// An EthernetUDP instance to let us send and receive packets over UDP

hardware/arduino/sam/libraries/Ethernet/examples/UdpNtpClient/UdpNtpClient.ino

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/*
2-
3-
Udp NTP Client
2+
Udp NTP Client
43
54
Get the time from a Network Time Protocol (NTP) time server
65
Demonstrates use of UDP sendPacket and ReceivePacket
@@ -38,7 +37,7 @@ EthernetUDP Udp;
3837

3938
void setup()
4039
{
41-
// Open serial communications and wait for port to open:
40+
// Open serial communications and wait for port to open:
4241
Serial.begin(9600);
4342
while (!Serial) {
4443
; // wait for serial port to connect. Needed for Leonardo only
@@ -59,7 +58,7 @@ void loop()
5958
{
6059
sendNTPpacket(timeServer); // send an NTP packet to a time server
6160

62-
// wait to see if a reply is available
61+
// wait to see if a reply is available
6362
delay(1000);
6463
if ( Udp.parsePacket() ) {
6564
// We've received a packet, read the data from it

hardware/arduino/sam/libraries/Ethernet/examples/WebClient/WebClient.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ void setup() {
5252
client.println();
5353
}
5454
else {
55-
// kf you didn't get a connection to the server:
55+
// if you didn't get a connection to the server:
5656
Serial.println("connection failed");
5757
}
5858
}

hardware/arduino/sam/libraries/Ethernet/examples/WebClientRepeating/WebClientRepeating.ino

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,10 @@ EthernetClient client;
3939

4040
char server[] = "www.arduino.cc";
4141

42-
unsigned long lastConnectionTime = 0; // last time you connected to the server, in milliseconds
43-
boolean lastConnected = false; // state of the connection last time through the main loop
44-
const unsigned long postingInterval = 60*1000; // delay between updates, in milliseconds
42+
unsigned long lastConnectionTime = 0; // last time you connected to the server, in milliseconds
43+
boolean lastConnected = false; // state of the connection last time through the main loop
44+
const unsigned long postingInterval = 60L*1000L; // delay between updates, in milliseconds
45+
// the "L" is needed to use long type numbers
4546

4647
void setup() {
4748
// start serial port:

hardware/arduino/sam/libraries/Ethernet/examples/WebServer/WebServer.ino

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@
2222
// The IP address will be dependent on your local network:
2323
byte mac[] = {
2424
0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
25-
IPAddress ip(192,168,1, 177);
25+
IPAddress ip(192,168,1,177);
2626

2727
// Initialize the Ethernet server library
2828
// with the IP address and port you want to use
2929
// (port 80 is default for HTTP):
3030
EthernetServer server(80);
3131

3232
void setup() {
33-
// Open serial communications and wait for port to open:
33+
// Open serial communications and wait for port to open:
3434
Serial.begin(9600);
3535
while (!Serial) {
3636
; // wait for serial port to connect. Needed for Leonardo only
@@ -67,7 +67,7 @@ void loop() {
6767
client.println();
6868
client.println("<!DOCTYPE HTML>");
6969
client.println("<html>");
70-
// add a meta refresh tag, so the browser pulls again every 5 seconds:
70+
// add a meta refresh tag, so the browser pulls again every 5 seconds:
7171
client.println("<meta http-equiv=\"refresh\" content=\"5\">");
7272
// output the value of each analog input pin
7373
for (int analogChannel = 0; analogChannel < 6; analogChannel++) {

hardware/arduino/sam/libraries/SPI/examples/DueX_ATFlashSignatureCheck/DueX_ATFlashSignatureCheck.ino

Lines changed: 0 additions & 37 deletions
This file was deleted.

0 commit comments

Comments
 (0)