Tag Archives: rotary encoders

Project SDVX: Part 3

← Part 2 | None 

Previously I got the Arduino Uno with the intention of using it to read my rotary encoders, which were to be used as my controller’s analog knobs. It turns out that the Uno can read the encoders… it just can’t output to keyboard/mouse. So I went and got myself another Arduino, the Leonardo. Should have done my research first.

It's about the same size as the Uno, but uses a micro-USB cable

It’s about the same size as the Uno, but uses a micro-USB cable

In any case, after a bit of research I found this tutorial on bildr. The code works well, and throwing in a Mouse.move statement allows the encoder to control a mouse cursor. This is useful because K-shoot Mania has a setting which lets you control the left and right lasers by “Custom Controller (Mouse X/Y)”.

The middle pin connects to ground, and the other two connect to input pins.

The middle pin connects to ground, and the other two connect to input pins.

I’m still doing a bit of fine tuning with the code so that it plays smoothly, but I’m glad that the encoders work. I’ll have to start making a box to house all the components soon.

← Part 2 | None 

Project SDVX: Part 2

← Part 1 | None 

A lot of loot

A lot of loot

I came home today to find, with joy, that my Sparkfun shipment had finally arrived. Sure it took a while, but to be fair I did choose the cheapest shipping option.

What I got was:

  • A pack or resistors, because I have no idea which ones I’ll need. In fact, I have no idea how to work out which ones I’ll need either, but I’ll figure that out somehow.
  • A new breadboard, because I like having an entire column for for + and – voltage. It makes breadboarding much easier (my previous breadboard only had rows of 5 holes).
  • An Arduino Uno, to program the rotary encoders.
  • 3 rotary encoders and 3 knobs. I bought one extra just in case one breaks, because Sparkfun shipping is not the cheapest out there. These ones have a clicky feeling as you turn them, which from memory is different from how the arcade knobs feel.
  • Some wire, just in case.

I probably didn’t need the resistors, breadboard and wire, but I thought that I might as well get a few more things while I was at it.

The Arduino really is quite small. Here’s a comparison with my favourite Pilot ballpoint pen.

The box this came in was probably small than a deck of cards

The box this came in was probably small than a deck of cards

Unfortunately, as much as I’d love to start testing the rotary encoders straight away, I can’t yet. The first reason is because I’ll be busy for the next few days, but the second and bigger reason is that I don’t have a USB cable.

Yes, I should have checked when I bought it.

So now it’s time for a bit more waiting while I buy a USB cable for my Arduino. Meanwhile I’ll also have to figure out is how to use the rotary encoders – there’s about 8 pins on the bottom and I need to look up which one’s which. Also, it doesn’t actually fit in the breadboard so I can’t test it that way – it looks like I’ll need to attach wires to it directly.

Oh and the BT buttons from last time? I gave up and bought the round ones. Saves me money that way.

Perfectionism wishes restrained by monetary budgets

Edit: After a few minutes of research leading to Sparkfun’s USB buying guide, it appears that what I need is a USB-A to USB-B cable, which isn’t necessarily designed specifically for the Arduino. In fact, my printer cable is exactly that type, so it looks like I won’t need to buy any cables. I still can’t play around with the encoders any time soon though, due to being busy for the next few days.

← Part 1 | None