Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Simulation Code

PIR Motion Sensor (Wokwi Compatible) (SIM TEST) Simulation Source Code Example

Explore the source code for simulating the PIR Motion Sensor (Wokwi Compatible) (SIM TEST) in Cirkit Designer. Use this example as a starting point to learn about, customize, or extend the component's behavior in your own designs.

This tab defines the visual layout of your custom component using HTML. You can specify how your component appears in the circuit, including interactive elements that respond to user input.
<style>
    button {
        font-size: 1.1rem;
        border: 2px solid #d3d3d3;
        /* Light grey border around each key */
        border-radius: 10px;
        /* Rounded edges for each key */
        cursor: pointer;
        transition: background 0.1s;
        outline: none;
        background-color: #4a90e2;
        color: white;
        width: 170px;
        height: 40px;
    }

    button:active {
        background-color: #555555;
        /* Darker color to indicate the key press */
    }
</style>

<div style="position: absolute; left: -15px; top: -45px">
    <button (mousedown)="component.handleButtonMouseDown()" (mouseup)="component.handleButtonMouseUp()">Simulate motion</button>
</div>