Programming Teensy LC
Programming Teensy LC
I cannot get the Teensy LC to program correctly. I am very new to this and I know nothing about programming so I am very stuck. I have downloaded the latest version of arduino 1.8.4. I opened it and it opens correctly. I then downloaded the teensyduino software. At first I had some issues, but I disabled my antivirus and it allowed me to download it completely. I then run the arduino project that was written by Wermy. I changed the board to a Teensy LC and changed the USB type to keyboard+mouse+joystick. When I try to run the verify I get an error every time. The error is "Error compiling for board Teensy LC." Can somebody please help me? Thanks!
Re: Programming Teensy LC
I'm having a similar problem, here's where I'm stuck. Unfortunately my coding skills are garbage. I have no idea why *ret isn't working in this instance. Is this where you are stuck as well?
- Attachments
-
- code.JPG (98.32 KiB) Viewed 9194 times
Re: Programming Teensy LC
This is the error that I am coming up with in mine. I have never done programming before, so I am totally stuck! are you using the newest version of Teensy download? I am using 1.38 as that is the newest, and only download I can find.
Build options changed, rebuilding all
In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3\IntervalTimer.h:34:0,
from C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3\IntervalTimer.cpp:31:
C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3\IntervalTimer.cpp: In member function 'void IntervalTimer::end()':
C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3\IntervalTimer.cpp:87:20: error: 'IRQ_PIT_CH0' was not declared in this scope
NVIC_DISABLE_IRQ(IRQ_PIT_CH0 + index);
^
C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3\kinetis.h:5627:68: note: in definition of macro 'NVIC_DISABLE_IRQ'
#define NVIC_DISABLE_IRQ(n) (*((volatile uint32_t *)0xE000E180 + ((n) >> 5)) = (1 << ((n) & 31)))
^
Error compiling for board Teensy LC.
Build options changed, rebuilding all
In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3\IntervalTimer.h:34:0,
from C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3\IntervalTimer.cpp:31:
C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3\IntervalTimer.cpp: In member function 'void IntervalTimer::end()':
C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3\IntervalTimer.cpp:87:20: error: 'IRQ_PIT_CH0' was not declared in this scope
NVIC_DISABLE_IRQ(IRQ_PIT_CH0 + index);
^
C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3\kinetis.h:5627:68: note: in definition of macro 'NVIC_DISABLE_IRQ'
#define NVIC_DISABLE_IRQ(n) (*((volatile uint32_t *)0xE000E180 + ((n) >> 5)) = (1 << ((n) & 31)))
^
Error compiling for board Teensy LC.
Re: Programming Teensy LC
I'm using 1.39, here's the link in the guide that took me there.
https://www.pjrc.com/teensy/td_download.html
https://www.pjrc.com/teensy/td_download.html
Re: Programming Teensy LC
Looking at your code, I would change :
to
The type "Key" is case sensitive. I'm not sure about the "()" after "new Key" so try both ways.
Hope it will help.
Code: Select all
key *ret = new key;
Code: Select all
Key *ret = new Key();
Hope it will help.
Re: Programming Teensy LC
Code: Select all
#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[i].bounce->update();
if (keys[i].bounce->fallingEdge()) {
Keyboard.press(keys[i].keycode);
} else if (keys[i].bounce->risingEdge()) {
Keyboard.release(keys[i].keycode);
}
}
}
Re: Programming Teensy LC
I just deleted everything off my pc and re downloaded everything. When I downloaded everything, I put it all in the same folder together. This is now the error that I am getting:
C:\Users\Jake\AppData\Local\Temp\arduino_build_697432/core\core.a(mk20dx128.c.o): In function `ResetHandler':
C:\Users\Jake\Documents\Gameboy Zero\Arduino\hardware\teensy\avr\cores\teensy3/mk20dx128.c:1130: undefined reference to `main'
C:\Users\Jake\AppData\Local\Temp\arduino_build_697432/core\core.a(pins_teensy.c.o): In function `delay':
C:\Users\Jake\Documents\Gameboy Zero\Arduino\hardware\teensy\avr\cores\teensy3/pins_teensy.c:1197: undefined reference to `yield'
collect2.exe: error: ld returned 1 exit status
Error compiling for board Teensy LC.
I feel like I'm getting closer, but I don't know what any of this means......anybody know?
C:\Users\Jake\AppData\Local\Temp\arduino_build_697432/core\core.a(mk20dx128.c.o): In function `ResetHandler':
C:\Users\Jake\Documents\Gameboy Zero\Arduino\hardware\teensy\avr\cores\teensy3/mk20dx128.c:1130: undefined reference to `main'
C:\Users\Jake\AppData\Local\Temp\arduino_build_697432/core\core.a(pins_teensy.c.o): In function `delay':
C:\Users\Jake\Documents\Gameboy Zero\Arduino\hardware\teensy\avr\cores\teensy3/pins_teensy.c:1197: undefined reference to `yield'
collect2.exe: error: ld returned 1 exit status
Error compiling for board Teensy LC.
I feel like I'm getting closer, but I don't know what any of this means......anybody know?
-
- Posts: 2
- Joined: Wed Oct 18, 2017 1:11 pm
Re: Programming Teensy LC
Same problem. Arduino version 1.8.5. Teensy version 1.40. Code by Wermy.
Error compiling for board teensy lc.
The project is at a standstill until this is rectified.
Any help please?
Error compiling for board teensy lc.
The project is at a standstill until this is rectified.
Any help please?
Who is online
Users browsing this forum: Bing [Bot] and 1 guest