Attributes are input parameters that the user can set in 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.).
When naming your attributes, please follow the following conventions:
camelCase
for attribute namescolor
and not colour
)Defines a new integer attribute with the given name. The 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()
.
warning
Note: attr_init
can only be called from chip_init()
. Do not call it at a later time.
Defines a new floating point attribute with the given name. See attr_init()
for more info.
warning
Note: attr_init_float
can only be called from chip_init()
. Do not call it at a later time.
Returns the current value of the attribute. attr
should be a valid attribute handle, previously returned by attr_init()
.
Returns the current value of the attribute. attr
should be a valid attribute handle, previously returned by attr_init_float()
.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4