duckythescientist / BinaryKeyboard

1 and 0 are the only keys a true programmer needs
91 stars 7 forks source link

Could not get it to work #5

Open gokalpsterr opened 5 years ago

gokalpsterr commented 5 years ago

I tried to build one for myself but for some reason I don't get any errors, but it just does not work (Nothing happens when I press the buttons in any mode). I started the project like a year ago and after I didn't succeed, I left it for some time, today I checked again with the help of a programmer friend and we followed everything according to your guide but no luck.

Please help to solve what I am doing wrong. Thank you @duckythescientist

duckythescientist commented 5 years ago

I'm going to need more information than this. http://www.catb.org/esr/faqs/smart-questions.html#beprecise and https://www.chiark.greenend.org.uk/~sgtatham/bugs.html have some good suggestions.

Start by flashing the example DigiKeyboard script that comes with the Digispark install. This will narrow down the problem.

#include "DigiKeyboard.h"

void setup() {
  // don't need to set anything up to use DigiKeyboard
}

void loop() {
  // this is generally not necessary but with some older systems it seems to
  // prevent missing the first character after a delay:
  DigiKeyboard.sendKeyStroke(0);

  // Type out this string letter by letter on the computer (assumes US-style
  // keyboard)
  DigiKeyboard.println("Hello Digispark!");

  // It's better to use DigiKeyboard.delay() over the regular Arduino delay()
  // if doing keyboard stuff because it keeps talking to the computer to make
  // sure the computer knows the keyboard is alive and connected
  DigiKeyboard.delay(5000);
}
gokalpsterr commented 5 years ago

Okay, yeah you are right. I should have been more clear.

So first of all thanks for replying, I tested the piece of code you sent and it worked. It printed "Hello Digispark!" every 5 seconds as expected.

I also checked all of my (3) buttons with a multimeter and controlled if they are seen by the board and it seems as there is no hardware related issue so either I am trying to upload something wrong or maybe a library is corrupted.

What should I try next?

duckythescientist commented 5 years ago

The compile/upload process should be the same as the snippet for the last comment, and the only library (other than the Arduino/Digispark internal stuffs) is DigiKeyboard.h, but we know that that is working.

When you plug in the keyboard, make sure you aren't pushing any of the buttons. It should default to "Mode 0" -- the simple mode where it types 0, 1, and [enter]. I just did a re-flash from a clean Arduino install, and everything is working for me. I was having some issues getting the board to flash, but that was a USB 2 vs 3 issue. Once flashed, that's no longer an issue.

Maybe take my code and cut it to the bare minimum where it only has that mode?

gokalpsterr commented 5 years ago

Yeah, I exactly do the same process as I did to the comment that you sent, and it is so weird: It uploads and still when I boot without pressing any buttons, there is no reaction. I tried a very simple (bare minimum) code and that didn't work either.

I guess the problem is that my Digispark board is not getting the inputs or at least behaves like, not sure what to do with them. The simple 1 / 0 / Enter didn't work at all so I guess it is definately about the inputs. (My buttons work individually but not registered by Digispark board)

Maybe I should burn bootloader again ? I mean It had one when it came and as I was successful with uploading a code, I didn't think it was necessary to do so. Should I try that or simply try all on another board just to be sure ?

Thanks for helping btw, I really appreciate it.

duckythescientist commented 5 years ago

I wouldn't bother to burn the bootloader again, but that's not outside of the realm of possibility.

Double check your hardware? Make sure that your switches are wired to the correct pins on the Digispark and that the other side of the switches all go back to ground. Use a multimeter and measure the voltage on each Digispark pin (connected to a switch) with respect to ground. You should see about 5V when unpressed and 0V when pressed.

I'm not sure what else there is to try.

gokalpsterr commented 5 years ago

So I found another one of those Attiny85 Digispark boards and that seemed a bit different, to be honest, and now that I tried I still have the same problem. I try/do exactly as you say and it somehow doesn't work :( I noticed that I didn't let you know about one thing though: when I press the button on some of the pins the board actually gets reset so I am wondering If I really should burn a new bootloader. (the new one is fresh not even opened before) Could you please send a picture of the board you have? I just want to check if we are on the same page.

Thank you