setup()

[Main Functions]
void setup();

Description

The setup() function is called when a C program starts. As the Arduino equivalent use it to initialize variables, pin modes, initialize modules, draw symbols, etc. This function will only run once, after each program change or reset of the custom element.

Parameters

None.

Returns

Nothing.

Example Code

void setup() {
    // Set the chip name "74LS04" (Hex inverting gates)
    chipName("74LS04");
    logicFamily(TTL); // Specify TTL logic family

    // Define left side input and output pins
    pinLabel(1, "1A");
    pinLabel(2, "Y1");
    pinMode(2, OUTPUT);
    pinLabel(3, "2A");
    pinLabel(4, "Y2");
    pinMode(4, OUTPUT);
    pinLabel(5, "3A");
    pinLabel(6, "Y3");
    pinMode(6, OUTPUT);

    // Define the ground pin
    pinLabel(7, "GND");
    groundPin(7);

    // Define the right side input and output pins
    pinLabel(8, "Y4");
    pinMode(8, OUTPUT);
    pinLabel(9, "4A");
    pinLabel(10, "Y5");
    pinMode(10, OUTPUT);
    pinLabel(11, "5A");
    pinLabel(12, "Y6");
    pinMode(12, OUTPUT);
    pinLabel(13, "6A");

    // Define the power pin
    pinLabel(14, "VCC");
    powerPin(14);
}

void loop() {}

Notes and Warnings

The drawing defined here will be immutable, it will not change during the simulation. If you need to change the drawing during the simulation, use the loop() function.