Skip to content

Commit b5df836

Browse files
committed
Autoformat
Requested by a customer to autoformat
1 parent e8a7e94 commit b5df836

File tree

15 files changed

+395
-394
lines changed

15 files changed

+395
-394
lines changed
Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
11
/*
2-
SparkFun Inventor’s Kit
3-
Circuit 1A-Blink
2+
SparkFun Inventor’s Kit
3+
Circuit 1A-Blink
44
5-
Turns an LED connected to pin 13 on and off. Repeats forever.
5+
Turns an LED connected to pin 13 on and off. Repeats forever.
66
7-
This sketch was written by SparkFun Electronics, with lots of help from the Arduino community.
8-
This code is completely free for any use.
7+
This sketch was written by SparkFun Electronics, with lots of help from the Arduino community.
8+
This code is completely free for any use.
99
10-
View circuit diagram and instructions at: https://learn.sparkfun.com/tutorials/sparkfun-inventors-kit-experiment-guide---v40
11-
Download code at: https://github.com/sparkfun/SIK-Guide-Code
10+
View circuit diagram and instructions at: https://learn.sparkfun.com/tutorials/sparkfun-inventors-kit-experiment-guide---v40
11+
Download code at: https://github.com/sparkfun/SIK-Guide-Code
1212
*/
1313

1414
void setup() {
15-
15+
1616
pinMode(13, OUTPUT); // Set pin 13 to output
17-
17+
1818
}
1919

2020

2121
void loop() {
22-
22+
2323
digitalWrite(13, HIGH); // Turn on the LED
24-
24+
2525
delay(2000); // Wait for two seconds
2626

2727
digitalWrite(13, LOW); // Turn off the LED
28-
28+
2929
delay(2000); // Wait for two seconds
30-
30+
3131
}
3232

SIK_Circuit_1B-Potentiometer/SIK_Circuit_1B-Potentiometer.ino

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
/*
2-
SparkFun Inventor’s Kit
3-
Circuit 1B-Potentiometer
2+
SparkFun Inventor’s Kit
3+
Circuit 1B-Potentiometer
44
5-
Changes how fast an LED connected to pin 13 blinks, based on a potentiometer connected to pin A0
5+
Changes how fast an LED connected to pin 13 blinks, based on a potentiometer connected to pin A0
66
7-
This sketch was written by SparkFun Electronics, with lots of help from the Arduino community.
8-
This code is completely free for any use.
7+
This sketch was written by SparkFun Electronics, with lots of help from the Arduino community.
8+
This code is completely free for any use.
99
10-
View circuit diagram and instructions at: https://learn.sparkfun.com/tutorials/sparkfun-inventors-kit-experiment-guide---v40
11-
Download code at: https://github.com/sparkfun/SIK-Guide-Code
10+
View circuit diagram and instructions at: https://learn.sparkfun.com/tutorials/sparkfun-inventors-kit-experiment-guide---v40
11+
Download code at: https://github.com/sparkfun/SIK-Guide-Code
1212
*/
1313

1414
int potPosition; //this variable will hold a value based on the position of the potentiometer
1515

1616
void setup()
1717
{
1818
Serial.begin(9600); //start a serial connection with the computer
19-
19+
2020
pinMode(13, OUTPUT); //set pin 13 as an output that can be set to HIGH or LOW
2121
}
2222

SIK_Circuit_1C-Photoresistor/SIK_Circuit_1C-Photoresistor.ino

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
/*
2-
SparkFun Inventor’s Kit
3-
Circuit 1C-Photoresistor
2+
SparkFun Inventor’s Kit
3+
Circuit 1C-Photoresistor
44
5-
Use a photoresistor to monitor how bright a room is, and turn an LED on when it gets dark.
5+
Use a photoresistor to monitor how bright a room is, and turn an LED on when it gets dark.
66
7-
This sketch was written by SparkFun Electronics, with lots of help from the Arduino community.
8-
This code is completely free for any use.
7+
This sketch was written by SparkFun Electronics, with lots of help from the Arduino community.
8+
This code is completely free for any use.
99
10-
View circuit diagram and instructions at: https://learn.sparkfun.com/tutorials/sparkfun-inventors-kit-experiment-guide---v40
11-
Download drawings and code at: https://github.com/sparkfun/SIK-Guide-Code
10+
View circuit diagram and instructions at: https://learn.sparkfun.com/tutorials/sparkfun-inventors-kit-experiment-guide---v40
11+
Download drawings and code at: https://github.com/sparkfun/SIK-Guide-Code
1212
*/
1313

