Let’s make a device which helps us in adding numbers. We will learn how to memorize values and update them.
The XOD standard library contains a buffer
node which memorizes the input value when it receives a pulse.
To make some calculations and apply them to a stored value we should make a loop from the buffer output to the calculations and back to the buffer input.
To avoid limitless calculations and make it possible to reset the buffer we need a select
node. It feeds the calculation result to the buffer
node on a pulse.
In this example we’re using the add
node, but the calculation may be arbitrary complex.
Examine how the input value and pulses affect the stored result.
tweak-number
value.Replace tweak nodes with a coin acceptor and button to make a ticket system or photo booth.