-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from nishant-giri/main
Add Automatic Light Switch
- Loading branch information
Showing
6 changed files
with
2,109 additions
and
2 deletions.
There are no files selected for viewing
2,053 changes: 2,053 additions & 0 deletions
2,053
Automatic Light Switch/Automatic Light Switch.brd
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Automatic Light Switch - Nishant Giri | ||
|
||
void setup() | ||
{ | ||
// Configure Pins as Input and Output | ||
pinMode(2, INPUT); | ||
pinMode(8, OUTPUT); | ||
} | ||
void loop() | ||
{ | ||
// Get Data from Sensor Port | ||
int sensor = digitalRead(2); | ||
// Pin State Change (0 to 1) | ||
if(sensor == HIGH) | ||
{ | ||
// Turn ON LED | ||
digitalWrite(8, HIGH); | ||
} | ||
// Pin State Change (1 to 0) | ||
else | ||
{ | ||
// Turn OFF LED | ||
digitalWrite(8, LOW); | ||
} | ||
// Delay of 10ms for LED | ||
delay(10); | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Automatic Light Switch | ||
|
||
## About the Project | ||
|
||
Automatic Light Switch using Arduino and PIR Sensor. | ||
|
||
--- | ||
|
||
## Project Components | ||
|
||
1. Arduino Uno R3 ×1 | ||
2. Breadboard ×1 | ||
3. Connecting Wires | ||
4. LED ×1 | ||
5. PIR Sensor ×1 | ||
6. Resistor (200 Ω) ×1 | ||
|
||
--- | ||
|
||
## Programming Language | ||
|
||
C++ | ||
|
||
--- | ||
|
||
## Tinkercad Simulation | ||
|
||
[Automatic Light Switch](https://www.tinkercad.com/things/fbEomPu592H) |
This file was deleted.
Oops, something went wrong.
This file contains 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