Attributes are input parameters that the user can set inDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/wokwi/wokwi-docs/llms.txt
Use this file to discover all available pages before exploring further.
diagram.json. You can also define a controls section in the .chip.json file to let the user edit these parameters interactively during the simulation. This is particularly useful for sensor inputs (e.g. temperature, humidity, etc.).
Naming
When naming your attributes, please follow the following conventions:- Use
camelCasefor attribute names - Use American English spelling (e.g.
colorand notcolour)
attr_init
default_value will be used when the user does not define a value for the attribute in diagram.json (under the attrs section of the custom chip part).
The function returns a handle to the attribute, which can be accessed using attr_read().
attr_init_float
attr_init() for more info.
attr_read
attr should be a valid attribute handle, previously returned by attr_init().
attr_read_float
attr should be a valid attribute handle, previously returned by attr_init_float().
Simulator Examples
- Analog API chip example — Simulates a 0-5V/0-ADC_MAX voltage source. One float attribute and one analog output.
- PWM with Scope (github) — simulates a PWM input with 1 digital output and three attributes
- Scope with PWM (Scope with muliple inputs) (github) — Simulates a 4-channel oscilloscope with 4 digital inputs, 4 analog inputs and 4 attributes