Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
blocks:app-note:arduino [2023-08-01 11:35]
melvin created
blocks:app-note:arduino [2023-08-16 17:33] (current)
mattias [Installation]
Line 1: Line 1:
-====== Connecting an Arduino microcontroller to Blocks ====== +====== Connecting an Arduino microcontroller with encoder to Blocks ======
- +
-This application note provides an example of how an [[https://en.wikipedia.org/wiki/Rotary_encoder|encoder]] connected to an [[https://www.arduino.cc/|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.+
  
 +This application note provides an example of how an [[https://en.wikipedia.org/wiki/Rotary_encoder|encoder]] connected to an [[https://www.arduino.cc/|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. 
 ===== Installation ===== ===== Installation =====
  
-You need a computer with a running Blocks server and a web browser to use this application note. You also need a separate computer running PIXILAB Player. Here is the {{ :blocks:app-note:arduino:pixilab-blocks-root.zip |Blocks root}} for this application note, and here is the {{ :blocks:app-note:arduino:encoderex.zip |Arduino sketch}} (the Arduino sketch has been tested on an Arduino Nano Every). See the [[blocks:app-note:start|general setup]] article for details on how to download and install the root on your Blocks server.+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:app-note:arduino:pixilab-blocks-root.zip |Blocks root}} for this application note, and here is the {{ :blocks:app-note:arduino:encoderex.zip |Arduino sketch}} (the Arduino sketch has been tested on an Arduino Nano Every). See the [[blocks:app-note:start|general setup]] article for details on how to download and install the root on your Blocks server.
  
 ===== Running the example ===== ===== Running the example =====
Line 11: Line 10:
   - Open the downloaded Arduino sketch in the Arduino IDE. The Arduino sketch depends on the [[https://github.com/PaulStoffregen/Encoder|Encoder library]], which can be downloaded through the Library Manager in the Arduino IDE.   - Open the downloaded Arduino sketch in the Arduino IDE. The Arduino sketch depends on the [[https://github.com/PaulStoffregen/Encoder|Encoder library]], which can be downloaded through the Library Manager in the Arduino IDE.
   - Upload the sketch to the Arduino.   - Upload the sketch to the Arduino.
-  - Connect the encoder to digital pins 2 and 3 on the Arduino.+  - Connect the encoder data wires to digital pins 2 and 3 on the Arduino (interrupt pins), power and ground. Find out the wire colors from the encoder whitepapers.
   - Connect the Arduino to a computer running PIXILAB Player.   - Connect the Arduino to a computer running PIXILAB Player.
   - Start Blocks.   - Start Blocks.