Author Topic: Working on a 2-key board  (Read 2785 times)

0 Members and 1 Guest are viewing this topic.

Offline mkHeinzen

  • Thread Starter
  • Posts: 7
Working on a 2-key board
« on: Mon, 06 July 2015, 08:46:05 »
Hey, long time lurker, just registered. Sorry if this isn't the proper area, but I think it might be :)

I am currently working on a 2-key keyboard, where I am assembling everything from scratch and using a regular ATtiny85 (with arduino bootloader) controller. Right now I am doing things with a DigiSpark.

I have encountered a problem that I can't fix as of now. This controller uses V-USB implementation and a few things aren't working the way I want them to. Since I don't know a lot about V-USB, I am struggling to rewrite the libraries that are responsible for this.

Mainly my problem is that the current implementation can only send keystrokes instead of read events (key_down, key_up, is_down, etc).

For example, if you hold a switch down, you get roughly 450 actual strokes per minute instead of a "hold effect"/single input.

I have been trying to get the code fixed but I don't have much spare time as of now, so I thought about asking people who know better :)

Is it worth reimplementing the USB firmware/module to do what I need, or are there other controllers that have hardware implementation for USB control at the same price range ($1.50)?

I thought that it would be the perfect solution for my problem as I am controlling lighting, inputs and everything with the exact number of available ports (5). Although this issue seems to be blocking the most important part of this.

Cheers!

Offline blahlicus

  • Posts: 17
  • Location: hong kong
    • UniqueK | DIY keyboards, etc
Re: Working on a 2-key board
« Reply #1 on: Mon, 06 July 2015, 17:45:18 »
i am not entirely sure as i never worked with the digispark

but the link you provided said that the digispark is compatible with arduino IDEs 1.0+

have you tried the arudino Keyboard.press() and Keyboard.release() functions?

Offline user 18

  • * Senior Moderator
  • Posts: 2231
  • Location: Deutschland
Re: Working on a 2-key board
« Reply #2 on: Mon, 06 July 2015, 17:55:15 »
You can get an Arduino pro micro on ebay in the $7.00 USD range, if you're looking for a different controller. It uses an ATmega 32u4, so it shouldn't be too difficult to get any of the keyboard firmwares written for the teensy 2.0 working on it.

I'm not sure what the point is of V-USB in particular -- I'd also recommend using just the Arduino commands. There's a tutorial around somewhere about adjusting arduino code to allow you to send scan reports, which is quite useful.
Please PM me if you are waiting on classifieds approval or have a question about the classifieds rules. | geekhack Terms of Service

Max Nighthawk x8 (MX Brown) | CM QFR (MX Blue) | CM QFR (MX Clear) | RK-9000 (MX Red) | Model M 1391401 | Model M SSK 1370475 | CM Novatouch | G80-8113 (MX Clear) | 60% (85g MX Blue) | Whitefox Aria (MX Clear) | CL-LX (MX Clear) | Mira SE (MX Clear)
Avatar by ashdenej

Offline neverused

  • Posts: 572
Re: Working on a 2-key board
« Reply #3 on: Mon, 06 July 2015, 18:19:33 »
Look into the adafruit trinket, there's good documentation for it

Offline hasu

  • Posts: 3475
  • Location: Tokyo, Japan
  • @tmk
    • tmk keyboard firmware project
Re: Working on a 2-key board
« Reply #4 on: Mon, 06 July 2015, 21:21:05 »
I never used V-USB on ATTiny but I'm sure it works on ATMega like charm as a keyboard.

If V-USB has problem with ATTiny it is really worth fixing it for many people including me. I'd want to use it with ATTiny someday in the future.

If you don't have time to work on how about throw your current code somewhere so that anyone can see and fix it?

Offline mkHeinzen

  • Thread Starter
  • Posts: 7
Re: Working on a 2-key board
« Reply #5 on: Tue, 07 July 2015, 11:45:01 »
i am not entirely sure as i never worked with the digispark

but the link you provided said that the digispark is compatible with arduino IDEs 1.0+

have you tried the arudino Keyboard.press() and Keyboard.release() functions?

That won't work as it is for Leonardo-based boards, tried that already :(

Look into the adafruit trinket, there's good documentation for it

Almost 3x the price tag of the DigiSpark, since I plan on doing GB later on, it would raise the value quite a bit as I will have to pay taxes for them, which in the end would result in something aroung ~13USD per unit

