To put in practice what I've learned from the Arduino course with Zahraa Khalil from LinkedIn Learning Arudino: Foundations : Interfacing with Analog Devices : Interfacing with hardware h Hardware I decided to create a music stand that would open and close automatically holding my sheet of music. the whole concept is very simple: a light sensor detects when the light is blocked while I pass my hands over the sensor, Arduino sends a command to a servo motor attached to a board which hods or release the paper. VIDEO: the LEDs work as a 4 second countdown until the door closes and holds the paper Code: #include <Servo.h> Servo alavanca; int LED1=9; int LED2=8; int LED3=7; int LED4=6; int LED0=5; int servoPin=10; void setup() { // put your setup code here, to run once: Serial.begin(9600); pinMode(9, OUTPUT); pinMode(8, OUTPUT); pinMode(7, OUTPUT); pinMode(6, OUTPUT); pinMode(5, OUTPUT); alavanca.attach(servoPin); } void loop() { // pu...
Comments
Post a Comment