Constructor
new Pin()
- License:
- MIT
- Source:
- See:
Methods
getInfo() → {Object}
Get information about this pin and its capabilities.
Returns:
An object containing information about this pin
- Type
- Object
getMode() → {string}
Returns the current mode of the given pin.
Returns:
The pin mode, as a string
- Type
- string
mode(mode)
Set the mode of the given pin.
Parameters:
Name | Type | Description |
---|---|---|
mode |
string | The mode, a string that is either 'analog', 'input', 'input_pullup', 'input_pulldown', 'output', 'opendrain', 'af_output' or 'af_opendrain' |
read() → {boolean}
Returns the input state of the pin as a boolean.
Returns:
The input state
- Type
- boolean
reset()
Sets the output state of the pin to a 0.
set()
Sets the output state of the pin to a 1.
write(value)
Sets the output state of the pin to the parameter given.
Parameters:
Name | Type | Description |
---|---|---|
value |
mixed | Whether to set output high (true/1) or low (false/0) |
writeAtTime(value, time)
Sets the output state of the pin to the parameter given at the specified time.
Parameters:
Name | Type | Description |
---|---|---|
value |
mixed | Whether to set output high (true/1) or low (false/0) |
time |
float | Time at which to write |
Throws:
"Not implemented"
xGetLastOutput() → {boolean}
Returns the last output to the Pin.
Returns:
The last output
- Type
- boolean