You can get an Arduino pro micro on ebay in the $7.00 USD range, if you're looking for a different controller. It uses an ATmega 32u4, so it shouldn't be too difficult to get any of the keyboard firmwares written for the teensy 2.0 working on it.

I'm not sure what the point is of V-USB in particular -- I'd also recommend using just the Arduino commands. There's a tutorial around somewhere about adjusting arduino code to allow you to send scan reports, which is quite useful.

Same as above, almost the pricetag of the Trinket, and if I am swapping to something to that range, I'd go for the Trinket controller as I have done previous things with it.

I never used V-USB on ATTiny but I'm sure it works on ATMega like charm as a keyboard.

If V-USB has problem with ATTiny it is really worth fixing it for many people including me. I'd want to use it with ATTiny someday in the future.

If you don't have time to work on how about throw your current code somewhere so that anyone can see and fix it?

I will resume working on it with a friend, maybe upload the progress in a git or something and have people contribute with it. If you wanna take a look at the official implementation, here's their github. You might wanna check DigiKeyboard.h and usbdrv.h/.c

I will report progress whenever I have some :)

Cheers!
« Last Edit: Tue, 07 July 2015, 11:49:57 by mkHeinzen »

Offline mkHeinzen

  • Thread Starter
  • Posts: 7
Re: Working on a 2-key board
« Reply #6 on: Tue, 21 July 2015, 08:08:05 »
UPDATE:

I got the code on the microcontroller working!!

I was doing some reading and noticed that Adafruit's Trinket has pretty much what DigiSpark doesn't. A proper key-report on V-USB side. What I had to do was modify little parts of the lower-level parts of the usb driver of the Trinket and simply use that lib on my DigiSpark.

Working as intended.

I am now about to work on the customized lighting and will also work on the CAD models so I can get quotations for 3d printing.

____________________

Any suggestions for the case part? I need the bottom-half to translucid and the upper-half to be opaque. I thought that 3D FDM printing would be a cheap and good solution for a big-volume production (60-70 units of these).

I have no idea what other options I got, and, as I don't have any machines for that at my place, I am going to have that industrialized.
« Last Edit: Tue, 21 July 2015, 08:11:37 by mkHeinzen »

Offline mkHeinzen

  • Thread Starter
  • Posts: 7
Re: Working on a 2-key board
« Reply #7 on: Fri, 07 August 2015, 09:00:36 »
Update:

Took me a while to get things going again. Things at work and uni are speeding up, it's hard to find spare time for this.

Either way, I finished up the code for the microcontroller for lighting and input threatment (thank you based arduino for input interruptions)

I also made one PCB in my university that I will use for the prototype. Will get them done by some company to tidy things up whenever I start mass-producing these things.

Here's a pic of the pcb. Didn't drill it yet, but it is now correded. Plan on doing final tests on a breadboard this weekend and solder things on sunday or monday.

I still haven't figured out a good/budget method of doing the cases. I considered 3D printing, but I think it might be rather expensive for a large-scale production (so far I have ~90 people interested in this). The one company wants to charge me 15USD per hour of 3d printing.
« Last Edit: Fri, 07 August 2015, 09:32:01 by mkHeinzen »

Offline 27

  • Posts: 752
  • Location: Ottawa, Ontario, Canadeh
  • The Maple Man
Re: Working on a 2-key board
« Reply #8 on: Fri, 07 August 2015, 10:25:37 »
Update:

Took me a while to get things going again. Things at work and uni are speeding up, it's hard to find spare time for this.

Either way, I finished up the code for the microcontroller for lighting and input threatment (thank you based arduino for input interruptions)

I also made one PCB in my university that I will use for the prototype. Will get them done by some company to tidy things up whenever I start mass-producing these things.

Here's a pic of the pcb. Didn't drill it yet, but it is now correded. Plan on doing final tests on a breadboard this weekend and solder things on sunday or monday.

I still haven't figured out a good/budget method of doing the cases. I considered 3D printing, but I think it might be rather expensive for a large-scale production (so far I have ~90 people interested in this). The one company wants to charge me 15USD per hour of 3d printing.

I could help with the 3D printing.  The company I work for does it by volume only.  We don't take online orders, but I could get them printed and sent to you. (Also with our printing you can do full colour)  Feel free to PM me and I can figure out a price.
IG: https://www.instagram.com/27mechs/                                        Website: http://www.mech27.com/