This application note provides an example of how an encoder connected to an Arduino microcontroller can be used to interact with Blocks. It is assumed that the reader is familiar with Arduino concepts, the Arduino IDE and microcontrollers in general. The application note is provided for inspiration please direct Arduino questions towards the Arduino community forums. Pixilab may be able to qoute custom solutions as per request.
You need a computer with a running Blocks server version 6.1 or newer and a web browser to use this application note. You also need a separate computer running PIXILAB Player. Here is the Blocks root for this application note, and here is the Arduino sketch (the Arduino sketch has been tested on an Arduino Nano Every). See the general setup article for details on how to download and install the root on your Blocks server.
The PIXILAB Player Spot passes data received from the Arduino to the Blocks server over the network. The EncoderExample driver handles the received data and exposes a numeric position property, which the bar and the button binds to.
The source code for the EncoderExample driver is located in PIXILAB-Blocks-root/script/driver/EncoderExample.ts.