This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <Servo.h> | |
| int servoPin = 9; | |
| Servo servo; | |
| int angle = 0; // servo position in degrees | |
| void setup() | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #define PIN1 8 | |
| #define PIN2 7 | |
| void setup() { | |
| pinMode(PIN1, OUTPUT); | |
| pinMode(PIN2,OUTPUT); | |
| } | |
| void loop() { | |
| //mode 1: HL |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #define LED_PIN 3 | |
| float ledValue; | |
| void setup() { | |
| ledValue = 0; | |
| pinMode(LED_PIN, OUTPUT); | |
| } | |
| void loop() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #define LED_PIN 3 | |
| #define SENSOR A0 | |
| boolean flag; | |
| void setup() { | |
| flag = false; | |
| pinMode(LED_PIN, OUTPUT); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #define LED_PIN 3 | |
| #define SENSOR_PIN A0 | |
| const int threshold = 600; | |
| float currentValue; | |
| float targetValue; | |
| float easingAmount; | |
| int sensorValue; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // CLAP SWITCH | |
| #define LED 3 | |
| #define CLAP_SENSE A0 | |
| bool ledState = false; | |
| void setup() { | |
| pinMode(LED, OUTPUT); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //POTENTIOMETER CONTROLLED BLINKING | |
| #define LED 3 | |
| #define POT A0 | |
| void setup() { | |
| pinMode(LED, OUTPUT); | |
| } | |
| void loop() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Touch Sensor | |
| #include <CapacitiveSensor.h> | |
| #define LED 3 | |
| CapacitiveSensor cs_4_2 = CapacitiveSensor(4, 2); | |
| void setup() | |
| { | |
| pinMode(LED, OUTPUT); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #define LED 3 | |
| #define LDR A0 | |
| bool ledState = false; | |
| void setup() { | |
| pinMode(LED, OUTPUT); | |
| } | |
| void loop() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| If button is pressed for 3 seconds, one LED should light up. | |
| If button is pressed for 6 seconds, another LED should light up. | |
| If a button is pressed and held for 6 seconds and a second button is pressed, make the LED do some special behavior. | |
| Explore combining behaviors. | |
| How many different LED behaviors can you get out of just two switches and measuring how long they're pressed? | |
| */ | |
| #define LED1 5 | |
| #define LED2 6 |
NewerOlder