1414
int photoresistor = 0; //this variable will hold a value based on the brightness of the ambient light
@@ -17,7 +17,7 @@ int threshold = 750; //if the photoresistor reading is below this
1717
void setup()
1818
{
1919
Serial.begin(9600); //start a serial connection with the computer
20-
20+
2121
pinMode(13, OUTPUT); //set pin 13 as an output that can be set to HIGH or LOW
2222
}
2323

@@ -28,9 +28,9 @@ void loop()
2828
Serial.println(photoresistor); //print the value of photoresistor in the serial monitor on the computer
2929

3030
//if the photoresistor value is below the threshold turn the light on, otherwise turn it off
31-
if (photoresistor < threshold){
32-
digitalWrite(13, HIGH); // Turn on the LED
33-
} else{
31+
if (photoresistor < threshold) {
32+
digitalWrite(13, HIGH); // Turn on the LED
33+
} else {
3434
digitalWrite(13, LOW); // Turn off the LED
3535
}
3636

Lines changed: 80 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
/*
2-
SparkFun Inventor’s Kit
3-
Circuit 1D-RGB Nightlight
2+
SparkFun Inventor’s Kit
3+
Circuit 1D-RGB Nightlight
44
5-
Turns an RGB LED on or off based on the light level read by a photoresistor.
6-
Change colors by turning the potentiometer.
5+
Turns an RGB LED on or off based on the light level read by a photoresistor.
6+
Change colors by turning the potentiometer.
77
8-
This sketch was written by SparkFun Electronics, with lots of help from the Arduino community.
9-
This code is completely free for any use.
8+
This sketch was written by SparkFun Electronics, with lots of help from the Arduino community.
9+
This code is completely free for any use.
1010
11-
View circuit diagram and instructions at: https://learn.sparkfun.com/tutorials/sparkfun-inventors-kit-experiment-guide---v40
12-
Download drawings and code at: https://github.com/sparkfun/SIK-Guide-Code
13-
*/
11+
View circuit diagram and instructions at: https://learn.sparkfun.com/tutorials/sparkfun-inventors-kit-experiment-guide---v40
12+
Download drawings and code at: https://github.com/sparkfun/SIK-Guide-Code
13+
*/
1414

1515
int photoresistor = A0; //variable for storing the photoresistor value
1616
int potentiometer = A1; //this variable will hold a value based on the position of the knob
@@ -25,103 +25,103 @@ void setup() {
2525
Serial.begin(9600); //start a serial connection with the computer
2626

2727
//set the LED pins to output
28-
pinMode(RedPin,OUTPUT);
29-
pinMode(GreenPin,OUTPUT);
30-
pinMode(BluePin,OUTPUT);
28+
pinMode(RedPin, OUTPUT);
29+
pinMode(GreenPin, OUTPUT);
30+
pinMode(BluePin, OUTPUT);
3131
}
3232

3333
void loop() {
34-
34+
3535
photoresistor = analogRead(A0); //read the value of the photoresistor
3636
potentiometer = analogRead(A1);
3737

3838
Serial.print("Photoresistor value:");
3939
Serial.print(photoresistor); //print the photoresistor value to the serial monitor
4040
Serial.print(" Potentiometer value:");
4141
Serial.println(potentiometer); //print the potentiometer value to the serial monitor
42-
43-
if(photoresistor < threshold){ //if it's dark (the photoresistor value is below the threshold) turn the LED on
44-
//These nested if statements check for a variety of ranges and
42+
43+
if (photoresistor < threshold) { //if it's dark (the photoresistor value is below the threshold) turn the LED on
44+
//These nested if statements check for a variety of ranges and
4545
//call different functions based on the current potentiometer value.
46-
//Those functions are found at the bottom of the sketch.
47-
if(potentiometer > 0 && potentiometer <= 150)
46+
//Those functions are found at the bottom of the sketch.
47+
if (potentiometer > 0 && potentiometer <= 150)
4848
red();
49-
if(potentiometer > 150 && potentiometer <= 300)
49+
if (potentiometer > 150 && potentiometer <= 300)
5050
orange();
51-
if(potentiometer > 300 && potentiometer <= 450)
52-
yellow();
53-
if(potentiometer > 450 && potentiometer <= 600)
51+
if (potentiometer > 300 && potentiometer <= 450)
52+
yellow();
53+
if (potentiometer > 450 && potentiometer <= 600)
5454
green();
55-
if(potentiometer > 600 && potentiometer <= 750)
55+
if (potentiometer > 600 && potentiometer <= 750)
5656
cyan();
57-
if(potentiometer > 750 && potentiometer <= 900)
58-
blue();
59-
if(potentiometer > 900)
60-
magenta();
61-
}
57+
if (potentiometer > 750 && potentiometer <= 900)
58+
blue();
59+
if (potentiometer > 900)
60+
magenta();
61+
}
6262
else { //if it isn't dark turn the LED off
63-
63+
6464
turnOff(); //call the turn off function
65-
66-
}
67-
65+
66+
}
67+
6868
delay(100); //short delay so that the printout is easier to read
6969
}
7070

