mirror of
https://github.com/arduino/Arduino.git
synced 2025-03-15 12:29:26 +01:00
Use consistent formatting style for Processing code included in built-in example comments
This commit is contained in:
parent
18b5327da0
commit
abc9a8917d
@ -42,7 +42,9 @@ void loop() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Processing code for this example
|
/* Processing code for this example
|
||||||
|
|
||||||
// Dimmer - sends bytes over a serial port
|
// Dimmer - sends bytes over a serial port
|
||||||
|
|
||||||
// by David A. Mellis
|
// by David A. Mellis
|
||||||
// This example code is in the public domain.
|
// This example code is in the public domain.
|
||||||
|
|
||||||
@ -78,6 +80,7 @@ void loop() {
|
|||||||
// a single byte
|
// a single byte
|
||||||
port.write(mouseX);
|
port.write(mouseX);
|
||||||
}
|
}
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Max/MSP v5 patch for this example
|
/* Max/MSP v5 patch for this example
|
||||||
|
@ -42,13 +42,12 @@ void loop() {
|
|||||||
|
|
||||||
// Graphing sketch
|
// Graphing sketch
|
||||||
|
|
||||||
|
|
||||||
// This program takes ASCII-encoded strings from the serial port at 9600 baud
|
// This program takes ASCII-encoded strings from the serial port at 9600 baud
|
||||||
// and graphs them. It expects values in the range 0 to 1023, followed by a
|
// and graphs them. It expects values in the range 0 to 1023, followed by a
|
||||||
// newline, or newline and carriage return
|
// newline, or newline and carriage return
|
||||||
|
|
||||||
// Created 20 Apr 2005
|
// created 20 Apr 2005
|
||||||
// Updated 24 Nov 2015
|
// updated 24 Nov 2015
|
||||||
// by Tom Igoe
|
// by Tom Igoe
|
||||||
// This example code is in the public domain.
|
// This example code is in the public domain.
|
||||||
|
|
||||||
@ -77,6 +76,7 @@ void loop() {
|
|||||||
// set initial background:
|
// set initial background:
|
||||||
background(0);
|
background(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void draw () {
|
void draw () {
|
||||||
// draw the line:
|
// draw the line:
|
||||||
stroke(127, 34, 255);
|
stroke(127, 34, 255);
|
||||||
@ -92,7 +92,6 @@ void loop() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void serialEvent (Serial myPort) {
|
void serialEvent (Serial myPort) {
|
||||||
// get the ASCII string:
|
// get the ASCII string:
|
||||||
String inString = myPort.readStringUntil('\n');
|
String inString = myPort.readStringUntil('\n');
|
||||||
|
@ -49,7 +49,7 @@ void loop() {
|
|||||||
|
|
||||||
/* Processing code for this example
|
/* Processing code for this example
|
||||||
|
|
||||||
// mouse over serial
|
// Mouse over serial
|
||||||
|
|
||||||
// Demonstrates how to send data to the Arduino I/O board, in order to turn ON
|
// Demonstrates how to send data to the Arduino I/O board, in order to turn ON
|
||||||
// a light if the mouse is over a square and turn it off if the mouse is not.
|
// a light if the mouse is over a square and turn it off if the mouse is not.
|
||||||
@ -60,8 +60,6 @@ void loop() {
|
|||||||
// by Tom Igoe
|
// by Tom Igoe
|
||||||
// This example code is in the public domain.
|
// This example code is in the public domain.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import processing.serial.*;
|
import processing.serial.*;
|
||||||
|
|
||||||
float boxX;
|
float boxX;
|
||||||
@ -87,11 +85,9 @@ void loop() {
|
|||||||
// Open the port that the Arduino board is connected to (in this case #0)
|
// Open the port that the Arduino board is connected to (in this case #0)
|
||||||
// Make sure to open the port at the same speed Arduino is using (9600bps)
|
// Make sure to open the port at the same speed Arduino is using (9600bps)
|
||||||
port = new Serial(this, Serial.list()[0], 9600);
|
port = new Serial(this, Serial.list()[0], 9600);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void draw()
|
void draw() {
|
||||||
{
|
|
||||||
background(0);
|
background(0);
|
||||||
|
|
||||||
// Test if the cursor is over the box
|
// Test if the cursor is over the box
|
||||||
@ -117,7 +113,6 @@ void loop() {
|
|||||||
rect(boxX, boxY, boxSize, boxSize);
|
rect(boxX, boxY, boxSize, boxSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -64,8 +64,7 @@ void establishContact() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/* Processing sketch to run with this example:
|
||||||
Processing sketch to run with this example:
|
|
||||||
|
|
||||||
// This example code is in the public domain.
|
// This example code is in the public domain.
|
||||||
|
|
||||||
@ -140,6 +139,7 @@ void establishContact() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -66,9 +66,7 @@ void establishContact() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Processing code to run with this example:
|
||||||
/*
|
|
||||||
Processing code to run with this example:
|
|
||||||
|
|
||||||
// This example code is in the public domain.
|
// This example code is in the public domain.
|
||||||
|
|
||||||
|
@ -33,7 +33,9 @@ void loop() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Processing code for this example
|
/* Processing code for this example
|
||||||
|
|
||||||
// Tweak the Arduino Logo
|
// Tweak the Arduino Logo
|
||||||
|
|
||||||
// by Scott Fitzgerald
|
// by Scott Fitzgerald
|
||||||
// This example code is in the public domain.
|
// This example code is in the public domain.
|
||||||
|
|
||||||
@ -95,4 +97,5 @@ void loop() {
|
|||||||
// draw the Arduino logo
|
// draw the Arduino logo
|
||||||
image(logo, 0, 0);
|
image(logo, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user