Constructor
new Hardware(data)
logic or backend part of a hardware component.
Refer to the markdown documentation for more information.
Do not use this constructor, use makeHardware()
Parameters:
Name | Type | Description |
---|---|---|
data |
- Source:
Methods
(static) makeHardware(data) → {function}
call this to generate a hardware factory
Parameters:
Name | Type | Description |
---|---|---|
data |
* | see markdown documentation |
- Source:
Returns:
factory
- Type
- function
getPin(nr) → {yasp.Pin}
get one of the pins of this hardware instance
Parameters:
Name | Type | Description |
---|---|---|
nr |
Number |
- Source:
Returns:
- Type
- yasp.Pin
getPinMode(nr) → {String}
shortcut method to get the mode of a hardware pin
Parameters:
Name | Type | Description |
---|---|---|
nr |
Number |
- Source:
Returns:
- Type
- String
getState() → {*}
called by the frontend to get an
- Source:
Returns:
- Type
- *
receiveStateChange(nr, state)
called by the breadboard when a pin state has been changes by
the outside environment (e.g. the emulator).
Parameters:
Name | Type | Description |
---|---|---|
nr |
||
state |
- Source:
setStateChangedEvent(func)
sets a callback function which should be called, if one
of the pins state has changed.
Parameters:
Name | Type | Description |
---|---|---|
func |
function | callback with the Pin as only parameter |
- Source: