1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-30 16:24:09 +03:00

Updated all serial in setup examples with a note about the serial check

This commit is contained in:
Tom Igoe
2012-04-02 11:11:46 -04:00
parent a631e4f834
commit 202bb102a0
32 changed files with 91 additions and 28 deletions

View File

@ -41,7 +41,9 @@ void setup() {
server.begin();
// Open serial communications and wait for port to open:
Serial.begin(9600);
while(!Serial) ;
// this check is only needed on the Leonardo:
while (!Serial) ;
;
Serial.print("Chat server address:");
Serial.println(Ethernet.localIP());

View File

@ -30,7 +30,9 @@ EthernetClient client;
void setup() {
// Open serial communications and wait for port to open:
Serial.begin(9600);
while(!Serial) ;
// this check is only needed on the Leonardo:
while (!Serial) ;
;
// start the Ethernet connection:
if (Ethernet.begin(mac) == 0) {

View File

@ -37,7 +37,9 @@ boolean gotAMessage = false; // whether or not you got a message from the client
void setup() {
// Open serial communications and wait for port to open:
Serial.begin(9600);
while(!Serial) ;
// this check is only needed on the Leonardo:
while (!Serial) ;
;
// start the Ethernet connection:
Serial.println("Trying to get an IP address using DHCP");

View File

@ -30,7 +30,9 @@ EthernetClient client;
void setup() {
// Open serial communications and wait for port to open:
Serial.begin(9600);
while(!Serial) ;
// this check is only needed on the Leonardo:
while (!Serial) ;
;
// start the Ethernet connection:
if (Ethernet.begin(mac) == 0) {

View File

@ -55,7 +55,9 @@ const unsigned long postingInterval = 10*1000; //delay between updates to Pachub
void setup() {
// Open serial communications and wait for port to open:
Serial.begin(9600);
while(!Serial) ;
// this check is only needed on the Leonardo:
while (!Serial) ;
;
// start the Ethernet connection:
if (Ethernet.begin(mac) == 0) {

View File

@ -57,7 +57,9 @@ const unsigned long postingInterval = 10*1000; //delay between updates to Pachu
void setup() {
// Open serial communications and wait for port to open:
Serial.begin(9600);
while(!Serial) ;
// this check is only needed on the Leonardo:
while (!Serial) ;
;
// give the ethernet module time to boot up:
delay(1000);

View File

@ -41,7 +41,9 @@ void setup() {
Ethernet.begin(mac, ip);
// Open serial communications and wait for port to open:
Serial.begin(9600);
while(!Serial) ;
// this check is only needed on the Leonardo:
while (!Serial) ;
;
// give the Ethernet shield a second to initialize:
delay(1000);

View File

@ -54,7 +54,9 @@ void setup() {
// Open serial communications and wait for port to open:
Serial.begin(9600);
while(!Serial) ;
// this check is only needed on the Leonardo:
while (!Serial) ;
;
// attempt a DHCP connection:
Serial.println("Attempting to get an IP address using DHCP:");

View File

@ -40,7 +40,9 @@ void setup()
{
// Open serial communications and wait for port to open:
Serial.begin(9600);
while(!Serial) ;
// this check is only needed on the Leonardo:
while (!Serial) ;
;
// start Ethernet and UDP
if (Ethernet.begin(mac) == 0) {

View File

@ -29,7 +29,9 @@ EthernetClient client;
void setup() {
// Open serial communications and wait for port to open:
Serial.begin(9600);
while(!Serial) ;
// this check is only needed on the Leonardo:
while (!Serial) ;
;
// start the Ethernet connection:
if (Ethernet.begin(mac) == 0) {

View File

@ -32,7 +32,9 @@ EthernetServer server(80);
void setup() {
// Open serial communications and wait for port to open:
Serial.begin(9600);
while(!Serial) ;
// this check is only needed on the Leonardo:
while (!Serial) ;
;
// start the Ethernet connection and the server:
Ethernet.begin(mac, ip);