├── .gitignore ├── BAC_01_LED ├── BAC_01_LED.fzz ├── BAC_01_LED_bb.png └── BAC_01_LED.ino ├── BAC_02_LED ├── BAC_02_LED.fzz ├── Breadboard.png ├── BAC_02_LED_bb.png ├── LEDs and Resistors.pdf └── BAC_02_LED.ino ├── BAC_07_Map ├── BAC_07_Map.fzz ├── BAC_07_Map_bb.png └── BAC_07_Map.ino ├── BAC_08_LED ├── BAC_08_LED.fzz ├── BAC_08_LED_bb.png └── BAC_08_LED.ino ├── BAC_09_LED ├── BAC_09_LED.fzz ├── BAC_09_LED_bb.png └── BAC_09_LED.ino ├── Introduction-to-Arduino.pdf ├── BAC_10_Piezo ├── BAC_11_Piezo.fzz ├── BAC_11_Piezo_bb.png └── BAC_11_Piezo.ino ├── BAC_11_Servo ├── BAC_12_Servo.fzz ├── BAC_12_Servo_bb.png └── BAC_12_Servo.ino ├── BAC_12_Relay ├── BAC_13_Relay.fzz ├── BAC_13_Relay_bb.png ├── Relay Module 1 Channel.jpg ├── Relay Module 4 Channel.jpg └── BAC_13_Relay.ino ├── BAC_03_Button ├── BAC_03_Button.fzz ├── BAC_03_Button_bb.png └── BAC_03_Button.ino ├── BAC_04_Serial ├── BAC_04_Serial.fzz ├── BAC_04_Serial_bb.png └── BAC_04_Serial.ino ├── BAC_14_MOSFET ├── BAC_15_MOSFET.fzz ├── BAC_15_MOSFET_bb.png └── BAC_15_MOSFET.ino ├── BAC_15_MOSFET ├── BAC_16_MOSFET.fzz ├── BAC_16_MOSFET_bb.png └── BAC_16_MOSFET.ino ├── BAC_13_Relay_Power ├── BAC_14_Relay_Power.fzz ├── BAC_14_Relay_Power_bb.png └── BAC_14_Relay_Power.ino ├── BAC_06_Potentiometer ├── BAC_06_Potentiometer.fzz ├── BAC_06_Potentiometer_bb.png └── BAC_06_Potentiometer.ino ├── BAC_05_Capacitive_Touch ├── BAC_05_Capacitive_Touch.fzz ├── BAC_05_Capacitive_Touch_bb.png └── BAC_05_Capacitive_Touch.ino └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | 3 | -------------------------------------------------------------------------------- /BAC_01_LED/BAC_01_LED.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raster/Beginner-Arduino-Class/master/BAC_01_LED/BAC_01_LED.fzz -------------------------------------------------------------------------------- /BAC_02_LED/BAC_02_LED.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raster/Beginner-Arduino-Class/master/BAC_02_LED/BAC_02_LED.fzz -------------------------------------------------------------------------------- /BAC_02_LED/Breadboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raster/Beginner-Arduino-Class/master/BAC_02_LED/Breadboard.png -------------------------------------------------------------------------------- /BAC_07_Map/BAC_07_Map.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raster/Beginner-Arduino-Class/master/BAC_07_Map/BAC_07_Map.fzz -------------------------------------------------------------------------------- /BAC_08_LED/BAC_08_LED.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raster/Beginner-Arduino-Class/master/BAC_08_LED/BAC_08_LED.fzz -------------------------------------------------------------------------------- /BAC_09_LED/BAC_09_LED.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raster/Beginner-Arduino-Class/master/BAC_09_LED/BAC_09_LED.fzz -------------------------------------------------------------------------------- /BAC_01_LED/BAC_01_LED_bb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raster/Beginner-Arduino-Class/master/BAC_01_LED/BAC_01_LED_bb.png -------------------------------------------------------------------------------- /BAC_02_LED/BAC_02_LED_bb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raster/Beginner-Arduino-Class/master/BAC_02_LED/BAC_02_LED_bb.png -------------------------------------------------------------------------------- /BAC_07_Map/BAC_07_Map_bb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raster/Beginner-Arduino-Class/master/BAC_07_Map/BAC_07_Map_bb.png -------------------------------------------------------------------------------- /BAC_08_LED/BAC_08_LED_bb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raster/Beginner-Arduino-Class/master/BAC_08_LED/BAC_08_LED_bb.png -------------------------------------------------------------------------------- /BAC_09_LED/BAC_09_LED_bb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raster/Beginner-Arduino-Class/master/BAC_09_LED/BAC_09_LED_bb.png -------------------------------------------------------------------------------- /Introduction-to-Arduino.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raster/Beginner-Arduino-Class/master/Introduction-to-Arduino.pdf -------------------------------------------------------------------------------- /BAC_10_Piezo/BAC_11_Piezo.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raster/Beginner-Arduino-Class/master/BAC_10_Piezo/BAC_11_Piezo.fzz -------------------------------------------------------------------------------- /BAC_11_Servo/BAC_12_Servo.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raster/Beginner-Arduino-Class/master/BAC_11_Servo/BAC_12_Servo.fzz -------------------------------------------------------------------------------- /BAC_12_Relay/BAC_13_Relay.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raster/Beginner-Arduino-Class/master/BAC_12_Relay/BAC_13_Relay.fzz -------------------------------------------------------------------------------- /BAC_02_LED/LEDs and Resistors.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raster/Beginner-Arduino-Class/master/BAC_02_LED/LEDs and Resistors.pdf -------------------------------------------------------------------------------- /BAC_03_Button/BAC_03_Button.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raster/Beginner-Arduino-Class/master/BAC_03_Button/BAC_03_Button.fzz -------------------------------------------------------------------------------- /BAC_04_Serial/BAC_04_Serial.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raster/Beginner-Arduino-Class/master/BAC_04_Serial/BAC_04_Serial.fzz -------------------------------------------------------------------------------- /BAC_10_Piezo/BAC_11_Piezo_bb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raster/Beginner-Arduino-Class/master/BAC_10_Piezo/BAC_11_Piezo_bb.png -------------------------------------------------------------------------------- /BAC_11_Servo/BAC_12_Servo_bb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raster/Beginner-Arduino-Class/master/BAC_11_Servo/BAC_12_Servo_bb.png -------------------------------------------------------------------------------- /BAC_12_Relay/BAC_13_Relay_bb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raster/Beginner-Arduino-Class/master/BAC_12_Relay/BAC_13_Relay_bb.png -------------------------------------------------------------------------------- /BAC_14_MOSFET/BAC_15_MOSFET.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raster/Beginner-Arduino-Class/master/BAC_14_MOSFET/BAC_15_MOSFET.fzz -------------------------------------------------------------------------------- /BAC_15_MOSFET/BAC_16_MOSFET.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raster/Beginner-Arduino-Class/master/BAC_15_MOSFET/BAC_16_MOSFET.fzz -------------------------------------------------------------------------------- /BAC_03_Button/BAC_03_Button_bb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raster/Beginner-Arduino-Class/master/BAC_03_Button/BAC_03_Button_bb.png -------------------------------------------------------------------------------- /BAC_04_Serial/BAC_04_Serial_bb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raster/Beginner-Arduino-Class/master/BAC_04_Serial/BAC_04_Serial_bb.png -------------------------------------------------------------------------------- /BAC_14_MOSFET/BAC_15_MOSFET_bb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raster/Beginner-Arduino-Class/master/BAC_14_MOSFET/BAC_15_MOSFET_bb.png -------------------------------------------------------------------------------- /BAC_15_MOSFET/BAC_16_MOSFET_bb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raster/Beginner-Arduino-Class/master/BAC_15_MOSFET/BAC_16_MOSFET_bb.png -------------------------------------------------------------------------------- /BAC_12_Relay/Relay Module 1 Channel.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raster/Beginner-Arduino-Class/master/BAC_12_Relay/Relay Module 1 Channel.jpg -------------------------------------------------------------------------------- /BAC_12_Relay/Relay Module 4 Channel.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raster/Beginner-Arduino-Class/master/BAC_12_Relay/Relay Module 4 Channel.jpg -------------------------------------------------------------------------------- /BAC_13_Relay_Power/BAC_14_Relay_Power.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raster/Beginner-Arduino-Class/master/BAC_13_Relay_Power/BAC_14_Relay_Power.fzz -------------------------------------------------------------------------------- /BAC_06_Potentiometer/BAC_06_Potentiometer.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raster/Beginner-Arduino-Class/master/BAC_06_Potentiometer/BAC_06_Potentiometer.fzz -------------------------------------------------------------------------------- /BAC_13_Relay_Power/BAC_14_Relay_Power_bb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raster/Beginner-Arduino-Class/master/BAC_13_Relay_Power/BAC_14_Relay_Power_bb.png -------------------------------------------------------------------------------- /BAC_06_Potentiometer/BAC_06_Potentiometer_bb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raster/Beginner-Arduino-Class/master/BAC_06_Potentiometer/BAC_06_Potentiometer_bb.png -------------------------------------------------------------------------------- /BAC_05_Capacitive_Touch/BAC_05_Capacitive_Touch.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raster/Beginner-Arduino-Class/master/BAC_05_Capacitive_Touch/BAC_05_Capacitive_Touch.fzz -------------------------------------------------------------------------------- /BAC_05_Capacitive_Touch/BAC_05_Capacitive_Touch_bb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raster/Beginner-Arduino-Class/master/BAC_05_Capacitive_Touch/BAC_05_Capacitive_Touch_bb.png -------------------------------------------------------------------------------- /BAC_12_Relay/BAC_13_Relay.ino: -------------------------------------------------------------------------------- 1 | /* 2 | * BAC_13_Relay.ino 3 | * 4 | * This sketch makes a relay turn on and off 5 | * 6 | * Pete Prodoehl 7 | */ 8 | 9 | int RelayPin = 13; 10 | 11 | void setup() { 12 | pinMode(RelayPin, OUTPUT); 13 | digitalWrite(RelayPin, HIGH); // HIGH is off 14 | } 15 | 16 | void loop() { 17 | digitalWrite(RelayPin, LOW); // LOW is on 18 | delay(1000); 19 | digitalWrite(RelayPin, HIGH); // HIGH is off 20 | delay(1000); 21 | } 22 | 23 | 24 | -------------------------------------------------------------------------------- /BAC_13_Relay_Power/BAC_14_Relay_Power.ino: -------------------------------------------------------------------------------- 1 | /* 2 | * BAC_14_Relay_Power.ino 3 | * 4 | * This sketch makes a relay turn on and off 5 | * 6 | * Pete Prodoehl 7 | */ 8 | 9 | int RelayPin = 13; 10 | 11 | void setup() { 12 | pinMode(RelayPin, OUTPUT); 13 | digitalWrite(RelayPin, HIGH); // HIGH is off 14 | } 15 | 16 | void loop() { 17 | digitalWrite(RelayPin, LOW); // LOW is on 18 | delay(90); 19 | digitalWrite(RelayPin, HIGH); // HIGH is off 20 | delay(90); 21 | } 22 | 23 | 24 | -------------------------------------------------------------------------------- /BAC_06_Potentiometer/BAC_06_Potentiometer.ino: -------------------------------------------------------------------------------- 1 | /* 2 | * BAC_06_Potentiometer.ino 3 | * 4 | * This sketch reads a potentiometer and prints the value 5 | * 6 | * https://www.arduino.cc/en/Tutorial/AnalogInput 7 | * 8 | * https://www.arduino.cc/en/Tutorial/Potentiometer 9 | * 10 | * Pete Prodoehl 11 | */ 12 | 13 | int POTpin = 0; 14 | int POTvalue; 15 | 16 | void setup() { 17 | // nothing 18 | Serial.begin(9600); 19 | } 20 | 21 | void loop() { 22 | 23 | POTvalue = analogRead(POTpin); 24 | 25 | Serial.print("Potentiometer Value: "); 26 | Serial.println(POTvalue); 27 | 28 | } 29 | 30 | 31 | -------------------------------------------------------------------------------- /BAC_07_Map/BAC_07_Map.ino: -------------------------------------------------------------------------------- 1 | /* 2 | * BAC_07_Map.ino 3 | * 4 | * This sketch reads a potentiometer and prints an adjusted value 5 | * 6 | * https://www.arduino.cc/en/Reference/Map 7 | * 8 | * map(value, fromLow, fromHigh, toLow, toHigh) 9 | * 10 | * Pete Prodoehl 11 | */ 12 | 13 | int POTpin = 0; 14 | int POTvalue; 15 | int NEWvalue; 16 | 17 | void setup() { 18 | // nothing 19 | Serial.begin(9600); 20 | } 21 | 22 | void loop() { 23 | 24 | POTvalue = analogRead(POTpin); 25 | 26 | NEWvalue = map(POTvalue, 0, 1023, 1, 10); 27 | 28 | Serial.print("Mapped Value: "); 29 | Serial.println(NEWvalue); 30 | 31 | } 32 | 33 | -------------------------------------------------------------------------------- /BAC_09_LED/BAC_09_LED.ino: -------------------------------------------------------------------------------- 1 | /* 2 | * BAC_09_LED.ino 3 | * 4 | * This sketch makes an LED fade 5 | * 6 | * https://www.arduino.cc/en/Reference/For 7 | * 8 | * https://www.arduino.cc/en/Tutorial/PWM 9 | * 10 | * Pete Prodoehl 11 | */ 12 | 13 | // we use a PWM pin (they have a ~ by the number) 14 | int LEDpin = 11; 15 | 16 | void setup() { 17 | pinMode(LEDpin, OUTPUT); 18 | } 19 | 20 | void loop() { 21 | 22 | for (int i = 0; i < 255; i++) { 23 | analogWrite(LEDpin, i); 24 | delay(5); 25 | } 26 | 27 | for (int i = 255; i > 0; i--) { 28 | analogWrite(LEDpin, i); 29 | delay(5); 30 | } 31 | 32 | } 33 | 34 | -------------------------------------------------------------------------------- /BAC_02_LED/BAC_02_LED.ino: -------------------------------------------------------------------------------- 1 | /* 2 | * BAC_02_LED.ino 3 | * 4 | * This sketch makes an LED blink on and off (and uses a 220 ohm resistor) 5 | * 6 | * https://learn.adafruit.com/breadboards-for-beginners?view=all 7 | * 8 | * https://learn.sparkfun.com/tutorials/how-to-use-a-breadboard 9 | * 10 | * http://ledcalc.com/ 11 | * 12 | * http://resisto.rs/ 13 | * 14 | * http://resistor.cherryjourney.pt/ 15 | * 16 | * Pete Prodoehl 17 | */ 18 | 19 | int LEDpin = 13; 20 | 21 | void setup() { 22 | pinMode(LEDpin, OUTPUT); 23 | } 24 | 25 | void loop() { 26 | digitalWrite(LEDpin, HIGH); 27 | delay(1000); 28 | digitalWrite(LEDpin, LOW); 29 | delay(1000); 30 | } 31 | 32 | -------------------------------------------------------------------------------- /BAC_08_LED/BAC_08_LED.ino: -------------------------------------------------------------------------------- 1 | /* 2 | * BAC_08_LED.ino 3 | * 4 | * This sketch makes an LED fade 5 | * 6 | * https://www.arduino.cc/en/Reference/AnalogWrite 7 | * 8 | * https://www.arduino.cc/en/Tutorial/PWM 9 | * 10 | * Pete Prodoehl 11 | */ 12 | 13 | // we use a PWM pin (they have a ~ by the number) 14 | int LEDpin = 11; 15 | 16 | void setup() { 17 | pinMode(LEDpin, OUTPUT); 18 | } 19 | 20 | void loop() { 21 | analogWrite(LEDpin, 0); // analogWrite values go from 0 to 255 22 | delay(500); 23 | analogWrite(LEDpin, 25); 24 | delay(500); 25 | analogWrite(LEDpin, 75); 26 | delay(500); 27 | analogWrite(LEDpin, 150); 28 | delay(500); 29 | analogWrite(LEDpin, 255); 30 | delay(500); 31 | } 32 | 33 | -------------------------------------------------------------------------------- /BAC_05_Capacitive_Touch/BAC_05_Capacitive_Touch.ino: -------------------------------------------------------------------------------- 1 | /* 2 | * BAC_05_Capacitive_Touch.ino 3 | * 4 | * This sketch makes an LED turn on when a capacitive touch sensor is triggered 5 | * 6 | * https://www.adafruit.com/product/1374 7 | * 8 | * https://www.sparkfun.com/products/12041 9 | * 10 | * http://www.ebay.com/itm/201414934786 11 | * 12 | * Pete Prodoehl 13 | */ 14 | 15 | int LEDpin = 13; 16 | int CapTouchPin = 2; 17 | 18 | void setup() { 19 | pinMode(LEDpin, OUTPUT); 20 | pinMode(CapTouchPin, INPUT_PULLUP); 21 | } 22 | 23 | void loop() { 24 | if (digitalRead(CapTouchPin) == HIGH) { 25 | digitalWrite(LEDpin, HIGH); 26 | } 27 | else { 28 | digitalWrite(LEDpin, LOW); 29 | } 30 | } 31 | 32 | -------------------------------------------------------------------------------- /BAC_14_MOSFET/BAC_15_MOSFET.ino: -------------------------------------------------------------------------------- 1 | /* 2 | * BAC_15_MOSFET.ino 3 | * 4 | * This sketch makes a 12 volt device run via PWM 5 | * 6 | * https://www.sparkfun.com/products/12959 7 | * 8 | * https://www.arduino.cc/en/Tutorial/PWM 9 | * 10 | * Pete Prodoehl 11 | */ 12 | 13 | // we use a PWM pin (they have a ~ by the number) 14 | int PWRpin = 3; 15 | 16 | void setup() { 17 | pinMode(PWRpin, OUTPUT); 18 | } 19 | 20 | void loop() { 21 | analogWrite(PWRpin, 0); // analogWrite values go from 0 to 255 22 | delay(2000); 23 | analogWrite(PWRpin, 25); 24 | delay(2000); 25 | analogWrite(PWRpin, 75); 26 | delay(2000); 27 | analogWrite(PWRpin, 150); 28 | delay(2000); 29 | analogWrite(PWRpin, 255); 30 | delay(2000); 31 | } 32 | 33 | 34 | -------------------------------------------------------------------------------- /BAC_10_Piezo/BAC_11_Piezo.ino: -------------------------------------------------------------------------------- 1 | /* 2 | * BAC_11_Piezo.ino 3 | * 4 | * This sketch makes noise with a piezo 5 | * 6 | * https://www.arduino.cc/en/Reference/Tone 7 | * 8 | * https://www.arduino.cc/en/Tutorial/ToneMelody 9 | * 10 | * https://www.arduino.cc/en/Reference/Random 11 | * 12 | * https://www.arduino.cc/en/Reference/RandomSeed 13 | * 14 | * Pete Prodoehl 15 | */ 16 | 17 | int PiezoPin = 9; 18 | int aSecond = 1000; 19 | 20 | void setup() { 21 | randomSeed(analogRead(0)); 22 | pinMode(PiezoPin, OUTPUT); 23 | tone(PiezoPin, 500); 24 | delay(aSecond * 2); 25 | noTone(PiezoPin); 26 | delay(aSecond * 2); 27 | } 28 | 29 | void loop() { 30 | 31 | int randyNum = random(50, 1000); 32 | tone(PiezoPin, randyNum); 33 | delay(aSecond / 2); 34 | 35 | } 36 | 37 | -------------------------------------------------------------------------------- /BAC_03_Button/BAC_03_Button.ino: -------------------------------------------------------------------------------- 1 | /* 2 | * BAC_03_Button.ino 3 | * 4 | * This sketch makes an LED turn on when a button is pressed 5 | * 6 | * https://www.arduino.cc/en/Tutorial/DigitalPins 7 | * 8 | * https://www.arduino.cc/en/Reference/pinMode 9 | * 10 | * https://www.arduino.cc/en/Reference/If 11 | * 12 | * https://www.arduino.cc/en/Reference/Else 13 | * 14 | * https://www.arduino.cc/en/Tutorial/ifStatementConditional 15 | * 16 | * Pete Prodoehl 17 | */ 18 | 19 | int LEDpin = 13; 20 | int ButtonPin = 2; 21 | 22 | void setup() { 23 | pinMode(LEDpin, OUTPUT); 24 | pinMode(ButtonPin, INPUT_PULLUP); 25 | } 26 | 27 | void loop() { 28 | if (digitalRead(ButtonPin) == LOW) { 29 | digitalWrite(LEDpin, LOW); 30 | } 31 | else { 32 | digitalWrite(LEDpin, HIGH); 33 | } 34 | } 35 | 36 | -------------------------------------------------------------------------------- /BAC_01_LED/BAC_01_LED.ino: -------------------------------------------------------------------------------- 1 | /* 2 | * BAC_01_LED.ino 3 | * 4 | * This sketch makes an LED blink on and off 5 | * 6 | * https://www.arduino.cc/en/Reference/Int 7 | * 8 | * https://www.arduino.cc/en/Tutorial/Variables 9 | * 10 | * https://www.arduino.cc/en/Reference/VariableDeclaration 11 | * 12 | * Pete Prodoehl 13 | */ 14 | 15 | // use a variable to store a number 16 | int LEDpin = 13; 17 | 18 | void setup() { 19 | // initialize the digital pin as an output 20 | pinMode(LEDpin, OUTPUT); 21 | } 22 | 23 | void loop() { 24 | digitalWrite(LEDpin, HIGH); // turn the LED on (HIGH is the voltage level) 25 | delay(50); // wait for a second 26 | digitalWrite(LEDpin, LOW); // turn the LED off by making the voltage LOW 27 | delay(50); // wait for a second 28 | } 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /BAC_15_MOSFET/BAC_16_MOSFET.ino: -------------------------------------------------------------------------------- 1 | /* 2 | * BAC_16_MOSFET.ino 3 | * 4 | * This sketch makes a 12 volt device run via PWM 5 | * 6 | * https://www.sparkfun.com/products/12959 7 | * 8 | * https://www.arduino.cc/en/Reference/For 9 | * 10 | * https://www.arduino.cc/en/Tutorial/PWM 11 | * 12 | * Pete Prodoehl 13 | */ 14 | 15 | // we use a PWM pin (they have a ~ by the number) 16 | int PWRpin = 3; 17 | 18 | void setup() { 19 | pinMode(PWRpin, OUTPUT); 20 | Serial.begin(9600); 21 | } 22 | 23 | void loop() { 24 | 25 | for (int i = 0; i < 255; i++) { 26 | analogWrite(PWRpin, i); 27 | Serial.print("value: "); 28 | Serial.println(i); 29 | delay(25); 30 | } 31 | 32 | for (int i = 255; i > 0; i--) { 33 | analogWrite(PWRpin, i); 34 | Serial.print("value: "); 35 | Serial.println(i); 36 | delay(25); 37 | } 38 | 39 | } 40 | 41 | 42 | -------------------------------------------------------------------------------- /BAC_04_Serial/BAC_04_Serial.ino: -------------------------------------------------------------------------------- 1 | /* 2 | * BAC_04_Serial.ino 3 | * 4 | * This sketch makes an LED turn on when a button is pressed and also sends serial data 5 | * 6 | * https://www.arduino.cc/en/Tutorial/InputPullupSerial 7 | * 8 | * https://learn.adafruit.com/adafruit-arduino-lesson-5-the-serial-monitor?view=all 9 | * 10 | * Pete Prodoehl 11 | */ 12 | 13 | int LEDpin = 13; 14 | int ButtonPin = 2; 15 | int ButtonValue; 16 | 17 | void setup() { 18 | pinMode(LEDpin, OUTPUT); 19 | pinMode(ButtonPin, INPUT_PULLUP); 20 | Serial.begin(9600); 21 | } 22 | 23 | void loop() { 24 | 25 | ButtonValue = digitalRead(ButtonPin); 26 | 27 | if (ButtonValue == LOW) { 28 | digitalWrite(LEDpin, HIGH); 29 | Serial.println("The LED is on!"); 30 | } 31 | else { 32 | digitalWrite(LEDpin, LOW); 33 | Serial.println("The LED is not on..."); 34 | } 35 | 36 | } 37 | 38 | 39 | -------------------------------------------------------------------------------- /BAC_11_Servo/BAC_12_Servo.ino: -------------------------------------------------------------------------------- 1 | /* 2 | * BAC_12_Servo.ino 3 | * 4 | * This sketch makes a servo move 5 | * 6 | * https://www.arduino.cc/en/reference/servo 7 | * 8 | * Pete Prodoehl 9 | */ 10 | 11 | 12 | #include 13 | 14 | Servo myServo; // create servo object to control a servo 15 | 16 | int stepValue = 10; 17 | int delayValue = 300; 18 | 19 | void setup() { 20 | myServo.attach(9); 21 | 22 | myServo.write(0); 23 | delay(1000); 24 | myServo.write(180); 25 | delay(1000); 26 | myServo.write(0); 27 | delay(1000); 28 | 29 | } 30 | 31 | void loop() { 32 | 33 | for (int angle = 0; angle <= 180; angle = angle + stepValue) { 34 | myServo.write(angle); 35 | delay(delayValue); 36 | } 37 | 38 | delay(500); 39 | 40 | for (int angle = 180; angle >= 0; angle = angle - stepValue) { 41 | myServo.write(angle); 42 | delay(delayValue); 43 | } 44 | 45 | delay(500); 46 | 47 | } 48 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Beginner Arduino Class 2 | 3 | In 2016 I taught a classed titled **Electronics & Sculpture** in the Peck School of the Arts at the [University of Wisconsin Milwaukee](https://uwm.edu/). I often referred to the class as "Arduino for Artists". 4 | 5 | Basically, it was teaching art students, some of whom never programmed or wrote any code, how to activate their art using the [Arduino](https://arduino.cc/) platform. 6 | 7 | We had five concepts we wanted to cover: 8 | 9 | 1. Digital Input 10 | 2. Digital Output 11 | 3. Analog Input 12 | 4. Analog Output (PWM) 13 | 5. Serial Communications 14 | 15 | In 2017 I moved on to teaching the class at [Milwaukee Makerspace](https://milwaukeemakerspace.org/) and I refined the curriculum a bit to resemble very closely what you'll see in these files. I used components I had available. _(Note: I should add a parts list at some point)._ 16 | 17 | In 2018 I started teaching the class at **Brinn Labs**, usually with the help of Becky Yoshikane (friend, former coworker, former student, and former classmate). We taught the class all through 2018 and a few times in 2019. 18 | 19 | I no longer teach the Beginner Arduino Class, but I wanted to share the files in case anyone else could find them useful. 20 | 21 | Each lesson contains an Arduino sketch and a wiring diagram (as a [Fritzing](https://fritzing.org/) file, and a PNG file). In some cases there are also images showing components, and most of the sketches should have links to the concepts/functions used in the sketch. 22 | 23 | 24 | --- 25 | 26 | Pete Prodoehl 27 | 28 | 29 | 30 | 31 | 32 | --------------------------------------------------------------------------------