Saludo Inicial
0:26
else para que cuando el sensor esté en estado LOW se apaguen las LEDs y los servomotores se muevan a la posición retraída (0°):Cpp
const int sensorPin = 13; // Pin del sensor de presencia const int ledPins[] = {3, 4, 5}; // Pines de las luces LED const int servoPins[] = {9, 10}; // Pines de los servomotores #include Servo servo1; Servo servo2; void setup() { pinMode(sensorPin, INPUT); for (int i = 0; i < 3; i++) { pinMode(ledPins[i], OUTPUT); } servo1.attach(servoPins[0]); servo2.attach(servoPins[1]); } void loop() { int sensorValue = digitalRead(sensorPin); if (sensorValue == HIGH) { // Encender LEDs y mover servomotores a la posición extendida for (int i = 0; i < 3; i++) { digitalWrite(ledPins[i], HIGH); } servo1.write(180); servo2.write(180); delay(30000); // Mantener por 30 segundos } else { // sensorValue es LOW // Apagar LEDs y mover servomotores a la posición retraída for (int i = 0; i < 3; i++) { digitalWrite(ledPins[i], LOW); } servo1.write(0); servo2.write(0); delay(30000); // Mantener por 30 segundos o ajustar el delay deseado } }
Reviews
Northern Maroon Flux Capacitor
Properties
Properties describe core aspects of the project.
Pricing & Availability
Distributor | Qty 1 |
|---|
Controls
Welcome 👋
Flux helps you build PCBs faster with an AI teammate!
Create your account to collaborate, stay updated, fork your own version, and get instant answers from our AI agent.

AI-Powered Component Placement
Let AI place your components intelligently. AI Placement analyzes your schematic and positions components for optimal routing, signal integrity, and board density.
From Schematic to Layout in Seconds
Skip the tedious manual placement. AI Placement generates a starting layout you can refine, saving hours of repetitive work on every new design.
Works With Auto-Layout
Pair AI Placement with Auto-Layout for a complete AI-driven PCB design flow — from component placement through trace routing, all with one click.