mirror of
https://github.com/arduino/Arduino.git
synced 2025-03-15 12:29:26 +01:00
added serial opening mod for Leonardo in examples
This commit is contained in:
parent
9c63ffb8b7
commit
970dd043ce
@ -18,8 +18,11 @@ char ssid[] = "yourNetwork"; // the name of your network
|
|||||||
int status = WL_IDLE_STATUS; // the Wifi radio's status
|
int status = WL_IDLE_STATUS; // the Wifi radio's status
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
// initialize serial:
|
//Initialize serial and wait for port to open:
|
||||||
Serial.begin(9600);
|
Serial.begin(9600);
|
||||||
|
while (!Serial) {
|
||||||
|
; // wait for serial port to connect. Needed for Leonardo only
|
||||||
|
}
|
||||||
|
|
||||||
// check for the presence of the shield:
|
// check for the presence of the shield:
|
||||||
if (WiFi.status() == WL_NO_SHIELD) {
|
if (WiFi.status() == WL_NO_SHIELD) {
|
||||||
|
@ -30,8 +30,11 @@ int keyIndex = 0; // your network key Index numbe
|
|||||||
int status = WL_IDLE_STATUS; // the Wifi radio's status
|
int status = WL_IDLE_STATUS; // the Wifi radio's status
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
// initialize serial:
|
//Initialize serial and wait for port to open:
|
||||||
Serial.begin(9600);
|
Serial.begin(9600);
|
||||||
|
while (!Serial) {
|
||||||
|
; // wait for serial port to connect. Needed for Leonardo only
|
||||||
|
}
|
||||||
|
|
||||||
// check for the presence of the shield:
|
// check for the presence of the shield:
|
||||||
if (WiFi.status() == WL_NO_SHIELD) {
|
if (WiFi.status() == WL_NO_SHIELD) {
|
||||||
|
@ -19,8 +19,11 @@ char pass[] = "secretPassword"; // your network password
|
|||||||
int status = WL_IDLE_STATUS; // the Wifi radio's status
|
int status = WL_IDLE_STATUS; // the Wifi radio's status
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
// initialize serial:
|
//Initialize serial and wait for port to open:
|
||||||
Serial.begin(9600);
|
Serial.begin(9600);
|
||||||
|
while (!Serial) {
|
||||||
|
; // wait for serial port to connect. Needed for Leonardo only
|
||||||
|
}
|
||||||
|
|
||||||
// check for the presence of the shield:
|
// check for the presence of the shield:
|
||||||
if (WiFi.status() == WL_NO_SHIELD) {
|
if (WiFi.status() == WL_NO_SHIELD) {
|
||||||
|
@ -19,8 +19,11 @@
|
|||||||
#include <WiFi.h>
|
#include <WiFi.h>
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
// initialize serial and wait for the port to open:
|
//Initialize serial and wait for port to open:
|
||||||
Serial.begin(9600);
|
Serial.begin(9600);
|
||||||
|
while (!Serial) {
|
||||||
|
; // wait for serial port to connect. Needed for Leonardo only
|
||||||
|
}
|
||||||
|
|
||||||
// check for the presence of the shield:
|
// check for the presence of the shield:
|
||||||
if (WiFi.status() == WL_NO_SHIELD) {
|
if (WiFi.status() == WL_NO_SHIELD) {
|
||||||
|
@ -34,8 +34,11 @@ WiFiServer server(23);
|
|||||||
boolean alreadyConnected = false; // whether or not the client was connected previously
|
boolean alreadyConnected = false; // whether or not the client was connected previously
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
// start serial port:
|
//Initialize serial and wait for port to open:
|
||||||
Serial.begin(9600);
|
Serial.begin(9600);
|
||||||
|
while (!Serial) {
|
||||||
|
; // wait for serial port to connect. Needed for Leonardo only
|
||||||
|
}
|
||||||
|
|
||||||
// check for the presence of the shield:
|
// check for the presence of the shield:
|
||||||
if (WiFi.status() == WL_NO_SHIELD) {
|
if (WiFi.status() == WL_NO_SHIELD) {
|
||||||
|
@ -46,8 +46,11 @@ boolean lastConnected = false; // state of the connection last t
|
|||||||
const unsigned long postingInterval = 10*1000; //delay between updates to Cosm.com
|
const unsigned long postingInterval = 10*1000; //delay between updates to Cosm.com
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
// start serial port:
|
//Initialize serial and wait for port to open:
|
||||||
Serial.begin(9600);
|
Serial.begin(9600);
|
||||||
|
while (!Serial) {
|
||||||
|
; // wait for serial port to connect. Needed for Leonardo only
|
||||||
|
}
|
||||||
|
|
||||||
// check for the presence of the shield:
|
// check for the presence of the shield:
|
||||||
if (WiFi.status() == WL_NO_SHIELD) {
|
if (WiFi.status() == WL_NO_SHIELD) {
|
||||||
|
@ -51,8 +51,11 @@ boolean lastConnected = false; // state of the connection last t
|
|||||||
const unsigned long postingInterval = 10*1000; //delay between updates to cosm.com
|
const unsigned long postingInterval = 10*1000; //delay between updates to cosm.com
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
// start serial port:
|
//Initialize serial and wait for port to open:
|
||||||
Serial.begin(9600);
|
Serial.begin(9600);
|
||||||
|
while (!Serial) {
|
||||||
|
; // wait for serial port to connect. Needed for Leonardo only
|
||||||
|
}
|
||||||
|
|
||||||
// check for the presence of the shield:
|
// check for the presence of the shield:
|
||||||
if (WiFi.status() == WL_NO_SHIELD) {
|
if (WiFi.status() == WL_NO_SHIELD) {
|
||||||
|
@ -50,8 +50,11 @@ void setup() {
|
|||||||
// reserve space for the strings:
|
// reserve space for the strings:
|
||||||
currentLine.reserve(256);
|
currentLine.reserve(256);
|
||||||
tweet.reserve(150);
|
tweet.reserve(150);
|
||||||
// start serial port:
|
//Initialize serial and wait for port to open:
|
||||||
Serial.begin(9600);
|
Serial.begin(9600);
|
||||||
|
while (!Serial) {
|
||||||
|
; // wait for serial port to connect. Needed for Leonardo only
|
||||||
|
}
|
||||||
|
|
||||||
// check for the presence of the shield:
|
// check for the presence of the shield:
|
||||||
if (WiFi.status() == WL_NO_SHIELD) {
|
if (WiFi.status() == WL_NO_SHIELD) {
|
||||||
|
@ -40,7 +40,11 @@ IPAddress server(173,194,73,105); // numeric IP for Google (no DNS)
|
|||||||
WiFiClient client;
|
WiFiClient client;
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
|
//Initialize serial and wait for port to open:
|
||||||
Serial.begin(9600);
|
Serial.begin(9600);
|
||||||
|
while (!Serial) {
|
||||||
|
; // wait for serial port to connect. Needed for Leonardo only
|
||||||
|
}
|
||||||
|
|
||||||
// check for the presence of the shield:
|
// check for the presence of the shield:
|
||||||
if (WiFi.status() == WL_NO_SHIELD) {
|
if (WiFi.status() == WL_NO_SHIELD) {
|
||||||
|
@ -36,8 +36,11 @@ boolean lastConnected = false; // state of the connection last
|
|||||||
const unsigned long postingInterval = 10*1000; // delay between updates, in milliseconds
|
const unsigned long postingInterval = 10*1000; // delay between updates, in milliseconds
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
// start serial port:
|
//Initialize serial and wait for port to open:
|
||||||
Serial.begin(9600);
|
Serial.begin(9600);
|
||||||
|
while (!Serial) {
|
||||||
|
; // wait for serial port to connect. Needed for Leonardo only
|
||||||
|
}
|
||||||
|
|
||||||
// check for the presence of the shield:
|
// check for the presence of the shield:
|
||||||
if (WiFi.status() == WL_NO_SHIELD) {
|
if (WiFi.status() == WL_NO_SHIELD) {
|
||||||
|
@ -29,8 +29,11 @@ int status = WL_IDLE_STATUS;
|
|||||||
WiFiServer server(80);
|
WiFiServer server(80);
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
// start serial port:
|
//Initialize serial and wait for port to open:
|
||||||
Serial.begin(9600);
|
Serial.begin(9600);
|
||||||
|
while (!Serial) {
|
||||||
|
; // wait for serial port to connect. Needed for Leonardo only
|
||||||
|
}
|
||||||
|
|
||||||
// check for the presence of the shield:
|
// check for the presence of the shield:
|
||||||
if (WiFi.status() == WL_NO_SHIELD) {
|
if (WiFi.status() == WL_NO_SHIELD) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user