Types
Every pin has a type, and a wire only joins pins whose types fit.
| Type | Values | Default | Example |
|---|---|---|---|
pulse | No value. A pulse either happens or it doesn't. | Never | A clock tick, a button press |
boolean | True or False | False | A light on or off |
number | Decimal numbers | 0 | A temperature, a delay in seconds |
byte | 0 to 255, written in hex | 00h | A raw value from a sensor |
port | A pin on the board | D0 | D13 |
string | Text | "" | A message to print |
fixed<s,i,f> | Fixed-point numbers | 0 | Fast maths on an FPGA |
Pulses and values
The difference that matters most is between a pulse and a value:
- A value stays put. A
booleanoutput that isTruestaysTrueuntil its node changes it, and anything reading it seesTrue. - A pulse is an event. It happens at one moment and then it's gone. Nodes with pulse inputs act on it: a flip-flop flips, a counter counts.
To turn one into the other, use sdp/logic/pulse-on-true or pulse-on-change (value to pulse) and sdp/logic/flip-flop or sdp/core/sample (pulse to value).
Generic nodes
Many library nodes work with more than one type. sdp/core/add adds numbers or fixed-point numbers; sdp/core/if-else picks between two booleans, numbers or strings. Runeweave works out which version you need from what you wire in.