Home Chapter 13 Maxuino/Arduino encoder input

Site Search

GTranslate

Chinese (Simplified) French German Italian Portuguese Russian Spanish
Maxuino/Arduino encoder input

In this section we will look at how to use a position encoder from Keyes.  The MAX MSP code for this article is contributed by contemporary artist Jessica Ann.

While many motors are excellent at responding to digital or PWM in order to allow a motor to go in either direction often we desire some form of feedback to also confirm that what we told the motor to do with our microprocessor was how it responded.  Still there are other uses for the encoder, for example as a way to advance video in MAX MSP and Jitter. 

In this tutorial we will look at some code that allows you to determine the direction the encoder is turning and as such use that information to make intelligent decisions in MAX MSP and Jitter.

 
 Keyes Rotary Encoder

It is important to notice that with this prebuilt encoder there are already 10K Ohm resistors soldered to the board, so if you use another encoder do further research to make sure you are properly protecting your microprocessor.

To attach the KEYES Rotary encoder module for Arduino here is a simple schematic.

 
 Arduino sketch for wiring to the Arduino UNO


Here is the Max Msp and Jitter code for driving the encoder and getting useful input.

 

 
 Patch by Jessica Ann

 

MAX MSP lessons continue in Chapter 14