Check out prerunnerseth's topic on this: http://www.sudomod.com/forum/viewtopic.php?p=525Sprockett wrote:Thank You...
I can fit the teensy, but I really want to conserve space, I'm even etching my own control pad with extra room for the audio components from the Zero...
I would like to see the GPIO layout, I was worried it would interfere with the sound output...
Teensy Lc
- crispy_tofu
- Posts: 340
- Joined: Thu May 05, 2016 1:51 am
- Location: Australia
- Been thanked: 5 times
Re: Teensy Lc
- crispy_tofu
- Posts: 340
- Joined: Thu May 05, 2016 1:51 am
- Location: Australia
- Been thanked: 5 times
Re: Teensy Lc
I. NEED. HELP.
I am building a gameboy zero. I have all the components in place. Except for the arduino code on my teensy. I keep getting this error when I try to write it onto my teensy:
Game_Boy_Zero:7: error: 'Key' does not name a type
Here is the code in question: (Please help. I'm going crazy.)
#include <Bounce.h>
#define NUM_KEYS 12
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);
}
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);
}
}
}
I am building a gameboy zero. I have all the components in place. Except for the arduino code on my teensy. I keep getting this error when I try to write it onto my teensy:
Game_Boy_Zero:7: error: 'Key' does not name a type
Here is the code in question: (Please help. I'm going crazy.)
#include <Bounce.h>
#define NUM_KEYS 12
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);
}
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);
}
}
}
- wermy
- Site Admin
- Posts: 1346
- Joined: Tue May 03, 2016 8:51 pm
- Has thanked: 620 times
- Been thanked: 1322 times
- Contact:
Re: Teensy Lc
Have you gone through the Arduino IDE setup for getting it to let you write to the Teensy? Are you able to run other example sketches on it (like the "blink" one that just blinks the onboard LED)?samboy555 wrote:I. NEED. HELP.
Re: Teensy Lc
samboy555 wrote:Yeah, it's all good to go. It's just this code. Line seven. It doesn't like it.
Ever figure out how to fix this error message? Seems like you and I are the only two to have this problem.
- DirtyBullets
- Posts: 137
- Joined: Tue May 17, 2016 4:05 pm
- Location: Lowestoft, UK
- Has thanked: 5 times
- Been thanked: 42 times
- Contact:
Re: Teensy Lc
I fixed it! Try downloading an older version of the Arduino software.Codeyvh wrote:samboy555 wrote:Yeah, it's all good to go. It's just this code. Line seven. It doesn't like it.
Ever figure out how to fix this error message? Seems like you and I are the only two to have this problem.
-
- Posts: 4
- Joined: Wed Dec 05, 2018 10:42 am
- Been thanked: 1 time
Re: Teensy Lc
Hi, is it me, or the link from wermys guide to the arduino code is broken?
It doesnt open anything to me
Thanks
It doesnt open anything to me
Thanks
Who is online
Users browsing this forum: No registered users and 1 guest