Programming Teensy LC

Having trouble with your GBZ build? Ask your questions here!
jakers10
Posts: 14
Joined: Mon Sep 04, 2017 10:14 am
Has thanked: 1 time

Programming Teensy LC

Post by jakers10 » Mon Sep 04, 2017 10:22 am

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!

Dmgough22
Posts: 1
Joined: Mon Sep 04, 2017 9:57 am

Re: Programming Teensy LC

Post by Dmgough22 » Tue Sep 05, 2017 4:46 pm

I am also having the same problem. Anyone have any ideas?

JBDozaboy
Posts: 2
Joined: Sat Sep 09, 2017 12:29 pm
Been thanked: 1 time

Re: Programming Teensy LC

Post by JBDozaboy » Sat Sep 09, 2017 1:32 pm

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
code.JPG (98.32 KiB) Viewed 9194 times

jakers10
Posts: 14
Joined: Mon Sep 04, 2017 10:14 am
Has thanked: 1 time

Re: Programming Teensy LC

Post by jakers10 » Sat Sep 09, 2017 3:53 pm

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.

JBDozaboy
Posts: 2
Joined: Sat Sep 09, 2017 12:29 pm
Been thanked: 1 time

Re: Programming Teensy LC

Post by JBDozaboy » Mon Sep 11, 2017 1:05 pm

I'm using 1.39, here's the link in the guide that took me there.

https://www.pjrc.com/teensy/td_download.html

jakers10
Posts: 14
Joined: Mon Sep 04, 2017 10:14 am
Has thanked: 1 time

Re: Programming Teensy LC

Post by jakers10 » Mon Sep 11, 2017 8:59 pm

I get the same error 1.39. I just can't figure this out!

User avatar
woans
Posts: 15
Joined: Fri Aug 18, 2017 4:52 pm
Been thanked: 9 times

Re: Programming Teensy LC

Post by woans » Tue Sep 19, 2017 7:22 pm

Looking at your code, I would change :

Code: Select all

key *ret = new key;
to

Code: Select all

Key *ret = new Key();
The type "Key" is case sensitive. I'm not sure about the "()" after "new Key" so try both ways.

Hope it will help.

jakers10
Posts: 14
Joined: Mon Sep 04, 2017 10:14 am
Has thanked: 1 time

Re: Programming Teensy LC

Post by jakers10 » Sat Sep 23, 2017 7:21 pm

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);
    }
  }
}

This is the code that I have that is not working. Is this how everybody else' code looks? Can somebody see something wrong with this?

jakers10
Posts: 14
Joined: Mon Sep 04, 2017 10:14 am
Has thanked: 1 time

Re: Programming Teensy LC

Post by jakers10 » Sun Sep 24, 2017 7:01 pm

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?

Hoshosslehoff
Posts: 2
Joined: Wed Oct 18, 2017 1:11 pm

Re: Programming Teensy LC

Post by Hoshosslehoff » Wed Oct 18, 2017 1:17 pm

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?

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest