Skip to content

A generic component builder would be nice #396

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
CuirPork opened this issue Jul 31, 2022 · 1 comment
Open

A generic component builder would be nice #396

CuirPork opened this issue Jul 31, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@CuirPork
Copy link

CuirPork commented Jul 31, 2022

Occasionally, I have a component that doesn't exist in the Wokwi list of ready made components. Furthermore the component I may want to simulate may never be needed by anyone ever again. It's my little component that I kludged together to make a running waterer for my pet gerbil, for example.
It seems to me that I know the inputs and outputs of the device so a generic "component" that I could change the size, number of inputs, number of outputs, would be ideal.

A more concrete example is that I have a capacitive touch interface from OSEPP. It's basically a simple analog button with three interfaces on it. One for voltage, one for ground and one as the signal that runs high or low depending on the touch.

So a generic component would work like the PIR component. You would have your three leads and an event that you would name yourself: "touched". you could Trigger the "touched" even t like the "motion" event in the PIR and it would change the voltage from LOW to HIGH or HIGH to LOW. when you added that component.
Then, as more and more people made more and more generic component versions of touch sensors, you would realize, "Hey we should add a touch sensor" and figure out which touch sensors were being used most often.

here's another example: I am routing a 5V signal to the power leads on a usb connection. I could create a little SVG of a usb connection, pull down the Generic component and add two interfaces to it. I would put the required voltage for the component to 5V and add the two pin connectors. I'm plugging in LED light strips, but I could just as easily plug in anything that runs off of USB. None of that is important to my model. Just having a generic two-connector device that turns on when I send it voltage would be great. Then, as more complex needs arise, I could request a new component explicitly and provide my SVG to help in the process.

Thanks for listening and thanks for the great product.

@CuirPork CuirPork added the enhancement New feature or request label Jul 31, 2022
@urish
Copy link
Contributor

urish commented Aug 1, 2022

Thanks for the detailed request!

This can probably be achieved by a combination of #301 and #302. We started working on a prototype of #301, where you can define the custom logic for a component of your choice. The nice thing about this is that you can use the existing components as inputs for the custom logic.

For instance, you could use a push button as an input for your custom component, and then write some logic that will provide a different analog output based on the input. Here's a quick example that implements something like what you described:

https://wokwi.com/projects/338775837156311635

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants