//This example code shows how to use Flux's API (https://docs.flux.ai/reference/api-overview) to add an LED simulator model to a part.
//It also changes the symbol to signal schematic users when the LED is turned on and when it's turned off based on simulator data.
//You can find this part in use in the Astable multivibrator example in your profile.
//Assigning the object ID of the terminals in the schematic editor to two variables
const anodeTerminalId = "63b04c1b-436c-3804-2af5-f29f2e88399c"; // Anode terminal ID
const cathodeTerminalId = "e5f77de8-474b-cc14-8e87-78778e0da1c6"; // Cathode terminal ID
//Get terminal objects by ID.
const anodeTerminal = flux.getNodeById(anodeTerminalId, "elementTerminal");
const cathodeTerminal = flux.getNodeById(cathodeTerminalId, "elementTerminal");
//Create the output nodes that will be visible to users in the simulator tab on the schematic
const outputVoltage = flux.createOutputNode("vout");
const inputVoltage = flux.createOutputNode("vin");
const current = flux.createOutputNode("I");
const voltageDrop = flux.createOutputNode("vdrop");
//Setting up basic parameters of an LED. You can modify these parameters and see how the simulation changes when you put it in a project
const seriesResistance = 0.42;
const emissionCoefficient = 3.73;
const saturationCurrent = 93.2e-12;
richy2023
copilot
- 2 x Servos
- 2 x Timer 555
- 2 x Pulsadores
- Resistencias y capacitores para la configuración del 555
- Fuente de alimentación adecuada para los servos y el circuito 555
Esquema general del circuito- Pin 1 (GND): Tierra
- Pin 2 (TRIGGER): Conectado a un terminal del pulsador. También se conecta una resistencia al pin 6 (THRESHOLD) del 555 y al Vcc para definir el tiempo del pulso.
- Pin 3 (OUTPUT): Conectado a la señal de control del servo
- Pin 4 (RESET): Conectado a Vcc
- Pin 5 (CONTROL VOLTAGE): Sin conexión o con un capacitor de 0.01µF a tierra
- Pin 6 (THRESHOLD): Conectado a un resistor y capacitor para definir la duración del tiempo de pulso, los otros extremos del resistor y el capacitor se conectan a Vcc y tierra respectivamente.
- Pin 7 (DISCHARGE): Conectado a la unión del resistor y capacitor del pin 6
- Pin 8 (Vcc): Conectado a la alimentación (5V o 6V típicamente)
Valores típicos:- Resistencia (R): 10 kΩ (puede ajustarse para cambiar el ancho del pulso)
- Capacitor (C): 10 µF (puede ajustarse para cambiar el ancho del pulso)
Conexiones del pulsador:- Un terminal del pulsador conectado al pin 2 (TRIGGER) del 555
- El otro terminal del pulsador conectado a GND
Conexiones del servo:- Cable de señal del servo conectado al pin 3 (OUTPUT) del 555
- Cable de alimentación del servo conectado a Vcc y GND según las especificaciones del servo
Diseño general:-
Servo 1:
- Conecta el pin 3 del primer 555 a la señal de control del primer servo.
- Conecta el pin 2 del primer 555 a un terminal del primer pulsador (y el otro terminal a GND).
-
Servo 2:
- Conecta el pin 3 del segundo 555 a la señal de control del segundo servo.
- Conecta el pin 2 del segundo 555 a un terminal del segundo pulsador (y el otro terminal a GND).
Conexiones del Circuito