71-
void red (){
72-
73-
//set the LED pins to values that make red
74-
analogWrite(RedPin, 100);
75-
analogWrite(GreenPin, 0);
76-
analogWrite(BluePin, 0);
71+
void red () {
72+
73+
//set the LED pins to values that make red
74+
analogWrite(RedPin, 100);
75+
analogWrite(GreenPin, 0);
76+
analogWrite(BluePin, 0);
7777
}
78-
void orange (){
79-
80-
//set the LED pins to values that make orange
81-
analogWrite(RedPin, 100);
82-
analogWrite(GreenPin, 50);
83-
analogWrite(BluePin, 0);
78+
void orange () {
79+
80+
//set the LED pins to values that make orange
81+
analogWrite(RedPin, 100);
82+
analogWrite(GreenPin, 50);
83+
analogWrite(BluePin, 0);
8484
}
85-
void yellow (){
86-
87-
//set the LED pins to values that make yellow
88-
analogWrite(RedPin, 100);
89-
analogWrite(GreenPin, 100);
90-
analogWrite(BluePin, 0);
85+
void yellow () {
86+
87+
//set the LED pins to values that make yellow
88+
analogWrite(RedPin, 100);
89+
analogWrite(GreenPin, 100);
90+
analogWrite(BluePin, 0);
9191
}
92-
void green (){
93-
94-
//set the LED pins to values that make green
95-
analogWrite(RedPin, 0);
96-
analogWrite(GreenPin, 100);
97-
analogWrite(BluePin, 0);
92+
void green () {
93+
94+
//set the LED pins to values that make green
95+
analogWrite(RedPin, 0);
96+
analogWrite(GreenPin, 100);
97+
analogWrite(BluePin, 0);
9898
}
99-
void cyan (){
100-
101-
//set the LED pins to values that make cyan
102-
analogWrite(RedPin, 0);
103-
analogWrite(GreenPin, 100);
104-
analogWrite(BluePin, 100);
99+
void cyan () {
100+
101+
//set the LED pins to values that make cyan
102+
analogWrite(RedPin, 0);
103+
analogWrite(GreenPin, 100);
104+
analogWrite(BluePin, 100);
105105
}
106-
void blue (){
107-
108-
//set the LED pins to values that make blue
109-
analogWrite(RedPin, 0);
110-
analogWrite(GreenPin, 0);
111-
analogWrite(BluePin, 100);
106+
void blue () {
107+
108+
//set the LED pins to values that make blue
109+
analogWrite(RedPin, 0);
110+
analogWrite(GreenPin, 0);
111+
analogWrite(BluePin, 100);
112112
}
113-
void magenta (){
114-
115-
//set the LED pins to values that make magenta
116-
analogWrite(RedPin, 100);
117-
analogWrite(GreenPin, 0);
118-
analogWrite(BluePin, 100);
113+
void magenta () {
114+
115+
//set the LED pins to values that make magenta
116+
analogWrite(RedPin, 100);
117+
analogWrite(GreenPin, 0);
118+
analogWrite(BluePin, 100);
119119
}
120-
void turnOff (){
121-
122-
//set all three LED pins to 0 or OFF
123-
analogWrite(RedPin, 0);
124-
analogWrite(GreenPin, 0);
125-
analogWrite(BluePin, 0);
120+
void turnOff () {
121+
122+
//set all three LED pins to 0 or OFF
123+
analogWrite(RedPin, 0);
124+
analogWrite(GreenPin, 0);
125+
analogWrite(BluePin, 0);
126126
}
127127

0 commit comments

Comments
 (0)