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
| int potentiometerPin = 0; | |
| int ledPin = 11; | |
| int potentiometerVal = 0; | |
| void setup() | |
| { | |
| Serial.begin(9600); // setup serial | |
| } | |
| 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
| #include <Wire.h> //*Include the Wire library which allows to use the I2C interface* | |
| #include <Adafruit_Sensor.h> | |
| #include <Adafruit_BME280.h> //*library to easily take readings from the sensor* | |
| #define SEALEVELPRESSURE_HPA (1013.25) | |
| Adafruit_BME280 bme; //*Declare the bpm variable, an easy to remember reference for the device* | |
| unsigned long delayTime; |
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
| /* | |
| * PIR sensor tester | |
| */ | |
| int ledPin = 13; // choose the pin for the LED | |
| int inputPin = 2; // choose the input pin (for PIR sensor) | |
| int pirState = LOW; // we start, assuming no motion detected | |
| int val = 0; // variable for reading the pin status | |
| 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 trigPin 13 | |
| #define echoPin 12 | |
| void setup() { | |
| Serial.begin (9600); | |
| pinMode(trigPin, OUTPUT); | |
| pinMode(echoPin, INPUT); | |
| } | |
| void loop() { | |
| long duration, distance; | |
| digitalWrite(trigPin, LOW); |
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
| int x, y, z; | |
| void setup() | |
| { | |
| Serial.begin(9600); // sets the serial port to 9600 | |
| } | |
| void loop() | |
| { | |
| x = analogRead(0); // read analog input pin 0 |
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
| int out; | |
| void setup() | |
| { | |
| Serial.begin(9600); // sets the serial port to 9600 | |
| } | |
| void loop() | |
| { | |
| out = analogRead(0); // read analog input pin 0 |
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
| // the setup function runs once when you press reset: | |
| void setup() { | |
| // initialize serial communication at 9600 bits per second: | |
| Serial.begin(9600); | |
| } | |
| // the loop routine runs over and over again forever: | |
| void loop() { | |
| // read the input on analog pin 0: | |
| int sensorValue = analogRead(A0); | |
| // print out the value you read: |
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
| // Line Sensor Breakout - Analog | |
| int out; | |
| void setup() | |
| { | |
| Serial.begin(9600); // sets the serial port to 9600 | |
| } | |
| 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
| int led = 9; // the pin that the LED is attached to | |
| int brightness = 0; // the bigger this number, the brighter the LED is | |
| int fadeAmount = 5; // the bigger this number, the faster the the LED will fade on or off | |
| // the setup routine runs once when you press reset: | |
| void setup() { | |
| pinMode(led, OUTPUT); // declare pin 9 to be an output: | |
| } | |
| // the loop routine runs over and over again forever: |