Custom made trackball

Hello,

I’m thiinkikg of buiding a custom trackball. Well, not really a trackball… Instead if a ball i want to use an analog thumbstick. In any case i wouid like to use kaleidoscope and an atmega32u4. To read the thumbstick I can use the adcsin the micro, but trying to pry apart kaleidoscope it seems to need an attiny to do the matrix scan. Can sombody give me some pointers on hiw to do the matrix scan in the 32u4 directiy?

Cheers

1 Like

Something like AtmegaScanner should be close enough. It was made for the Shortcut, but should be reasonably easy to copy and adapt to reading thumbsticks, or anything else, directly with the 32u4.

1 Like

I know im asking a lot but how can i plug it into kaleidoscope?

1 Like

Something along these lines. The core idea is that there are Hardware plugins, which implement most of the hardware-specific pieces of the puzzle, such as key scanning. These are pulled in by Kaleidoscope via the KALEIDOSCOPE_HARDWARE_H macro, defined in boards.txt.

If you want to create a new device, you’ll need a new hardware plugin (which can either use other libraries, or reimplement things, whichever is more convenient/practical), and a new entry in boards.txt to pull them together.

Then, select the new board in the Arduino IDE, or if using the command line tools, set BOARD to the name of the board you used in boards.txt.

1 Like

thanks! I’ll look into that

1 Like

hello again,

I’ve been looking at the shortcut code and I’ve got mire ir less figured out the matrix scan. But in order to properly emulate a mouse with a thumbstick i need to read two ADCs (0-1023) for the two axis. How should I return that to kaleidoscope? It has to be used to calculate the movement speed of the mouse. Should i do something special?

There are a number of ways to do this, I think. What I would do, is read the ADCs in the hardware plugins scanMatrix function, store the values in two variables, and in your sketch, have a macro that uses these to move the mouse (via MouseKeys).

This is definitely not the most elegant solution, but it is fairly simple.