1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-08-01 03:47:23 +03:00

Run new astyle formatter against all the examples

This commit is contained in:
Federico Fissore
2013-10-21 09:58:40 +02:00
parent 3c6ee46828
commit b4c68b3dff
259 changed files with 5160 additions and 5217 deletions

View File

@ -24,7 +24,8 @@ const int threshold = 10; // minimum reading of the sensors that generates a
// notes to play, corresponding to the 3 sensors:
int notes[] = {
NOTE_A4, NOTE_B4,NOTE_C3 };
NOTE_A4, NOTE_B4, NOTE_C3
};
void setup() {

View File

@ -19,11 +19,13 @@ This example code is in the public domain.
// notes in the melody:
int melody[] = {
NOTE_C4, NOTE_G3,NOTE_G3, NOTE_A3, NOTE_G3,0, NOTE_B3, NOTE_C4};
NOTE_C4, NOTE_G3, NOTE_G3, NOTE_A3, NOTE_G3, 0, NOTE_B3, NOTE_C4
};
// note durations: 4 = quarter note, 8 = eighth note, etc.:
int noteDurations[] = {
4, 8, 8, 4,4,4,4,4 };
4, 8, 8, 4, 4, 4, 4, 4
};
void setup() {
// iterate over the notes of the melody:

View File

@ -23,7 +23,8 @@ This example code is in the public domain.
int timer = 100; // The higher the number, the slower the timing.
int ledPins[] = {
2, 7, 4, 6, 5, 3 }; // an array of pin numbers to which LEDs are attached
2, 7, 4, 6, 5, 3
}; // an array of pin numbers to which LEDs are attached
int pinCount = 6; // the number of pins (i.e. the length of the array)
void setup() {

View File

@ -36,11 +36,13 @@
// 2-dimensional array of row pin numbers:
const int row[8] = {
2,7,19,5,13,18,12,16 };
2, 7, 19, 5, 13, 18, 12, 16
};
// 2-dimensional array of column pin numbers:
const int col[8] = {
6,11,10,3,17,4,8,9 };
6, 11, 10, 3, 17, 4, 8, 9
};
// 2-dimensional array of pixels:
int pixels[8][8];

View File

@ -26,7 +26,8 @@ const int analogPin = A0; // the pin that the potentiometer is attached to
const int ledCount = 10; // the number of LEDs in the bar graph
int ledPins[] = {
2, 3, 4, 5, 6, 7,8,9,10,11 }; // an array of pin numbers to which LEDs are attached
2, 3, 4, 5, 6, 7, 8, 9, 10, 11
}; // an array of pin numbers to which LEDs are attached
void setup() {

View File

@ -40,7 +40,9 @@ void setup() {
// for debugging, wait until a serial console is connected
delay(4000);
while (!Serial) { ; }
while (!Serial) {
;
}
// start-up the bridge
Bridge.begin();

View File

@ -40,7 +40,9 @@ void setup() {
// for debugging, wait until a serial console is connected
delay(4000);
while (!Serial) { ; }
while (!Serial) {
;
}
// start-up the bridge
Bridge.begin();

View File

@ -41,7 +41,9 @@ void setup() {
// for debugging, wait until a serial console is connected
delay(4000);
while (!Serial) { ; }
while (!Serial) {
;
}
// start-up the bridge
Bridge.begin();

View File

@ -38,7 +38,9 @@ void setup() {
// for debugging, wait until a serial console is connected
delay(4000);
while (!Serial) { ; }
while (!Serial) {
;
}
// start-up the bridge
Bridge.begin();

View File

@ -29,7 +29,8 @@
// assign a MAC address for the ethernet controller.
// fill in your address here:
byte mac[] = {
0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};
0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED
};
// assign an IP address for the controller:
IPAddress ip(192, 168, 1, 20);
IPAddress gateway(192, 168, 1, 1);

View File

@ -24,7 +24,8 @@
// The IP address will be dependent on your local network.
// gateway and subnet are optional:
byte mac[] = {
0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED
};
IPAddress ip(192, 168, 1, 177);
IPAddress gateway(192, 168, 1, 1);
IPAddress subnet(255, 255, 0, 0);

View File

@ -35,7 +35,8 @@ http://arduino.cc/en/Tutorial/CosmClient
// Newer Ethernet shields have a MAC address printed on a sticker on the shield
// fill in your address here:
byte mac[] = {
0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};
0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED
};
// fill in an available IP address on your network here,
// for manual configuration:

View File

@ -37,7 +37,8 @@
// assign a MAC address for the ethernet controller.
// fill in your address here:
byte mac[] = {
0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};
0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED
};
// fill in an available IP address on your network here,
// for manual configuration:

View File

@ -20,7 +20,8 @@
// Enter a MAC address for your controller below.
// Newer Ethernet shields have a MAC address printed on a sticker on the shield
byte mac[] = {
0x00, 0xAA, 0xBB, 0xCC, 0xDE, 0x02 };
0x00, 0xAA, 0xBB, 0xCC, 0xDE, 0x02
};
// Initialize the Ethernet client library
// with the IP address and port of the server

View File

@ -25,7 +25,8 @@
// The IP address will be dependent on your local network.
// gateway and subnet are optional:
byte mac[] = {
0x00, 0xAA, 0xBB, 0xCC, 0xDE, 0x02 };
0x00, 0xAA, 0xBB, 0xCC, 0xDE, 0x02
};
IPAddress ip(192, 168, 1, 177);
IPAddress gateway(192, 168, 1, 1);
IPAddress subnet(255, 255, 0, 0);

