Skip to main content

Types

Every pin has a type, and a wire only joins pins whose types fit.

TypeValuesDefaultExample
pulseNo value. A pulse either happens or it doesn't.NeverA clock tick, a button press
booleanTrue or FalseFalseA light on or off
numberDecimal numbers0A temperature, a delay in seconds
byte0 to 255, written in hex00hA raw value from a sensor
portA pin on the boardD0D13
stringText""A message to print
fixed<s,i,f>Fixed-point numbers0Fast maths on an FPGA

Pulses and values​

The difference that matters most is between a pulse and a value:

  • A value stays put. A boolean output that is True stays True until its node changes it, and anything reading it sees True.
  • 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.