test1
April 27, 2017, 07:51:04 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: You can attach photos hosted by the forum rather than using an external image hosting site, this means they will stay forever and not disappear after a year or two.
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: CintCont - A HID Controller for Cintiq Clones of any kind  (Read 2064 times)
XDjackieXD
Full Member
***
Posts: 124


*me trying to draw*


View Profile WWW
« on: November 10, 2014, 09:25:03 PM »

Hi everyone!
Today I started to tinker around with my USnooBie (http://eleccelerator.com/usnoobie/) and V-USB.
The USnooBie basically is a Atmega328 with a 12MHz crystal and a V-USB based usbasp-emulating bootloader.

I thought that it would be a much cleaner solution to build my own input device than using a few USB mice like in many other builds I saw here so I googled a bit and found this: http://www.fredrikolofsson.com/pages/hardware.html
So I ported his code to my Atmega328 based board (basically just swapping a few pins around) and tried to map the HID in gimp.
But unfortunately it didn't work... (but it did with evtest and also gimp was happily logging input events)
After a bit of digging in the gimp-code I noticed that gimp won't work with absolute analog input (guess what I was using?   Grin).
So after editing the code to work with the newest avr-gcc and using relative input everything worked as expected.

YEAH! I got a input device with 8 Buttons and five rotary encoders (I used high resolution ones that don't have these "clicks") and it works like a charm to controll things like brush size or opacity in gimp!

Pinout is the following:
USB D- PD7
USB D+ PD2

Encoder0: PD0+1
Encoder1: PD3+4
Encoder2: PD5+6
Encoder3: PB0+1
Encoder4: PB2+3

4021 Shift Register (for Buttons):
clock: PB4
par/ser: PB5
Q8: PC0

Code as a zip (just remove txt extension):
* CintCont.zip.txt (131.92 KB - downloaded 120 times.)

* CintCont.zip.txt (131.92 KB - downloaded 120 times.)
Logged
Aerendraca
Administrator
Hero Member
*****
Posts: 1057


View Profile
« Reply #1 on: November 11, 2014, 12:20:44 PM »

Nice! What a great little device.

I've not heard of this USnooBie before but it seems like a very accessible way to create your own shortcut keys. I can imagine plenty of situation where this little device would save a whole bunch of time and allow you to pull off some very nice setups cheaply and quickly. I might get myself one and have a play!
Logged
DaBotz
Sr. Member
****
Posts: 179



View Profile WWW
« Reply #2 on: November 11, 2014, 07:26:22 PM »

I can't open the zip, after downloading the file... I fear the .txt is treated as an ascii, somewhere in the chain that pulls the fille to my PC.

Anyway, this is a hugely interesting development...
Logged

The most incredible artist of... Barbanza?
XDjackieXD
Full Member
***
Posts: 124


*me trying to draw*


View Profile WWW
« Reply #3 on: November 12, 2014, 05:53:20 PM »

Yeah I used the USnooBie because I had one... The finished version will be using an AtMega8 (because it's cheaper and the program fits in 8k easily)

I uploaded the zip to two different locations:
http://server.network-time.org/public.php?service=files&t=425e5a9ffa3d04cbe7735bc6420850bf
https://mega.co.nz/#!Bxox1LiY!qaiYNIurYuCRqajNAKJHJJAkSKF7F8ZgDc6aFSM1sn0
(maybe could someone with enough rights upload it here?)

-Jakob
Logged
sinusoid
New Poster
*
Posts: 15


View Profile
« Reply #4 on: March 06, 2016, 06:21:56 PM »

Necro, but...

Wow, this is ingenious! Did you manage to finish it? Do you have pics of your build, or some usage vids?
I was thinking about getting a separate controller for brush variables for a long time. Clicking menu items gives a lot of overhead to the drawing process, and incremental changes via keyboard are... bad, to say the least.
Logged
XDjackieXD
Full Member
***
Posts: 124


*me trying to draw*


View Profile WWW
« Reply #5 on: March 06, 2016, 11:16:30 PM »

Necro, but...

Wow, this is ingenious! Did you manage to finish it? Do you have pics of your build, or some usage vids?
I was thinking about getting a separate controller for brush variables for a long time. Clicking menu items gives a lot of overhead to the drawing process, and incremental changes via keyboard are... bad, to say the least.
I don't have any pictures (it was just a USnooBie connected to a few rotary encoders with jumper wires ^^).
The code is pretty much finished and working (it emulates a usb gamepad that you can configure for brush size and other things in GIMP).
The reason I never built it further is that I fell in love with Krita but it doesn't have the ability to use analogue axis as input for shortcuts.
If you have any questions feel free to ask Smiley
Logged
sinusoid
New Poster
*
Posts: 15


View Profile
« Reply #6 on: March 07, 2016, 01:00:03 PM »

Ha, a fellow Krit...ter...er? Cheesy
Yeah, Krita is awesome! it merges all the nice brushes and functions from MyPaint, Alchemy, Gimp, and adds a lot of its own. Fell in love with this software quite a while ago.

I wanted to get some hardware specifically for Krita - I use a convertible laptop and I'm often drawing on the run. The most comfy way to use it is to have it flipped with the keyboard outwards, so it acts a bit like an easel, with screen close to you, positioned at an angle. But that makes it impossible to use the keyboard, so I have to keep the application interface visible most of the time.

I was pondering building a controller specifically for Krita. Though what you're writing makes it quite worrisome.

I'll have to look into it, if it has some sort of an API that can be used. Or hook up to the vars directly in memory, and change them with an external process... but that would be really hacky and possibly unstable. 
Did you talk to the devs about it?

Getting a similar thing for Blender is really easy, you can call every variable in the app with arduino and pyserial, and it works both ways.
Logged
XDjackieXD
Full Member
***
Posts: 124


*me trying to draw*


View Profile WWW
« Reply #7 on: March 07, 2016, 06:40:34 PM »

I never tried using a controller with krita but a good indicator should be to connect a random usb gamepad (nothing with xinput like the xbox controller) and try if you can map ANALOG AXIS(!) to a shortcut like pen size.
If it doesn't work you could either create a better button/function mapping interface for krita or change the code of the controller to emulate keypresses (like wheel down -> key pen size down and such).
The thing I really love about Gimp is, that the input configuration is very dynamic and supports lots of inputs (Graphics tablet buttons, gamepads, multiple keyboards with per-keyboard keymappings, multiple mice scrollwheels, .....). This is sadly missing in Krita as far as I can tell.
Logged
Pages: [1]
  Print  
 
Jump to:  


Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!