PDA

View Full Version : Teensy Blink on Teensy 1.0



Markus_L811
12-31-2013, 10:04 PM
Hello,

on my own I'm a huge fan of the Blink example. So I did my part on it and make it more comfortable for me, code below.



/* LED Blink, Teensyduino Tutorial #1
http://www.pjrc.com/teensy/tutorial.html

This example code is in the public domain.
*/

// Teensy 2.0 has the LED on pin 11
// Teensy++ 2.0 has the LED on pin 6
// Teensy 3.0 has the LED on pin 13
#if defined(__MK20DX128__) || defined(__MK20DX256__)
// Teensy 3.0 Teensy 3.1
#define ledPin 13
#elif defined (__AVR_ATmega32U4__)
// Teensy 2.0
#define ledPin 11
#elif defined(__AVR_AT90USB162__) || defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB1286__)
// Teensy 1.0 Teensy 1.0++ Teensy 2.0++
#define ledPin 6
#else
#define ledPin 13
#endif

//const int ledPin = Pin;

int timing = 125;

// the setup() method runs once, when the sketch starts

void setup() {
// initialize the digital pin as an output.
pinMode(ledPin, OUTPUT);
}

// the loop() methor runs over and over again,
// as long as the board has power

void loop() {
digitalWrite(ledPin, HIGH); // set the LED on
delay(timing); // wait for a second
digitalWrite(ledPin, LOW); // set the LED off
delay(timing); // wait for a second
}


So I tested it on Arduino IDE 1.0.5 with Teensyduino 1.18RC all works fine except for Teensy 1.0 there I get this:



This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.
Arduino: 1.0.5 (Windows 7), Board: "Teensy 1.0"
C:\Users\HP\AppData\Local\Temp/ccPO5Vzc.s: Assembler messages:
C:\Users\HP\AppData\Local\Temp/ccPO5Vzc.s:198: Error: illegal opcode mul for mcu at90usb162
C:\Users\HP\AppData\Local\Temp/ccPO5Vzc.s:203: Error: illegal opcode mul for mcu at90usb162
C:\Users\HP\AppData\Local\Temp/ccPO5Vzc.s:207: Error: illegal opcode mul for mcu at90usb162
C:\Users\HP\AppData\Local\Temp/ccPO5Vzc.s:211: Error: illegal opcode mul for mcu at90usb162
C:\Users\HP\AppData\Local\Temp/ccPO5Vzc.s:237: Error: illegal opcode mul for mcu at90usb162


On Arduino IDE 1.0.4 with Teensy 1.14RC2 it compiled fine. So what did I do wrong?

el_supremo
12-31-2013, 10:23 PM
I don't know where the error messages came from but you can remove all the ifdef stuff and replace it with:

#define ledPin LED_BUILTIN

Pete

Markus_L811
01-01-2014, 10:42 AM
I don't know where the error messages came from but you can remove all the ifdef stuff and replace it with:

#define ledPin LED_BUILTIN

Pete

Jepp less code, nice to know but same error...

PaulStoffregen
01-01-2014, 12:14 PM
The Teensy 1.0 code is no longer maintained. I'll probably drop Teensy 1.0 support completely in 1.18 or 1.19.

Markus_L811
01-01-2014, 02:03 PM
The Teensy 1.0 code is no longer maintained. I'll probably drop Teensy 1.0 support completely in 1.18 or 1.19.

Ah ok, since Version 1.18 or befor, I don't have an Teensy 1.0 but maybe for other it's interesting.

Happy new Year, Paul.