youssefbrini / B3FS-1050P

Files

Pins

Symbol

PCB

Open in Flux
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
const p1TerminalUid = "3d606e31-1193-adf0-af2d-9a6f5fc959a3";
const p2TerminalUid = "58992c51-2d5c-0b07-af59-4b5b1df793b8";
flux.on("setup", () => {
    const pushSwitch = flux.controls.find(control => control.name === "Momentary Switch");
    if (!pushSwitch) {
        throw new Error("Oops! Could not find switch control")
    }
    if (pushSwitch.value) {
        flux.currentSymbol = "push-closed";
        flux.simulationModel = {
            type: "switch",
            state: true,
            map_input_to_terminal_uid: p1TerminalUid,
            map_output_to_terminal_uid: p2TerminalUid,
        };
    } else {
        flux.currentSymbol = "push-open";
        flux.simulationModel = {
            type: "switch",
            state: false,
            map_input_to_terminal_uid: p1TerminalUid,
            map_output_to_terminal_uid: p2TerminalUid,
        };
    }
})
flux.on("inputChange", (e) => {
    if (e.control_name === "Momentary Switch") {
Enter to Rename, Shift+Enter to Preview

Reviews