Page 1 of 1
Teensy problem
Posted: Mon Feb 05, 2018 7:30 am
by Silverboulton
Ok first time using a teensy and the problem I'm having is really odd, all buttons work as keybored pushes ( up is w down is s and so on) it works in the retropie menu but freezes at boot up of any Rom, If I boot a Rom with a snes usb pad and replug in the teensy it will work as controller

Re: Teensy problem
Posted: Mon Feb 05, 2018 10:33 am
by wermy
Silverboulton wrote: ↑Mon Feb 05, 2018 7:30 am
Ok first time using a teensy and the problem I'm having is really odd, all buttons work as keybored pushes ( up is w down is s and so on) it works in the retropie menu but freezes at boot up of any Rom, If I boot a Rom with a snes usb pad and replug in the teensy it will work as controller
When you say it freezes at boot, do you mean it locks up the whole system? Or does it just kick you back to emulationstation? I wonder if maybe you're getting double button presses or something that's aborting the rom loading.

Re: Teensy problem
Posted: Mon Feb 05, 2018 11:29 am
by Silverboulton
It's stays on black screen with white box (push a to open menu) If I push any button the key it's mapped to shows on the bottom left of screen (press up a W shows). If I use a usb controller it boots up fine so it's not the Rom or emulater???
Re: Teensy problem
Posted: Mon Feb 05, 2018 11:39 am
by Silverboulton
This is what is loaded on the teensy I added 2 more keys for R2 and L2 could that be the problem???
#include <Bounce.h>
#define NUM_KEYS 14
struct Key {
char keycode;
Bounce* bounce;
};
Key keys[NUM_KEYS];
Key key(char keycode, int pin) {
Key *ret = new Key;
ret->keycode = keycode;
ret->bounce = new Bounce(pin, 10);
pinMode(pin, INPUT_PULLUP);
return *ret;
}
void setupKeys() {
keys[0] = key('w, 0);
keys[1] = key('s', 1);
keys[2] = key('a', 2);
keys[3] = key('d', 3);
keys[4] = key('p', 4);
keys[5] = key('l', 5);
keys[6] = key('o', 6);
keys[7] = key('k', 7);
keys[8] = key('x', 8);
keys[9] = key('z', 9);
keys[10] = key('q',10);
keys[11] = key('e',11);
keys[12] = key('r',12);
keys[13] = key('t',13);
}
void setup() {
setupKeys();
Keyboard.begin();
// pinMode(0, INPUT_PULLUP);
}
void loop() {
for (int i = 0; i < NUM_KEYS; i++) {
keys.bounce->update();
if (keys.bounce->fallingEdge()) {
Keyboard.press(keys.keycode);
} else if (keys.bounce->risingEdge()) {
Keyboard.release(keys.keycode);
}
}
}
Re: Teensy problem
Posted: Mon Feb 05, 2018 4:36 pm
by Silverboulton
Sorted now loaded different code joystick buttons instead of keybored all working fine
Re: Teensy problem
Posted: Sun Feb 18, 2018 8:05 am
by twinturbo
Silverboulton wrote: ↑Mon Feb 05, 2018 4:36 pm
Sorted now loaded different code joystick buttons instead of keybored all working fine
Could you elaborate more on what you did? I am having the same problem. Also I am very new to all of this.