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
| const int switchPin = 8; | |
| unsigned long int prevTime = 0; | |
| long interval = 300000; | |
| int switchState = 0; | |
| int prevSwitchState = 0; | |
| int nextLED = 2; | |
| void setup() { | |
| // set direction of digital pins | |
| for( int x = 2; x < 8; x++ ) { |
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
| // set up LiquidCrystal library | |
| #include <LiquidCrystal.h> | |
| LiquidCrystal lcd(12, 11, 5, 4, 3, 2); | |
| const int switchPin = 6; | |
| int switchState = 0; | |
| int prevSwitchState = 0; | |
| int response; | |
| 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
| #include <Servo.h> | |
| Servo myServo; | |
| // constant variables for input and output components | |
| const int piezo = A0; | |
| const int switchPin = 2; | |
| const int redLED = 3; | |
| const int yellowLED = 4; | |
| const int greenLED = 5; |
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 <CapacitiveSensor.h> | |
| CapacitiveSensor capSensor = CapacitiveSensor(4, 2); | |
| // set up lamp capacitance threshold | |
| int threshold = 400000; | |
| const int ledPin = 12; | |
| void setup() { | |
| Serial.begin(9600); | |
| pinMode(ledPin, 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
| const int switchPin = 2; | |
| const int motorPin = 9; | |
| int switchState = 0; | |
| void setup() { | |
| // declare pins' directions | |
| pinMode(switchPin, INPUT); | |
| pinMode(motorPin, OUTPUT); | |
| } |
OlderNewer