5 Pin Rotary Encoder

A rotary encoder continuously spins, one tick at a time. The Embrio node uses interrupts to handle changes, because of this you must be sure to use pins on your Arduino that are interrupt enabled. On most models digital pins 2 and 3 are interrupt enabled, so this node defaults to those.

This node only uses 4 of the 5 pins on the encoder. Attach the ground and + pins to the ground and 5V pin on the Arduino.
Attach the SW and DT pins to digital pin 2 and 3. If you want to use the push button component on the encoder, plug the Switch pin into any digital pin, and hook it up to an Above or Below node to get a trigger when it is pressed.

By default the node outputs an integer from -100 to 100, but you can change this range to whatever suits your needs. Rollover can be turned on or off by changing the Do Rollover input to over 0.5. When Do Rollover is off, the output integer is clamped to the range. The first time the min or max value is hit,
the appropriate output trigger fires. When rollover is on, the value rolls over and the rollover output trigger fires.

To use the output value as an activation, add an Integer to Activation ndoe from the Math toolbar.

To use this node in your Embrio project, either add it from the Library toolbar or copy the XML in the below box and paste it into a node screen.