Author Topic: Rotary Encoder  (Read 5966 times)

0 Members and 1 Guest are viewing this topic.

Rafael Marfil

Rotary Encoder
« on: July 23, 2011, 02:29:40 PM »
Hi!

I want to build a MIDI controller with as many rotary encoders as possible to interact with Logic Pro during my audiovisual improvisations. I own a Wiring v. 1.0, I found a rotary encoder at sparkfun, with product id  COM-09117. How many of these could I connect to my board simultaneously?

I am a total beginner with Wiring, so I would need the code to be as simple as possible. To have some kind of visual feedback from Logic would be awesome. I found, also at sparkfun, a "Rotary Encoder LED Ring Breakout Board" with id COM-10407. It seems to be suitable, but also very "pin consuming".

Many thanks to Wiring for beeing so cool!  ;)

Rafael Marfil


barragan

Re: Rotary Encoder
« Reply #1 on: July 24, 2011, 12:31:03 AM »
hi Rafael, thank you, looking at the datasheet and this example for the 09117 http://www.sparkfun.com/datasheets/Components/RotaryEncoder.pde you need two pins for the rotation or three if using the press feature as well. Since this code is not using external interrupts but just polling the pins, you can connect many on the WIring 1.0

The other 10407 seems more pin consuming you're right, that's because all the interface given, perhaps the 09117 alone seems a better option for you, how many do you need to connect?
« Last Edit: July 24, 2011, 12:36:04 AM by barragan »

Rafael Marfil

Re: Rotary Encoder
« Reply #2 on: July 24, 2011, 03:28:16 AM »
Hi Hernando,

I think the 09117 is good for this project, because the LEDs are not essential. I would like to connect 126 rotary encoders. Some buttons would also be cool, like 32. If all those things are too much, I think 16 encoders would be ok.

Thank you very much for your time!

barragan

Re: Rotary Encoder
« Reply #3 on: July 24, 2011, 01:31:20 PM »
hi Rafael, well for a 126 you'll need a few boards :)
16 should be more than fine, you can also connect boards among them to have a master board and request data from slave boards in case you need to have a central unit responding for all the hardware, all this using the Wire library. Let me know of you need anything else, and keep us posted on your work.

Rafael Marfil

Re: Rotary Encoder
« Reply #4 on: July 24, 2011, 02:17:38 PM »
Hi Hernando!

Due to my little experience I think using just one board would be challenging enough. I will order my parts today! The board has 47 digital ports, does that mean, that I can connect up to 23 encoders?

I want to get a nice case for it, and if works well, I would like to use the Wiring logo on it, for other people to see it was made with Wiring. Do you think that would be ok?

Thank you very much for everything, of course I will keep you posted on my work!  :D

barragan

Re: Rotary Encoder
« Reply #5 on: July 24, 2011, 09:49:23 PM »
Which Wiring board are you getting? remember there are pins used for multiple functions check out this (assuming you have a Wiring V1.0 or Wiring V1.1 Sparkfun: http://wiring.org.co/hardware/previous.html note how 32 and 33 are also Serial the rest you use with no trouble, also analog pins can be used as digital.

Rafael Marfil

Re: Rotary Encoder
« Reply #6 on: July 25, 2011, 01:22:41 AM »
Hi,

I have the v. 1.0. I will purchase two Wiring S. One for future projects and one for my girlfriend. I checked the pins on the v. 1.0. There are RX0, TX0, RX1 and TX1. Are all of these exclusive for serial communication?

Many thanks!

barragan

Re: Rotary Encoder
« Reply #7 on: July 25, 2011, 09:45:23 AM »
They can be used as digital pins as well, if you don't use Serial or Serial1 in your code.

Rafael Marfil

Re: Rotary Encoder
« Reply #8 on: July 25, 2011, 02:44:24 PM »
Thank you for all the help!

Rafael Marfil

Re: Rotary Encoder
« Reply #9 on: July 29, 2011, 05:03:13 PM »
Hi!

I just finished the prototype yesterday and took it to a club to play with it! I stopped working, I beleive due to my usb hub. I found a library for quadrature encoders and I took some pictures of the prototype, we called it the ŒKONTROLLER hehehe. I'll upload them later on.

I would also like to learn how to connect various Wiring boards together, as you mentioned on a previous post. All of this is very exciting!

Thank you!

P.S. Do you speak spanish?
« Last Edit: July 29, 2011, 10:55:05 PM by Rafael Marfil »

barragan

Re: Rotary Encoder
« Reply #10 on: August 04, 2011, 01:31:49 AM »
Yes I do : ) hablo español
Ok to connect multiple boards use the Wire library examples http://wiring.org.co/learning/libraries the basic idea is to use the Wire pins SCL and SDA connecting boards in parallel using those pins. There will be a Master board that can send or request data from slave boards, since all boards share the same line you have to assign an address to each slave when registering the library in the code http://wiring.org.co/learning/libraries/slavesender.html then use this address in the master board program when reading/requesting data from that board: http://wiring.org.co/learning/libraries/masterreader.html

Let me know if this is clear enough for you.

Rafael Marfil

Re: Rotary Encoder
« Reply #11 on: August 06, 2011, 08:15:14 PM »
Hi Hernando!

I'll give those documents a look as soon as I get more boards. For the moment, I would like to know, if I can send MIDI messages directly from the board via USB. Is it possible?

Cheers :-)

Rafael

barragan

Re: Rotary Encoder
« Reply #12 on: August 06, 2011, 09:16:50 PM »
here there is an example: http://wiring.org.co/learning/basics/midi.html, we are working on a tutorial for MIDI right now :)
« Last Edit: August 21, 2011, 03:12:47 PM by bhagman »

Rafael Marfil

Re: Rotary Encoder
« Reply #13 on: August 11, 2011, 01:04:11 PM »
Many thanks For your support Hernando!

I really appreciate it! I look forward to learn from the new tutorial!!!

Cheers

Rafael Marfil

Re: Rotary Encoder
« Reply #14 on: November 02, 2011, 12:53:21 PM »
Hi Hernando!!!

The rotary encoder MIDI project went well, I ended up with a cardboard box with 16 encoders :-)

After a lot of tests, I realized, that rotary encoders were not so good for the kind of controller I want, that I would only need a couple of those to make fine adjustments. Now, I would like to build a conteoller with loads of potentiometers, some push buttons, leds and just a few encoders.

I found a multiplexer http://www.sparkfun.com/products/299 , is it compatible with the board??? Could you please help me on this one? :-)

Cheers!