
Teensy problem
-
- Posts: 4
- Joined: Sun Feb 04, 2018 4:48 pm
Teensy problem
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 

- wermy
- Site Admin
- Posts: 1346
- Joined: Tue May 03, 2016 8:51 pm
- Has thanked: 620 times
- Been thanked: 1322 times
- Contact:
Re: Teensy problem
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.Silverboulton wrote: ↑Mon Feb 05, 2018 7:30 amOk 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![]()

-
- Posts: 4
- Joined: Sun Feb 04, 2018 4:48 pm
Re: Teensy problem
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???
-
- Posts: 4
- Joined: Sun Feb 04, 2018 4:48 pm
Re: Teensy problem
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);
}
}
}
#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);
}
}
}
Last edited by Silverboulton on Mon Feb 05, 2018 4:38 pm, edited 1 time in total.
-
- Posts: 4
- Joined: Sun Feb 04, 2018 4:48 pm
Re: Teensy problem
Sorted now loaded different code joystick buttons instead of keybored all working fine
Re: Teensy problem
Could you elaborate more on what you did? I am having the same problem. Also I am very new to all of this.Silverboulton wrote: ↑Mon Feb 05, 2018 4:36 pmSorted now loaded different code joystick buttons instead of keybored all working fine
Who is online
Users browsing this forum: No registered users and 1 guest