View File

@ -35,7 +35,8 @@ http://arduino.cc/en/Tutorial/PachubeClient
// Newer Ethernet shields have a MAC address printed on a sticker on the shield
// fill in your address here:
byte mac[] = {
0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};
0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED
};
// fill in an available IP address on your network here,
// for manual configuration:

View File

@ -38,7 +38,8 @@
// assign a MAC address for the ethernet controller.
// fill in your address here:
byte mac[] = {
0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};
0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED
};
// fill in an available IP address on your network here,
// for manual configuration:

View File

@ -24,7 +24,8 @@
// Enter a MAC address and IP address for your controller below.
// The IP address will be dependent on your local network:
byte mac[] = {
0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED
};
IPAddress ip(192, 168, 1, 177);
// Enter the IP address of the server you're connecting to:

View File

@ -21,7 +21,8 @@
// Enter a MAC address and IP address for your controller below.
// The IP address will be dependent on your local network:
byte mac[] = {
0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED
};
IPAddress ip(192, 168, 1, 177);
unsigned int localPort = 8888; // local port to listen on

View File

@ -23,7 +23,8 @@
// Enter a MAC address for your controller below.
// Newer Ethernet shields have a MAC address printed on a sticker on the shield
byte mac[] = {
0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED
};
unsigned int localPort = 8888; // local port to listen for UDP packets

View File

@ -26,7 +26,8 @@
// assign a MAC address for the ethernet controller.
// fill in your address here:
byte mac[] = {
0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};
0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED
};
// fill in an available IP address on your network here,
// for manual configuration:
IPAddress ip(10, 0, 0, 20);

View File

@ -21,7 +21,8 @@
// Enter a MAC address and IP address for your controller below.
// The IP address will be dependent on your local network:
byte mac[] = {
0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED
};
IPAddress ip(192, 168, 1, 177);
// Initialize the Ethernet server library

View File

@ -238,7 +238,8 @@ unsigned int sendbuf[] = { /* NEC format */
560, 560, 560, 1690, 560, 1690, 560, 560, /* 6 */
560, 560, 560, 1690, 560, 1690, 560, 1690, /* 7 */
560, 1690, 560, 560, 560, 560, 560, 560, /* 8 */
560};
560
};
void loop() {
if (mode == SENDER) {

View File

@ -1,37 +0,0 @@
/*
Turn Test
Check if the robot turns a certain amount of degrees.
Circuit:
* Arduino Robot
created 1 May 2013
by X. Yang
modified 12 May 2013
by D. Cuartielles
This example is in the public domain
*/
#include <ArduinoRobot.h>
void setup() {
// initialize the robot
Robot.begin();
}
<<<<<<< HEAD
void loop() {
Robot.turn(50); //turn 50 degrees to the right
=======
void loop(){
Robot.turn(50);//turn 50 degrees to the right
Robot.motorsStop();
>>>>>>> f062f704463222e83390b4a954e211f0f7e6e66f
delay(1000);
Robot.turn(-100);//turn 100 degrees to the left
Robot.motorsStop();
delay(1000);
}

View File

@ -1,49 +0,0 @@
/*
Keyboard Test
Check how the robot's keyboard works. This example
sends the data about the key pressed through the
serial port.
All the buttons on the Control Board are tied up to a
single analog input pin, in this way it is possible to multiplex a
whole series of buttons on one single pin.
It is possible to recalibrate the thresholds of the buttons using
the Robot.keyboardCalibrate() function, that takes a 5 ints long
array as parameter
Circuit:
* Arduino Robot
created 1 May 2013
by X. Yang
modified 12 May 2013
by D. Cuartielles
This example is in the public domain
*/
#include <ArduinoRobot.h>
<<<<<<< HEAD
// it is possible to use an array to calibrate
//int vals[] = { 0, 133, 305, 481, 724 };
void setup() {
// initialize the serial port
Serial.begin(9600);
// calibrate the keyboard
//Robot.keyboardCalibrate(vals);//For the new robot only.
=======
void setup(){
Serial.begin(9600);
>>>>>>> f062f704463222e83390b4a954e211f0f7e6e66f
}
void loop() {
// print out the keyboard readings
Serial.println(Robot.keyboardRead());
delay(100);
}