Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kerogs/doorautolight
code with an ultrasonic sensor. Which detects when a door is opened and switches on the light.
https://github.com/kerogs/doorautolight
Last synced: about 12 hours ago
JSON representation
code with an ultrasonic sensor. Which detects when a door is opened and switches on the light.
- Host: GitHub
- URL: https://github.com/kerogs/doorautolight
- Owner: kerogs
- License: mit
- Created: 2024-11-04T16:24:02.000Z (about 2 months ago)
- Default Branch: main
- Last Pushed: 2024-11-04T17:32:09.000Z (about 2 months ago)
- Last Synced: 2024-11-04T18:32:06.490Z (about 2 months ago)
- Language: C++
- Size: 61.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# doorAutoLight
code with an ultrasonic sensor. Which detects when a door is opened and switches on the light.## dal-s.ino
Version of the code that works with a servo motor that turns to press a button.### required electronic component
- Arduino
- Motor servo
- ultrasonic sensor
- led (optional)
- 220Ω resistor (optional)### Library
- Servo.h### Variable to change
```cpp
// Distance and timing settings (modifiable)
int maxDistance = 10; // Maximum detection distance in cm
int durationAction = 8000; // The time that elapses before the Servo presses again. (ms)
int delayServoBetweenAction = 1000; // Delay between servo movement and return to initial position. (ms)
int servoAngleMax = 180; // Servo stop angle (180° max) (deg)
```### Schema
![alt text](.ksinf/dal-s.png)