//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;
electrofuentes
copilot
-
LEDs:
- Red LEDs: LED1, LED2, LED3, LED4
- Manufacturer: Kingbright
- Model: WP7113SRD/D
- Forward Voltage: 1.85V
- Yellow LEDs: LED5, LED6, LED7, LED8
- Manufacturer: Kingbright
- Model: WP7113SYD
- Forward Voltage: 2V
-
NE555P Timer ICs:
- IC1, IC2
- Uses: Could be configured as astable multivibrators to create oscillating output to flash LEDs.
-
Resistors:
- R1 and R2: 1M ohm each
-
Capacitors:
- C1: 0.1μF
- C3: 1μF (max reverse voltage not specified)
-
Power Supply:
- V1: 9V source
Connectivity-
Net 3: Connects IC2, LED7, LED6, LED2, LED3, and R1.
-
Net 5: Connects R2, LED5, LED4, LED1, LED8, and IC1.
-
Net 6: Connects R2, C1, IC1, and IC1.
-
Net 2: Connects IC2, C3, V1, IC1, and C1.
-
Net 9: Connects LED8 and LED6.
-
Net 4: Connects R1, C3, IC2, and IC2.
-
Net 7: Connects LED4 and LED2.
-
Net 1: Connects V1, IC2, and IC1.
-
Net 8: Connects LED1 and LED3.
-
Net 10: Connects LED5 and LED7.
Assumptions: