mirror of
https://github.com/arduino/Arduino.git
synced 2025-01-18 07:52:14 +01:00
Make the formatting of opening comments of built-in examples consistent
This commit is contained in:
parent
eee3e5ba18
commit
e3044a5f5a
@ -1,10 +1,13 @@
|
||||
/*
|
||||
AnalogReadSerial
|
||||
|
||||
Reads an analog input on pin 0, prints the result to the Serial Monitor.
|
||||
Graphical representation is available using Serial Plotter (Tools > Serial Plotter menu)
|
||||
Graphical representation is available using Serial Plotter (Tools > Serial Plotter menu).
|
||||
Attach the center pin of a potentiometer to pin A0, and the outside pins to +5V and ground.
|
||||
|
||||
This example code is in the public domain.
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/AnalogReadSerial
|
||||
*/
|
||||
|
||||
// the setup routine runs once when you press reset:
|
||||
|
@ -1,5 +1,6 @@
|
||||
/*
|
||||
Blink
|
||||
|
||||
Turns an LED on for one second, then off for one second, repeatedly.
|
||||
|
||||
Most Arduinos have an on-board LED you can control. On the UNO, MEGA and ZERO
|
||||
@ -8,18 +9,17 @@
|
||||
If you want to know what pin the on-board LED is connected to on your Arduino model, check
|
||||
the Technical Specs of your board at https://www.arduino.cc/en/Main/Products
|
||||
|
||||
This example code is in the public domain.
|
||||
|
||||
modified 8 May 2014
|
||||
by Scott Fitzgerald
|
||||
|
||||
modified 2 Sep 2016
|
||||
by Arturo Guadalupi
|
||||
|
||||
modified 8 Sep 2016
|
||||
by Colby Newman
|
||||
*/
|
||||
|
||||
This example code is in the public domain.
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/Blink
|
||||
*/
|
||||
|
||||
// the setup function runs once when you press reset or power the board
|
||||
void setup() {
|
||||
|
@ -1,8 +1,11 @@
|
||||
/*
|
||||
DigitalReadSerial
|
||||
|
||||
Reads a digital input on pin 2, prints the result to the Serial Monitor
|
||||
|
||||
This example code is in the public domain.
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/DigitalReadSerial
|
||||
*/
|
||||
|
||||
// digital pin 2 has a pushbutton attached to it. Give it a name:
|
||||
|
@ -11,6 +11,8 @@
|
||||
a "~" sign, like ~3, ~5, ~6, ~9, ~10 and ~11.
|
||||
|
||||
This example code is in the public domain.
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/Fade
|
||||
*/
|
||||
|
||||
int led = 9; // the PWM pin the LED is attached to
|
||||
|
@ -1,10 +1,13 @@
|
||||
/*
|
||||
ReadAnalogVoltage
|
||||
|
||||
Reads an analog input on pin 0, converts it to voltage, and prints the result to the Serial Monitor.
|
||||
Graphical representation is available using Serial Plotter (Tools > Serial Plotter menu)
|
||||
Graphical representation is available using Serial Plotter (Tools > Serial Plotter menu).
|
||||
Attach the center pin of a potentiometer to pin A0, and the outside pins to +5V and ground.
|
||||
|
||||
This example code is in the public domain.
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/ReadAnalogVoltage
|
||||
*/
|
||||
|
||||
// the setup routine runs once when you press reset:
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* Blink without Delay
|
||||
/*
|
||||
Blink without Delay
|
||||
|
||||
Turns on and off a light emitting diode (LED) connected to a digital
|
||||
pin, without using the delay() function. This means that other code
|
||||
@ -7,10 +8,10 @@
|
||||
The circuit:
|
||||
- Use the onboard LED.
|
||||
- Note: Most Arduinos have an on-board LED you can control. On the UNO, MEGA and ZERO
|
||||
it is attached to digital pin 13, on MKR1000 on pin 6. LED_BUILTIN is set to
|
||||
the correct LED pin independent of which board is used.
|
||||
If you want to know what pin the on-board LED is connected to on your Arduino model, check
|
||||
the Technical Specs of your board at https://www.arduino.cc/en/Main/Products
|
||||
it is attached to digital pin 13, on MKR1000 on pin 6. LED_BUILTIN is set to
|
||||
the correct LED pin independent of which board is used.
|
||||
If you want to know what pin the on-board LED is connected to on your Arduino model, check
|
||||
the Technical Specs of your board at https://www.arduino.cc/en/Main/Products
|
||||
|
||||
created 2005
|
||||
by David A. Mellis
|
||||
@ -21,7 +22,6 @@
|
||||
modified 9 Jan 2017
|
||||
by Arturo Guadalupi
|
||||
|
||||
|
||||
This example code is in the public domain.
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/BlinkWithoutDelay
|
||||
|
@ -4,15 +4,13 @@
|
||||
Turns on and off a light emitting diode(LED) connected to digital
|
||||
pin 13, when pressing a pushbutton attached to pin 2.
|
||||
|
||||
|
||||
The circuit:
|
||||
- LED attached from pin 13 to ground
|
||||
- pushbutton attached to pin 2 from +5V
|
||||
- 10K resistor attached to pin 2 from ground
|
||||
|
||||
- Note: on most Arduinos there is already an LED on the board
|
||||
attached to pin 13.
|
||||
|
||||
attached to pin 13.
|
||||
|
||||
created 2005
|
||||
by DojoDave <http://www.0j0.org>
|
||||
|
@ -9,13 +9,12 @@
|
||||
The circuit:
|
||||
- LED attached from pin 13 to ground
|
||||
- pushbutton attached from pin 2 to +5V
|
||||
- 10K resistor attached from pin 2 to ground
|
||||
- 10 kilohm resistor attached from pin 2 to ground
|
||||
|
||||
- Note: On most Arduino boards, there is already an LED on the board
|
||||
connected to pin 13, so you don't need any extra components for this example.
|
||||
connected to pin 13, so you don't need any extra components for this example.
|
||||
|
||||
|
||||
created 21 November 2006
|
||||
created 21 Nov 2006
|
||||
by David A. Mellis
|
||||
modified 30 Aug 2011
|
||||
by Limor Fried
|
||||
@ -24,7 +23,6 @@
|
||||
modified 30 Aug 2016
|
||||
by Arturo Guadalupi
|
||||
|
||||
|
||||
This example code is in the public domain.
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/Debounce
|
||||
|
@ -5,20 +5,19 @@
|
||||
digital input on pin 2 and prints the results to the Serial Monitor.
|
||||
|
||||
The circuit:
|
||||
- Momentary switch attached from pin 2 to ground
|
||||
- Built-in LED on pin 13
|
||||
- momentary switch attached from pin 2 to ground
|
||||
- built-in LED on pin 13
|
||||
|
||||
Unlike pinMode(INPUT), there is no pull-down resistor necessary. An internal
|
||||
20K-ohm resistor is pulled to 5V. This configuration causes the input to
|
||||
read HIGH when the switch is open, and LOW when it is closed.
|
||||
|
||||
created 14 March 2012
|
||||
created 14 Mar 2012
|
||||
by Scott Fitzgerald
|
||||
|
||||
This example code is in the public domain.
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/InputPullupSerial
|
||||
|
||||
This example code is in the public domain
|
||||
|
||||
*/
|
||||
|
||||
void setup() {
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
The circuit:
|
||||
- pushbutton attached to pin 2 from +5V
|
||||
- 10K resistor attached to pin 2 from ground
|
||||
- 10 kilohm resistor attached to pin 2 from ground
|
||||
- LED attached from pin 13 to ground (or use the built-in LED on
|
||||
most Arduino boards)
|
||||
|
||||
@ -22,7 +22,6 @@
|
||||
This example code is in the public domain.
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/ButtonStateChange
|
||||
|
||||
*/
|
||||
|
||||
// this constant won't change:
|
||||
|
@ -1,12 +1,12 @@
|
||||
/*
|
||||
keyboard
|
||||
Keyboard
|
||||
|
||||
Plays a pitch that changes based on a changing analog input
|
||||
|
||||
circuit:
|
||||
- 3 force-sensing resistors from +5V to analog in 0 through 5
|
||||
- 3 10K resistors from analog in 0 through 5 to ground
|
||||
- 8-ohm speaker on digital pin 8
|
||||
- three force-sensing resistors from +5V to analog in 0 through 5
|
||||
- three 10 kilohm resistors from analog in 0 through 5 to ground
|
||||
- 8 ohm speaker on digital pin 8
|
||||
|
||||
created 21 Jan 2010
|
||||
modified 9 Apr 2012
|
||||
@ -15,7 +15,6 @@
|
||||
This example code is in the public domain.
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/Tone3
|
||||
|
||||
*/
|
||||
|
||||
#include "pitches.h"
|
||||
|
@ -4,7 +4,7 @@
|
||||
Plays a melody
|
||||
|
||||
circuit:
|
||||
- 8-ohm speaker on digital pin 8
|
||||
- 8 ohm speaker on digital pin 8
|
||||
|
||||
created 21 Jan 2010
|
||||
modified 30 Aug 2011
|
||||
@ -13,8 +13,8 @@
|
||||
This example code is in the public domain.
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/Tone
|
||||
|
||||
*/
|
||||
|
||||
#include "pitches.h"
|
||||
|
||||
// notes in the melody:
|
||||
|
@ -4,16 +4,15 @@
|
||||
Plays multiple tones on multiple pins in sequence
|
||||
|
||||
circuit:
|
||||
- 3 8-ohm speaker on digital pins 6, 7, and 8
|
||||
- three 8 ohm speakers on digital pins 6, 7, and 8
|
||||
|
||||
created 8 March 2010
|
||||
created 8 Mar 2010
|
||||
by Tom Igoe
|
||||
based on a snippet from Greg Borenstein
|
||||
|
||||
This example code is in the public domain.
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/Tone4
|
||||
|
||||
*/
|
||||
|
||||
void setup() {
|
||||
|
@ -4,9 +4,9 @@
|
||||
Plays a pitch that changes based on a changing analog input
|
||||
|
||||
circuit:
|
||||
- 8-ohm speaker on digital pin 9
|
||||
- 8 ohm speaker on digital pin 9
|
||||
- photoresistor on analog 0 to 5V
|
||||
- 4.7K resistor on analog 0 to ground
|
||||
- 4.7 kilohm resistor on analog 0 to ground
|
||||
|
||||
created 21 Jan 2010
|
||||
modified 31 May 2012
|
||||
@ -15,10 +15,8 @@
|
||||
This example code is in the public domain.
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/Tone2
|
||||
|
||||
*/
|
||||
|
||||
|
||||
void setup() {
|
||||
// initialize serial communications (for debugging only):
|
||||
Serial.begin(9600);
|
||||
|
@ -17,6 +17,7 @@
|
||||
|
||||
This example code is in the public domain.
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/AnalogInOutSerial
|
||||
*/
|
||||
|
||||
// These constants won't change. They're used to give names
|
||||
|
@ -1,30 +1,30 @@
|
||||
/*
|
||||
Analog Input
|
||||
|
||||
Demonstrates analog input by reading an analog sensor on analog pin 0 and
|
||||
turning on and off a light emitting diode(LED) connected to digital pin 13.
|
||||
The amount of time the LED will be on and off depends on
|
||||
the value obtained by analogRead().
|
||||
|
||||
The circuit:
|
||||
- Potentiometer attached to analog input 0
|
||||
- center pin of the potentiometer to the analog pin
|
||||
- one side pin (either one) to ground
|
||||
- the other side pin to +5V
|
||||
- LED anode (long leg) attached to digital output 13
|
||||
- LED cathode (short leg) attached to ground
|
||||
- potentiometer
|
||||
center pin of the potentiometer to the analog input 0
|
||||
one side pin (either one) to ground
|
||||
the other side pin to +5V
|
||||
- LED
|
||||
anode (long leg) attached to digital output 13
|
||||
cathode (short leg) attached to ground
|
||||
|
||||
- Note: because most Arduinos have a built-in LED attached
|
||||
to pin 13 on the board, the LED is optional.
|
||||
to pin 13 on the board, the LED is optional.
|
||||
|
||||
|
||||
Created by David Cuartielles
|
||||
created by David Cuartielles
|
||||
modified 30 Aug 2011
|
||||
By Tom Igoe
|
||||
|
||||
This example code is in the public domain.
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/AnalogInput
|
||||
|
||||
*/
|
||||
|
||||
int sensorPin = A0; // select the input pin for the potentiometer
|
||||
|
@ -12,7 +12,9 @@
|
||||
|
||||
This example code is in the public domain.
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/AnalogWriteMega
|
||||
*/
|
||||
|
||||
// These constants won't change. They're used to give names
|
||||
// to the pins used:
|
||||
const int lowestPin = 2;
|
||||
|
@ -12,18 +12,17 @@
|
||||
maximum low and listen for anything higher as the new maximum.
|
||||
|
||||
The circuit:
|
||||
- Analog sensor (potentiometer will do) attached to analog input 0
|
||||
- analog sensor (potentiometer will do) attached to analog input 0
|
||||
- LED attached from digital pin 9 to ground
|
||||
|
||||
created 29 Oct 2008
|
||||
By David A Mellis
|
||||
by David A Mellis
|
||||
modified 30 Aug 2011
|
||||
By Tom Igoe
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/Calibration
|
||||
by Tom Igoe
|
||||
|
||||
This example code is in the public domain.
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/Calibration
|
||||
*/
|
||||
|
||||
// These constants won't change:
|
||||
|
@ -6,18 +6,16 @@
|
||||
The circuit:
|
||||
- LED attached from digital pin 9 to ground.
|
||||
|
||||
Created 1 Nov 2008
|
||||
By David A. Mellis
|
||||
created 1 Nov 2008
|
||||
by David A. Mellis
|
||||
modified 30 Aug 2011
|
||||
By Tom Igoe
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/Fading
|
||||
by Tom Igoe
|
||||
|
||||
This example code is in the public domain.
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/Fading
|
||||
*/
|
||||
|
||||
|
||||
int ledPin = 9; // LED connected to digital pin 9
|
||||
|
||||
void setup() {
|
||||
|
@ -1,5 +1,4 @@
|
||||
/*
|
||||
|
||||
Smoothing
|
||||
|
||||
Reads repeatedly from an analog input, calculating a running average
|
||||
@ -7,20 +6,18 @@
|
||||
continually averages them.
|
||||
|
||||
The circuit:
|
||||
- Analog sensor (potentiometer will do) attached to analog input 0
|
||||
- analog sensor (potentiometer will do) attached to analog input 0
|
||||
|
||||
Created 22 April 2007
|
||||
By David A. Mellis <dam@mellis.org>
|
||||
created 22 Apr 2007
|
||||
by David A. Mellis <dam@mellis.org>
|
||||
modified 9 Apr 2012
|
||||
by Tom Igoe
|
||||
http://www.arduino.cc/en/Tutorial/Smoothing
|
||||
|
||||
This example code is in the public domain.
|
||||
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/Smoothing
|
||||
*/
|
||||
|
||||
|
||||
// Define the number of samples to keep track of. The higher the number,
|
||||
// the more the readings will be smoothed, but the slower the output will
|
||||
// respond to the input. Using a constant rather than a normal variable lets
|
||||
|
@ -10,15 +10,15 @@
|
||||
The circuit: No external hardware needed.
|
||||
|
||||
created 2006
|
||||
by Nicholas Zambetti
|
||||
by Nicholas Zambetti <http://www.zambetti.com>
|
||||
modified 9 Apr 2012
|
||||
by Tom Igoe
|
||||
|
||||
This example code is in the public domain.
|
||||
|
||||
<http://www.zambetti.com>
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/ASCIITable
|
||||
*/
|
||||
|
||||
void setup() {
|
||||
//Initialize serial and wait for port to open:
|
||||
Serial.begin(9600);
|
||||
|
@ -7,8 +7,8 @@
|
||||
reads these bytes and uses them to set the brightness of the LED.
|
||||
|
||||
The circuit:
|
||||
LED attached from digital pin 9 to ground.
|
||||
Serial connection to Processing, Max/MSP, or another serial application
|
||||
- LED attached from digital pin 9 to ground.
|
||||
- Serial connection to Processing, Max/MSP, or another serial application
|
||||
|
||||
created 2006
|
||||
by David A. Mellis
|
||||
@ -18,7 +18,6 @@
|
||||
This example code is in the public domain.
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/Dimmer
|
||||
|
||||
*/
|
||||
|
||||
const int ledPin = 9; // the pin that the LED is attached to
|
||||
|
@ -14,7 +14,7 @@
|
||||
so you can see the value of the analog input changing over time.
|
||||
|
||||
The circuit:
|
||||
Any analog input sensor is attached to analog in pin 0.
|
||||
- any analog input sensor attached to analog in pin 0
|
||||
|
||||
created 2006
|
||||
by David A. Mellis
|
||||
|
@ -5,12 +5,11 @@
|
||||
If this circuit is connected to a MIDI synth, it will play
|
||||
the notes F#-0 (0x1E) to F#-5 (0x5A) in sequence.
|
||||
|
||||
|
||||
The circuit:
|
||||
- digital in 1 connected to MIDI jack pin 5
|
||||
- MIDI jack pin 2 connected to ground
|
||||
- MIDI jack pin 4 connected to +5V through 220-ohm resistor
|
||||
Attach a MIDI cable to the jack, then to a MIDI synth, and play music.
|
||||
- MIDI jack pin 4 connected to +5V through 220 ohm resistor
|
||||
- Attach a MIDI cable to the jack, then to a MIDI synth, and play music.
|
||||
|
||||
created 13 Jun 2006
|
||||
modified 13 Aug 2012
|
||||
@ -19,7 +18,6 @@
|
||||
This example code is in the public domain.
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/Midi
|
||||
|
||||
*/
|
||||
|
||||
void setup() {
|
||||
|
@ -4,20 +4,19 @@
|
||||
Receives from the main serial port, sends to the others.
|
||||
Receives from serial port 1, sends to the main serial (Serial 0).
|
||||
|
||||
This example works only with boards with more than one serial like Arduino Mega, Due, Zero etc
|
||||
This example works only with boards with more than one serial like Arduino Mega, Due, Zero etc.
|
||||
|
||||
The circuit:
|
||||
- Any serial device attached to Serial port 1
|
||||
- Serial monitor open on Serial port 0:
|
||||
- any serial device attached to Serial port 1
|
||||
- Serial Monitor open on Serial port 0
|
||||
|
||||
created 30 Dec. 2008
|
||||
created 30 Dec 2008
|
||||
modified 20 May 2012
|
||||
by Tom Igoe & Jed Roach
|
||||
modified 27 Nov 2015
|
||||
by Arturo Guadalupi
|
||||
|
||||
This example code is in the public domain.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
@ -6,14 +6,13 @@
|
||||
It parses them into ints, and uses those to fade an RGB LED.
|
||||
|
||||
Circuit: Common-Cathode RGB LED wired like so:
|
||||
- Red anode: digital pin 3
|
||||
- Green anode: digital pin 5
|
||||
- Blue anode: digital pin 6
|
||||
- Cathode : GND
|
||||
- red anode: digital pin 3
|
||||
- green anode: digital pin 5
|
||||
- blue anode: digital pin 6
|
||||
- cathode: GND
|
||||
|
||||
created 13 Apr 2012
|
||||
by Tom Igoe
|
||||
|
||||
modified 14 Mar 2016
|
||||
by Arturo Guadalupi
|
||||
|
||||
|
@ -7,21 +7,19 @@
|
||||
Then it waits for a byte in the serial port, and
|
||||
sends three sensor values whenever it gets a byte in.
|
||||
|
||||
Thanks to Greg Shakar and Scott Fitzgerald for the improvements
|
||||
|
||||
The circuit:
|
||||
The circuit:
|
||||
- potentiometers attached to analog inputs 0 and 1
|
||||
- pushbutton attached to digital I/O 2
|
||||
|
||||
Created 26 Sept. 2005
|
||||
created 26 Sep 2005
|
||||
by Tom Igoe
|
||||
modified 24 April 2012
|
||||
modified 24 Apr 2012
|
||||
by Tom Igoe and Scott Fitzgerald
|
||||
Thanks to Greg Shakar and Scott Fitzgerald for the improvements
|
||||
|
||||
This example code is in the public domain.
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/SerialCallResponse
|
||||
|
||||
*/
|
||||
|
||||
int firstSensor = 0; // first analog sensor
|
||||
|
@ -9,23 +9,19 @@
|
||||
truncated by a linefeed and carriage return,
|
||||
whenever it gets a byte in.
|
||||
|
||||
Thanks to Greg Shakar and Scott Fitzgerald for the improvements
|
||||
|
||||
The circuit:
|
||||
The circuit:
|
||||
- potentiometers attached to analog inputs 0 and 1
|
||||
- pushbutton attached to digital I/O 2
|
||||
|
||||
|
||||
|
||||
Created 26 Sept. 2005
|
||||
created 26 Sep 2005
|
||||
by Tom Igoe
|
||||
modified 24 Apr 2012
|
||||
by Tom Igoe and Scott Fitzgerald
|
||||
Thanks to Greg Shakar and Scott Fitzgerald for the improvements
|
||||
|
||||
This example code is in the public domain.
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/SerialCallResponseASCII
|
||||
|
||||
*/
|
||||
|
||||
int firstSensor = 0; // first analog sensor
|
||||
|
@ -11,13 +11,12 @@
|
||||
NOTE: The serialEvent() feature is not available on the
|
||||
Leonardo, Micro, or other ATmega32U4 based boards.
|
||||
|
||||
Created 9 May 2011
|
||||
created 9 May 2011
|
||||
by Tom Igoe
|
||||
|
||||
This example code is in the public domain.
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/SerialEvent
|
||||
|
||||
*/
|
||||
|
||||
String inputString = ""; // a String to hold incoming data
|
||||
|
@ -19,8 +19,8 @@
|
||||
but you can change these names to connect any two serial ports on a board
|
||||
that has multiple ports.
|
||||
|
||||
Created 23 May 2016
|
||||
by Erik Nyquist
|
||||
created 23 May 2016
|
||||
by Erik Nyquist
|
||||
*/
|
||||
|
||||
void setup() {
|
||||
|
@ -6,14 +6,14 @@
|
||||
The circuit:
|
||||
- potentiometers attached to analog inputs 0, 1, and 2
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/VirtualColorMixer
|
||||
|
||||
created 2 Dec 2006
|
||||
by David A. Mellis
|
||||
modified 30 Aug 2011
|
||||
by Tom Igoe and Scott Fitzgerald
|
||||
|
||||
This example code is in the public domain.
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/VirtualColorMixer
|
||||
*/
|
||||
|
||||
const int redPin = A0; // sensor to control red color
|
||||
@ -34,7 +34,7 @@ void loop() {
|
||||
|
||||
/* Processing code for this example
|
||||
|
||||
// This example code is in the public domain.
|
||||
// This example code is in the public domain.
|
||||
|
||||
import processing.serial.*;
|
||||
|
||||
|
@ -7,9 +7,9 @@
|
||||
regardless of the level.
|
||||
|
||||
The circuit:
|
||||
- potentiometer connected to analog pin 0.
|
||||
Center pin of the potentiometer goes to the analog pin.
|
||||
side pins of the potentiometer go to +5V and ground
|
||||
- potentiometer
|
||||
Center pin of the potentiometer goes to analog pin 0.
|
||||
Side pins of the potentiometer go to +5V and ground.
|
||||
- LED connected from digital pin 13 to ground
|
||||
|
||||
- Note: On most Arduino boards, there is already an LED on the board
|
||||
@ -22,7 +22,6 @@
|
||||
This example code is in the public domain.
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/IfStatement
|
||||
|
||||
*/
|
||||
|
||||
// These constants won't change:
|
||||
|
@ -11,10 +11,10 @@
|
||||
|
||||
The circuit:
|
||||
- photoresistor connected from +5V to analog in pin 0
|
||||
- 10K resistor connected from ground to analog in pin 0
|
||||
- 10 kilohm resistor connected from ground to analog in pin 0
|
||||
- LED connected from digital pin 9 to ground through 220 ohm resistor
|
||||
- pushbutton attached from pin 2 to +5V
|
||||
- 10K resistor attached from pin 2 to ground
|
||||
- 10 kilohm resistor attached from pin 2 to ground
|
||||
|
||||
created 17 Jan 2009
|
||||
modified 30 Aug 2011
|
||||
@ -25,7 +25,6 @@
|
||||
This example code is in the public domain.
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/WhileLoop
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
Switch statement with serial input
|
||||
Switch statement with serial input
|
||||
|
||||
Demonstrates the use of a switch statement. The switch
|
||||
statement allows you to choose from among a set of discrete values
|
||||
@ -10,7 +10,7 @@
|
||||
the LEDs off.
|
||||
|
||||
The circuit:
|
||||
- 5 LEDs attached to digital pins 2 through 6 through 220-ohm resistors
|
||||
- five LEDs attached to digital pins 2 through 6 through 220 ohm resistors
|
||||
|
||||
created 1 Jul 2009
|
||||
by Tom Igoe
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
/*
|
||||
ADXL3xx
|
||||
|
||||
@ -7,15 +6,13 @@
|
||||
compatible with the breakout boards from SparkFun, available from:
|
||||
http://www.sparkfun.com/commerce/categories.php?c=80
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/ADXL3xx
|
||||
|
||||
The circuit:
|
||||
analog 0: accelerometer self test
|
||||
analog 1: z-axis
|
||||
analog 2: y-axis
|
||||
analog 3: x-axis
|
||||
analog 4: ground
|
||||
analog 5: vcc
|
||||
- analog 0: accelerometer self test
|
||||
- analog 1: z-axis
|
||||
- analog 2: y-axis
|
||||
- analog 3: x-axis
|
||||
- analog 4: ground
|
||||
- analog 5: vcc
|
||||
|
||||
created 2 Jul 2008
|
||||
by David A. Mellis
|
||||
@ -24,6 +21,7 @@
|
||||
|
||||
This example code is in the public domain.
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/ADXL3xx
|
||||
*/
|
||||
|
||||
// these constants describe the pins. They won't change:
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* Knock Sensor
|
||||
/*
|
||||
Knock Sensor
|
||||
|
||||
This sketch reads a piezo element to detect a knocking sound.
|
||||
It reads an analog pin and compares the result to a set threshold.
|
||||
@ -6,11 +7,9 @@
|
||||
"knock" to the serial port, and toggles the LED on pin 13.
|
||||
|
||||
The circuit:
|
||||
- + connection of the piezo attached to analog in 0
|
||||
- - connection of the piezo attached to ground
|
||||
- 1-megohm resistor attached from analog in 0 to ground
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/Knock
|
||||
- positive connection of the piezo attached to analog in 0
|
||||
- negative connection of the piezo attached to ground
|
||||
- 1 megohm resistor attached from analog in 0 to ground
|
||||
|
||||
created 25 Mar 2007
|
||||
by David Cuartielles <http://www.0j0.org>
|
||||
@ -19,6 +18,7 @@
|
||||
|
||||
This example code is in the public domain.
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/Knock
|
||||
*/
|
||||
|
||||
|
||||
|
@ -7,12 +7,10 @@
|
||||
computer.
|
||||
|
||||
The circuit:
|
||||
- X output of accelerometer to digital pin 2
|
||||
- Y output of accelerometer to digital pin 3
|
||||
- +V of accelerometer to +5V
|
||||
- GND of accelerometer to ground
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/Memsic2125
|
||||
- X output of accelerometer to digital pin 2
|
||||
- Y output of accelerometer to digital pin 3
|
||||
- +V of accelerometer to +5V
|
||||
- GND of accelerometer to ground
|
||||
|
||||
created 6 Nov 2008
|
||||
by David A. Mellis
|
||||
@ -21,6 +19,7 @@
|
||||
|
||||
This example code is in the public domain.
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/Memsic2125
|
||||
*/
|
||||
|
||||
// these constants won't change:
|
||||
|
@ -1,4 +1,5 @@
|
||||
/* Ping))) Sensor
|
||||
/*
|
||||
Ping))) Sensor
|
||||
|
||||
This sketch reads a PING))) ultrasonic rangefinder and returns the
|
||||
distance to the closest object in range. To do this, it sends a pulse
|
||||
@ -7,11 +8,9 @@
|
||||
the distance of the object from the sensor.
|
||||
|
||||
The circuit:
|
||||
- +V connection of the PING))) attached to +5V
|
||||
- GND connection of the PING))) attached to ground
|
||||
- SIG connection of the PING))) attached to digital pin 7
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/Ping
|
||||
- +V connection of the PING))) attached to +5V
|
||||
- GND connection of the PING))) attached to ground
|
||||
- SIG connection of the PING))) attached to digital pin 7
|
||||
|
||||
created 3 Nov 2008
|
||||
by David A. Mellis
|
||||
@ -20,6 +19,7 @@
|
||||
|
||||
This example code is in the public domain.
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/Ping
|
||||
*/
|
||||
|
||||
// this constant won't change. It's the pin number
|
||||
|
@ -1,18 +1,14 @@
|
||||
/*
|
||||
Row-Column Scanning an 8x8 LED matrix with X-Y input
|
||||
|
||||
This example controls an 8x8 LED matrix using two analog inputs
|
||||
|
||||
created 27 May 2009
|
||||
modified 30 Aug 2011
|
||||
by Tom Igoe
|
||||
This example controls an 8x8 LED matrix using two analog inputs.
|
||||
|
||||
This example works for the Lumex LDM-24488NI Matrix. See
|
||||
http://sigma.octopart.com/140413/datasheet/Lumex-LDM-24488NI.pdf
|
||||
for the pin connections
|
||||
for the pin connections.
|
||||
|
||||
For other LED cathode column matrixes, you should only need to change
|
||||
the pin numbers in the row[] and column[] arrays
|
||||
the pin numbers in the row[] and column[] arrays.
|
||||
|
||||
rows are the anodes
|
||||
cols are the cathodes
|
||||
@ -20,20 +16,23 @@
|
||||
|
||||
Pin numbers:
|
||||
Matrix:
|
||||
- Digital pins 2 through 13,
|
||||
- digital pins 2 through 13,
|
||||
- analog pins 2 through 5 used as digital 16 through 19
|
||||
Potentiometers:
|
||||
- center pins are attached to analog pins 0 and 1, respectively
|
||||
- side pins attached to +5V and ground, respectively.
|
||||
- side pins attached to +5V and ground, respectively
|
||||
|
||||
created 27 May 2009
|
||||
modified 30 Aug 2011
|
||||
by Tom Igoe
|
||||
|
||||
This example code is in the public domain.
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/RowColumnScanning
|
||||
|
||||
see also http://www.tigoe.net/pcomp/code/category/arduinowiring/514 for more
|
||||
see also http://www.tigoe.net/pcomp/code/category/arduinowiring for more
|
||||
*/
|
||||
|
||||
|
||||
// 2-dimensional array of row pin numbers:
|
||||
const int row[8] = {
|
||||
2, 7, 19, 5, 13, 18, 12, 16
|
||||
|
@ -10,7 +10,7 @@
|
||||
depends on an analog input.
|
||||
|
||||
The circuit:
|
||||
- LEDs from pins 2 through 11 to ground
|
||||
- LEDs from pins 2 through 11 to ground
|
||||
|
||||
created 4 Sep 2010
|
||||
by Tom Igoe
|
||||
@ -20,7 +20,6 @@
|
||||
http://www.arduino.cc/en/Tutorial/BarGraph
|
||||
*/
|
||||
|
||||
|
||||
// these constants won't change:
|
||||
const int analogPin = A0; // the pin that the potentiometer is attached to
|
||||
const int ledCount = 10; // the number of LEDs in the bar graph
|
||||
|
@ -9,6 +9,8 @@
|
||||
by Tom Igoe
|
||||
|
||||
This example code is in the public domain.
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/CharacterAnalysis
|
||||
*/
|
||||
|
||||
void setup() {
|
||||
|
@ -4,13 +4,13 @@
|
||||
Examples of how to add Strings together
|
||||
You can also add several different data types to String, as shown here:
|
||||
|
||||
created 27 July 2010
|
||||
created 27 Jul 2010
|
||||
modified 2 Apr 2012
|
||||
by Tom Igoe
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/StringAdditionOperator
|
||||
|
||||
This example code is in the public domain.
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/StringAdditionOperator
|
||||
*/
|
||||
|
||||
// declare three Strings:
|
||||
|
@ -3,13 +3,13 @@
|
||||
|
||||
Examples of how to append different data types to Strings
|
||||
|
||||
created 27 July 2010
|
||||
created 27 Jul 2010
|
||||
modified 2 Apr 2012
|
||||
by Tom Igoe
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/StringAppendOperator
|
||||
|
||||
This example code is in the public domain.
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/StringAppendOperator
|
||||
*/
|
||||
|
||||
String stringOne, stringTwo;
|
||||
|
@ -3,13 +3,13 @@
|
||||
|
||||
Examples of how to change the case of a String
|
||||
|
||||
created 27 July 2010
|
||||
created 27 Jul 2010
|
||||
modified 2 Apr 2012
|
||||
by Tom Igoe
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/StringCaseChanges
|
||||
|
||||
This example code is in the public domain.
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/StringCaseChanges
|
||||
*/
|
||||
|
||||
void setup() {
|
||||
|
@ -3,13 +3,13 @@
|
||||
|
||||
Examples of how to get and set characters of a String
|
||||
|
||||
created 27 July 2010
|
||||
created 27 Jul 2010
|
||||
modified 2 Apr 2012
|
||||
by Tom Igoe
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/StringCharacters
|
||||
|
||||
This example code is in the public domain.
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/StringCharacters
|
||||
*/
|
||||
|
||||
void setup() {
|
||||
|
@ -3,13 +3,13 @@
|
||||
|
||||
Examples of how to compare Strings using the comparison operators
|
||||
|
||||
created 27 July 2010
|
||||
created 27 Jul 2010
|
||||
modified 2 Apr 2012
|
||||
by Tom Igoe
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/StringComparisonOperators
|
||||
|
||||
This example code is in the public domain.
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/StringComparisonOperators
|
||||
*/
|
||||
|
||||
String stringOne, stringTwo;
|
||||
|
@ -3,13 +3,13 @@
|
||||
|
||||
Examples of how to create Strings from other data types
|
||||
|
||||
created 27 July 2010
|
||||
created 27 Jul 2010
|
||||
modified 30 Aug 2011
|
||||
by Tom Igoe
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/StringConstructors
|
||||
|
||||
This example code is in the public domain.
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/StringConstructors
|
||||
*/
|
||||
|
||||
void setup() {
|
||||
|
@ -3,13 +3,13 @@
|
||||
|
||||
Examples of how to evaluate, look for, and replace characters in a String
|
||||
|
||||
created 27 July 2010
|
||||
created 27 Jul 2010
|
||||
modified 2 Apr 2012
|
||||
by Tom Igoe
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/StringIndexOf
|
||||
|
||||
This example code is in the public domain.
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/StringIndexOf
|
||||
*/
|
||||
|
||||
void setup() {
|
||||
|
@ -7,9 +7,9 @@
|
||||
created 1 Aug 2010
|
||||
by Tom Igoe
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/StringLengthTrim
|
||||
|
||||
This example code is in the public domain.
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/StringLengthTrim
|
||||
*/
|
||||
|
||||
String txtMsg = ""; // a string for incoming text
|
||||
|
@ -3,13 +3,13 @@
|
||||
|
||||
Examples of how to use length() and trim() in a String
|
||||
|
||||
created 27 July 2010
|
||||
created 27 Jul 2010
|
||||
modified 2 Apr 2012
|
||||
by Tom Igoe
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/StringLengthTrim
|
||||
|
||||
This example code is in the public domain.
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/StringLengthTrim
|
||||
*/
|
||||
|
||||
void setup() {
|
||||
|
@ -3,13 +3,13 @@
|
||||
|
||||
Examples of how to replace characters or substrings of a String
|
||||
|
||||
created 27 July 2010
|
||||
created 27 Jul 2010
|
||||
modified 2 Apr 2012
|
||||
by Tom Igoe
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/StringReplace
|
||||
|
||||
This example code is in the public domain.
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/StringReplace
|
||||
*/
|
||||
|
||||
void setup() {
|
||||
|
@ -3,13 +3,13 @@
|
||||
|
||||
Examples of how to use startsWith() and endsWith() in a String
|
||||
|
||||
created 27 July 2010
|
||||
created 27 Jul 2010
|
||||
modified 2 Apr 2012
|
||||
by Tom Igoe
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/StringStartsWithEndsWith
|
||||
|
||||
This example code is in the public domain.
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/StringStartsWithEndsWith
|
||||
*/
|
||||
|
||||
void setup() {
|
||||
|
@ -3,13 +3,13 @@
|
||||
|
||||
Examples of how to use substring in a String
|
||||
|
||||
created 27 July 2010,
|
||||
created 27 Jul 2010,
|
||||
modified 2 Apr 2012
|
||||
by Zach Eveland
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/StringSubstring
|
||||
|
||||
This example code is in the public domain.
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/StringSubstring
|
||||
*/
|
||||
|
||||
void setup() {
|
||||
|
@ -5,12 +5,14 @@
|
||||
the string to a number if the characters are digits.
|
||||
|
||||
The circuit:
|
||||
No external components needed.
|
||||
- No external components needed.
|
||||
|
||||
created 29 Nov 2010
|
||||
by Tom Igoe
|
||||
|
||||
This example code is in the public domain.
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/StringToInt
|
||||
*/
|
||||
|
||||
String inString = ""; // string to hold input
|
||||
|
@ -14,13 +14,13 @@
|
||||
|
||||
Circuit:
|
||||
- Arduino Leonardo or Micro
|
||||
- wire to connect D2 to ground.
|
||||
- wire to connect D2 to ground
|
||||
|
||||
created 6 Mar 2012
|
||||
modified 27 Mar 2012
|
||||
by Tom Igoe
|
||||
|
||||
This example is in the public domain
|
||||
This example is in the public domain.
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/KeyboardLogout
|
||||
*/
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
The circuit:
|
||||
- pushbutton attached from pin 4 to +5V
|
||||
- 10-kilohm resistor attached from pin 4 to ground
|
||||
- 10 kilohm resistor attached from pin 4 to ground
|
||||
|
||||
created 24 Oct 2011
|
||||
modified 27 Mar 2012
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
Circuit:
|
||||
- Arduino Leonardo, Micro, Due, LilyPad USB, or Yún
|
||||
- wire to connect D2 to ground.
|
||||
- wire to connect D2 to ground
|
||||
|
||||
created 5 Mar 2012
|
||||
modified 29 Mar 2012
|
||||
@ -22,7 +22,7 @@
|
||||
modified 3 May 2014
|
||||
by Scott Fitzgerald
|
||||
|
||||
This example is in the public domain
|
||||
This example is in the public domain.
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/KeyboardReprogram
|
||||
*/
|
||||
|
@ -1,11 +1,10 @@
|
||||
|
||||
/*
|
||||
KeyboardAndMouseControl
|
||||
|
||||
Controls the mouse from five pushbuttons on an Arduino Leonardo, Micro or Due.
|
||||
|
||||
Hardware:
|
||||
- 5 pushbuttons attached to D2, D3, D4, D5, D6
|
||||
- five pushbuttons attached to D2, D3, D4, D5, D6
|
||||
|
||||
The mouse movement is always relative. This sketch reads
|
||||
four pushbuttons, and uses them to set the movement of the mouse.
|
||||
@ -17,8 +16,9 @@
|
||||
modified 27 Mar 2012
|
||||
by Tom Igoe
|
||||
|
||||
this code is in the public domain
|
||||
This example code is in the public domain.
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/KeyboardAndMouseControl
|
||||
*/
|
||||
|
||||
#include "Keyboard.h"
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
/*
|
||||
ButtonMouseControl
|
||||
|
||||
@ -7,8 +6,7 @@
|
||||
Controls the mouse from five pushbuttons on an Arduino Leonardo, Micro or Due.
|
||||
|
||||
Hardware:
|
||||
- 5 pushbuttons attached to D2, D3, D4, D5, D6
|
||||
|
||||
- five pushbuttons attached to D2, D3, D4, D5, D6
|
||||
|
||||
The mouse movement is always relative. This sketch reads
|
||||
four pushbuttons, and uses them to set the movement of the mouse.
|
||||
@ -20,8 +18,9 @@
|
||||
modified 27 Mar 2012
|
||||
by Tom Igoe
|
||||
|
||||
this code is in the public domain
|
||||
This example code is in the public domain.
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/ButtonMouseControl
|
||||
*/
|
||||
|
||||
#include "Mouse.h"
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
Controls the mouse from a joystick on an Arduino Leonardo, Micro or Due.
|
||||
Uses a pushbutton to turn on and off mouse control, and
|
||||
a second pushbutton to click the left mouse button
|
||||
a second pushbutton to click the left mouse button.
|
||||
|
||||
Hardware:
|
||||
- 2-axis joystick connected to pins A0 and A1
|
||||
@ -20,12 +20,13 @@
|
||||
This sketch includes a pushbutton to toggle the mouse control state, so
|
||||
you can turn on and off mouse control.
|
||||
|
||||
created 15 Sept 2011
|
||||
created 15 Sep 2011
|
||||
updated 28 Mar 2012
|
||||
by Tom Igoe
|
||||
|
||||
this code is in the public domain
|
||||
This example code is in the public domain.
|
||||
|
||||
http://www.arduino.cc/en/Tutorial/JoystickMouseControl
|
||||
*/
|
||||
|
||||
#include "Mouse.h"
|
||||
|
@ -6,18 +6,18 @@
|
||||
Arduino Starter Kit
|
||||
|
||||
Parts required:
|
||||
1 green LED
|
||||
2 red LEDs
|
||||
pushbutton
|
||||
10 kilohm resistor
|
||||
3 220 ohm resistors
|
||||
- one green LED
|
||||
- two red LEDs
|
||||
- pushbutton
|
||||
- 10 kilohm resistor
|
||||
- three 220 ohm resistors
|
||||
|
||||
Created 13 September 2012
|
||||
created 13 Sep 2012
|
||||
by Scott Fitzgerald
|
||||
|
||||
http://www.arduino.cc/starterKit
|
||||
|
||||
This example code is part of the public domain
|
||||
This example code is part of the public domain.
|
||||
*/
|
||||
|
||||
// Create a global variable to hold the
|
||||
|
@ -6,16 +6,16 @@
|
||||
Arduino Starter Kit
|
||||
|
||||
Parts required:
|
||||
1 TMP36 temperature sensor
|
||||
3 red LEDs
|
||||
3 220 ohm resistors
|
||||
- one TMP36 temperature sensor
|
||||
- three red LEDs
|
||||
- three 220 ohm resistors
|
||||
|
||||
Created 13 September 2012
|
||||
created 13 Sep 2012
|
||||
by Scott Fitzgerald
|
||||
|
||||
http://www.arduino.cc/starterKit
|
||||
|
||||
This example code is part of the public domain
|
||||
This example code is part of the public domain.
|
||||
*/
|
||||
|
||||
// named constant for the pin the sensor is connected to
|
||||
|
@ -6,20 +6,20 @@
|
||||
Arduino Starter Kit
|
||||
|
||||
Parts required:
|
||||
1 RGB LED
|
||||
three 10 kilohm resistors
|
||||
3 220 ohm resistors
|
||||
3 photoresistors
|
||||
red green and blue colored gels
|
||||
- one RGB LED
|
||||
- three 10 kilohm resistors
|
||||
- three 220 ohm resistors
|
||||
- three photoresistors
|
||||
- red green and blue colored gels
|
||||
|
||||
Created 13 September 2012
|
||||
Modified 14 November 2012
|
||||
created 13 Sep 2012
|
||||
modified 14 Nov 2012
|
||||
by Scott Fitzgerald
|
||||
Thanks to Federico Vanzati for improvements
|
||||
|
||||
http://www.arduino.cc/starterKit
|
||||
|
||||
This example code is part of the public domain
|
||||
This example code is part of the public domain.
|
||||
*/
|
||||
|
||||
const int greenLEDPin = 9; // LED connected to digital pin 9
|
||||
|
@ -6,16 +6,16 @@
|
||||
Arduino Starter Kit
|
||||
|
||||
Parts required:
|
||||
servo motor
|
||||
10 kilohm potentiometer
|
||||
2 100 uF electrolytic capacitors
|
||||
- servo motor
|
||||
- 10 kilohm potentiometer
|
||||
- two 100 uF electrolytic capacitors
|
||||
|
||||
Created 13 September 2012
|
||||
created 13 Sep 2012
|
||||
by Scott Fitzgerald
|
||||
|
||||
http://www.arduino.cc/starterKit
|
||||
|
||||
This example code is part of the public domain
|
||||
This example code is part of the public domain.
|
||||
*/
|
||||
|
||||
// include the Servo library
|
||||
|
@ -6,16 +6,16 @@
|
||||
Arduino Starter Kit
|
||||
|
||||
Parts required:
|
||||
photoresistor
|
||||
10 kilohm resistor
|
||||
piezo
|
||||
- photoresistor
|
||||
- 10 kilohm resistor
|
||||
- piezo
|
||||
|
||||
Created 13 September 2012
|
||||
created 13 Sep 2012
|
||||
by Scott Fitzgerald
|
||||
|
||||
http://www.arduino.cc/starterKit
|
||||
|
||||
This example code is part of the public domain
|
||||
This example code is part of the public domain.
|
||||
*/
|
||||
|
||||
// variable to hold sensor value
|
||||
|
@ -6,18 +6,18 @@
|
||||
Arduino Starter Kit
|
||||
|
||||
Parts required:
|
||||
two 10 kilohm resistors
|
||||
1 Megohm resistor
|
||||
220 ohm resistor
|
||||
4 pushbuttons
|
||||
piezo
|
||||
- two 10 kilohm resistors
|
||||
- 1 megohm resistor
|
||||
- 220 ohm resistor
|
||||
- four pushbuttons
|
||||
- piezo
|
||||
|
||||
Created 13 September 2012
|
||||
created 13 Sep 2012
|
||||
by Scott Fitzgerald
|
||||
|
||||
http://www.arduino.cc/starterKit
|
||||
|
||||
This example code is part of the public domain
|
||||
This example code is part of the public domain.
|
||||
*/
|
||||
|
||||
// create an array of notes
|
||||
|
@ -6,17 +6,17 @@
|
||||
Arduino Starter Kit
|
||||
|
||||
Parts required:
|
||||
10 kilohm resistor
|
||||
six 220 ohm resistors
|
||||
six LEDs
|
||||
tilt switch
|
||||
- 10 kilohm resistor
|
||||
- six 220 ohm resistors
|
||||
- six LEDs
|
||||
- tilt switch
|
||||
|
||||
Created 13 September 2012
|
||||
created 13 Sep 2012
|
||||
by Scott Fitzgerald
|
||||
|
||||
http://www.arduino.cc/starterKit
|
||||
|
||||
This example code is part of the public domain
|
||||
This example code is part of the public domain.
|
||||
*/
|
||||
|
||||
// named constant for the switch pin
|
||||
|
@ -6,19 +6,19 @@
|
||||
Arduino Starter Kit
|
||||
|
||||
Parts required:
|
||||
10 kilohm resistor
|
||||
pushbutton
|
||||
motor
|
||||
9V battery
|
||||
IRF520 MOSFET
|
||||
1N4007 diode
|
||||
- 10 kilohm resistor
|
||||
- pushbutton
|
||||
- motor
|
||||
- 9V battery
|
||||
- IRF520 MOSFET
|
||||
- 1N4007 diode
|
||||
|
||||
Created 13 September 2012
|
||||
created 13 Sep 2012
|
||||
by Scott Fitzgerald
|
||||
|
||||
http://www.arduino.cc/starterKit
|
||||
|
||||
This example code is part of the public domain
|
||||
This example code is part of the public domain.
|
||||
*/
|
||||
|
||||
// named constants for the switch and motor pins
|
||||
|
@ -6,20 +6,20 @@
|
||||
Arduino Starter Kit
|
||||
|
||||
Parts required:
|
||||
two 10 kilohm resistors
|
||||
2 momentary pushbuttons
|
||||
one 10 kilohm potentiometer
|
||||
motor
|
||||
9V battery
|
||||
H-Bridge
|
||||
- two 10 kilohm resistors
|
||||
- two momentary pushbuttons
|
||||
- one 10 kilohm potentiometer
|
||||
- motor
|
||||
- 9V battery
|
||||
- H-Bridge
|
||||
|
||||
Created 13 September 2012
|
||||
created 13 Sep 2012
|
||||
by Scott Fitzgerald
|
||||
Thanks to Federico Vanzati for improvements
|
||||
|
||||
http://www.arduino.cc/starterKit
|
||||
|
||||
This example code is part of the public domain
|
||||
This example code is part of the public domain.
|
||||
*/
|
||||
|
||||
const int controlPin1 = 2; // connected to pin 7 on the H-bridge
|
||||
|
@ -6,19 +6,18 @@
|
||||
Arduino Starter Kit
|
||||
|
||||
Parts required:
|
||||
220 ohm resistor
|
||||
10 kilohm resistor
|
||||
10 kilohm potentiometer
|
||||
16x2 LCD screen
|
||||
tilt switch
|
||||
- 220 ohm resistor
|
||||
- 10 kilohm resistor
|
||||
- 10 kilohm potentiometer
|
||||
- 16x2 LCD screen
|
||||
- tilt switch
|
||||
|
||||
|
||||
Created 13 September 2012
|
||||
created 13 Sep 2012
|
||||
by Scott Fitzgerald
|
||||
|
||||
http://www.arduino.cc/starterKit
|
||||
|
||||
This example code is part of the public domain
|
||||
This example code is part of the public domain.
|
||||
*/
|
||||
|
||||
// include the library code:
|
||||
|
@ -6,24 +6,24 @@
|
||||
Arduino Starter Kit
|
||||
|
||||
Parts required:
|
||||
1 Megohm resistor
|
||||
10 kilohm resistor
|
||||
three 220 ohm resistors
|
||||
piezo
|
||||
servo motor
|
||||
push button
|
||||
one red LED
|
||||
one yellow LED
|
||||
one green LED
|
||||
100 uF capacitor
|
||||
- 1 megohm resistor
|
||||
- 10 kilohm resistor
|
||||
- three 220 ohm resistors
|
||||
- piezo
|
||||
- servo motor
|
||||
- push button
|
||||
- one red LED
|
||||
- one yellow LED
|
||||
- one green LED
|
||||
- 100 uF capacitor
|
||||
|
||||
Created 18 September 2012
|
||||
created 18 Sep 2012
|
||||
by Scott Fitzgerald
|
||||
Thanks to Federico Vanzati for improvements
|
||||
|
||||
http://www.arduino.cc/starterKit
|
||||
|
||||
This example code is part of the public domain
|
||||
This example code is part of the public domain.
|
||||
*/
|
||||
|
||||
// import the library
|
||||
|
@ -6,21 +6,21 @@
|
||||
Arduino Starter Kit
|
||||
|
||||
Parts required:
|
||||
1 Megohm resistor
|
||||
metal foil or copper mesh
|
||||
220 ohm resistor
|
||||
LED
|
||||
- 1 megohm resistor
|
||||
- metal foil or copper mesh
|
||||
- 220 ohm resistor
|
||||
- LED
|
||||
|
||||
Software required :
|
||||
CapacitiveSensor library by Paul Badger
|
||||
http://www.arduino.cc/playground/Main/CapacitiveSensor
|
||||
- CapacitiveSensor library by Paul Badger
|
||||
http://www.arduino.cc/playground/Main/CapacitiveSensor
|
||||
|
||||
Created 18 September 2012
|
||||
created 18 Sep 2012
|
||||
by Scott Fitzgerald
|
||||
|
||||
http://www.arduino.cc/starterKit
|
||||
|
||||
This example code is part of the public domain
|
||||
This example code is part of the public domain.
|
||||
*/
|
||||
|
||||
// import the library (must be located in the
|
||||
|
@ -6,18 +6,18 @@
|
||||
Arduino Starter Kit
|
||||
|
||||
Parts required:
|
||||
10 kilohm potentiometer
|
||||
- 10 kilohm potentiometer
|
||||
|
||||
Software required :
|
||||
Processing (3.0 or newer) http://processing.org
|
||||
Active Internet connection
|
||||
Software required:
|
||||
- Processing (3.0 or newer) http://processing.org
|
||||
- Active Internet connection
|
||||
|
||||
Created 18 September 2012
|
||||
created 18 Sep 2012
|
||||
by Scott Fitzgerald
|
||||
|
||||
http://www.arduino.cc/starterKit
|
||||
|
||||
This example code is part of the public domain
|
||||
This example code is part of the public domain.
|
||||
*/
|
||||
|
||||
|
||||
@ -36,7 +36,7 @@ void loop() {
|
||||
/* Processing code for this example
|
||||
// Tweak the Arduino Logo
|
||||
// by Scott Fitzgerald
|
||||
// This example code is in the public domain
|
||||
// This example code is in the public domain.
|
||||
|
||||
// import the serial library
|
||||
import processing.serial.*;
|
||||
|
@ -6,16 +6,16 @@
|
||||
Arduino Starter Kit
|
||||
|
||||
Parts required:
|
||||
battery powered component
|
||||
220 ohm resistor
|
||||
4N35 optocoupler
|
||||
- battery powered component
|
||||
- 220 ohm resistor
|
||||
- 4N35 optocoupler
|
||||
|
||||
Created 18 September 2012
|
||||
created 18 Sep 2012
|
||||
by Scott Fitzgerald
|
||||
|
||||
http://www.arduino.cc/starterKit
|
||||
|
||||
This example code is part of the public domain
|
||||
This example code is part of the public domain.
|
||||
*/
|
||||
|
||||
const int optoPin = 2; // the pin the optocoupler is connected to
|
||||
|
@ -1,7 +1,7 @@
|
||||
// ArduinoISP
|
||||
// Copyright (c) 2008-2011 Randall Bohn
|
||||
// If you require a license, see
|
||||
// http://www.opensource.org/licenses/bsd-license.php
|
||||
// http://www.opensource.org/licenses/bsd-license.php
|
||||
//
|
||||
// This sketch turns the Arduino into a AVRISP
|
||||
// using the following Arduino pins:
|
||||
|
Loading…
x
Reference in New Issue
Block a user