Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 4 of 4

Thread: I bought a Teensy today and can't get it working

  1. #1
    Junior Member
    Join Date
    Mar 2019
    Posts
    12

    I bought a Teensy today and can't get it working

    Teensy 3.6 arrived this afternoon. I've never used one before, nor Arduino or any other such thing. I am a coder though, so I'm not completely clueless. Anyway:

    - Plugged the little guy in, got the expected blinking LED

    - I followed the instructions here to setup the IDE (on Mac): https://www.pjrc.com/teensy/td_download.html

    - I selected Tools > Board > Teensy 3.6

    - I selected File > Examples > Teensy > Tutorial1 > Blink (code below)

    Code:
    /* 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.x / Teensy LC have the LED on pin 13
    const int ledPin = 13;
    
    // 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(1000);                  // wait for a second
      digitalWrite(ledPin, LOW);    // set the LED off
      delay(1000);                  // wait for a second
    }
    - I click "Verify", and the following error occurs during compilation:

    Code:
    In file included from /Users/craig/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy3/core_pins.h:34:0,
                     from /Users/craig/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy3/wiring.h:38,
                     from /Users/craig/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy3/WProgram.h:45,
                     from /Users/craig/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy3/Arduino.h:6,
                     from /var/folders/3x/q25vfyxj7m3d0f7s33_by11hgpw8qd/T/arduino_build_968699/sketch/sketch_feb28a.ino.cpp:1:
    /Users/craig/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy3/kinetis.h:764:12: error: operator '==' has no left operand
     #if (F_CPU == 256000000)
                ^
    /Users/craig/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy3/kinetis.h:771:14: error: operator '==' has no left operand
     #elif (F_CPU == 240000000)
                  ^
    /Users/craig/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy3/kinetis.h:779:14: error: operator '==' has no left operand
     #elif (F_CPU == 216000000)
                  ^
    /Users/craig/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy3/kinetis.h:787:14: error: operator '==' has no left operand
     #elif (F_CPU == 192000000)
                  ^
    /Users/craig/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy3/kinetis.h:795:14: error: operator '==' has no left operand
     #elif (F_CPU == 180000000)
                  ^
    /Users/craig/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy3/kinetis.h:802:14: error: operator '==' has no left operand
     #elif (F_CPU == 168000000)
                  ^
    /Users/craig/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy3/kinetis.h:806:14: error: operator '==' has no left operand
     #elif (F_CPU == 144000000)
                  ^
    /Users/craig/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy3/kinetis.h:813:14: error: operator '==' has no left operand
     #elif (F_CPU == 120000000)
                  ^
    /Users/craig/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy3/kinetis.h:820:14: error: operator '==' has no left operand
     #elif (F_CPU == 96000000)
                  ^
    /Users/craig/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy3/kinetis.h:827:14: error: operator '==' has no left operand
     #elif (F_CPU == 72000000)
                  ^
    /Users/craig/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy3/kinetis.h:834:14: error: operator '==' has no left operand
     #elif (F_CPU == 48000000)
                  ^
    /Users/craig/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy3/kinetis.h:842:14: error: operator '==' has no left operand
     #elif (F_CPU == 24000000)
                  ^
    /Users/craig/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy3/kinetis.h:846:14: error: operator '==' has no left operand
     #elif (F_CPU == 16000000)
                  ^
    /Users/craig/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy3/kinetis.h:850:14: error: operator '==' has no left operand
     #elif (F_CPU == 8000000)
                  ^
    /Users/craig/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy3/kinetis.h:854:14: error: operator '==' has no left operand
     #elif (F_CPU == 4000000)
                  ^
    /Users/craig/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy3/kinetis.h:858:14: error: operator '==' has no left operand
     #elif (F_CPU == 2000000)
                  ^
    In file included from /Users/craig/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy3/core_pins.h:34:0,
                     from /Users/craig/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy3/wiring.h:38,
                     from /Users/craig/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy3/WProgram.h:45,
                     from /Users/craig/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy3/Arduino.h:6,
                     from /var/folders/3x/q25vfyxj7m3d0f7s33_by11hgpw8qd/T/arduino_build_968699/sketch/sketch_feb28a.ino.cpp:1:
    /Users/craig/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy3/kinetis.h:5736:41: error: operator '&&' has no right operand
     #if defined(HAS_KINETIS_HSRUN) && F_CPU > 120000000
                                             ^
    In file included from /Users/craig/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy3/core_pins.h:35:0,
                     from /Users/craig/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy3/wiring.h:38,
                     from /Users/craig/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy3/WProgram.h:45,
                     from /Users/craig/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy3/Arduino.h:6,
                     from /var/folders/3x/q25vfyxj7m3d0f7s33_by11hgpw8qd/T/arduino_build_968699/sketch/sketch_feb28a.ino.cpp:1:
    /Users/craig/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy3/pins_arduino.h:260:11: error: operator '>=' has no left operand
     #if F_CPU >= 20000000 && !defined(USB_DISABLED)
               ^
    In file included from /Users/craig/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy3/wiring.h:38:0,
                     from /Users/craig/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy3/WProgram.h:45,
                     from /Users/craig/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy3/Arduino.h:6,
                     from /var/folders/3x/q25vfyxj7m3d0f7s33_by11hgpw8qd/T/arduino_build_968699/sketch/sketch_feb28a.ino.cpp:1:
    /Users/craig/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy3/core_pins.h:2026:11: error: operator '==' has no left operand
     #if F_CPU == 256000000
               ^
    /Users/craig/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy3/core_pins.h:2028:13: error: operator '==' has no left operand
     #elif F_CPU == 240000000
                 ^
    /Users/craig/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy3/core_pins.h:2030:13: error: operator '==' has no left operand
     #elif F_CPU == 216000000
                 ^
    /Users/craig/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy3/core_pins.h:2032:13: error: operator '==' has no left operand
     #elif F_CPU == 192000000
                 ^
    /Users/craig/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy3/core_pins.h:2034:13: error: operator '==' has no left operand
     #elif F_CPU == 180000000
                 ^
    /Users/craig/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy3/core_pins.h:2036:13: error: operator '==' has no left operand
     #elif F_CPU == 168000000
                 ^
    /Users/craig/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy3/core_pins.h:2038:13: error: operator '==' has no left operand
     #elif F_CPU == 144000000
                 ^
    /Users/craig/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy3/core_pins.h:2040:13: error: operator '==' has no left operand
     #elif F_CPU == 120000000
                 ^
    /Users/craig/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy3/core_pins.h:2042:13: error: operator '==' has no left operand
     #elif F_CPU == 96000000
                 ^
    /Users/craig/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy3/core_pins.h:2044:13: error: operator '==' has no left operand
     #elif F_CPU == 72000000
                 ^
    /Users/craig/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy3/core_pins.h:2046:13: error: operator '==' has no left operand
     #elif F_CPU == 48000000
                 ^
    /Users/craig/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy3/core_pins.h:2048:13: error: operator '==' has no left operand
     #elif F_CPU == 24000000
                 ^
    /Users/craig/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy3/core_pins.h:2050:13: error: operator '==' has no left operand
     #elif F_CPU == 16000000
                 ^
    /Users/craig/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy3/core_pins.h:2052:13: error: operator '==' has no left operand
     #elif F_CPU == 8000000
                 ^
    /Users/craig/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy3/core_pins.h:2054:13: error: operator '==' has no left operand
     #elif F_CPU == 4000000
                 ^
    /Users/craig/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy3/core_pins.h:2056:13: error: operator '==' has no left operand
     #elif F_CPU == 2000000
                 ^
    /Users/craig/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy3/core_pins.h:2063:11: error: operator '<' has no left operand
     #if F_CPU < 24000000
               ^
    In file included from /Users/craig/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy3/WProgram.h:54:0,
                     from /Users/craig/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy3/Arduino.h:6,
                     from /var/folders/3x/q25vfyxj7m3d0f7s33_by11hgpw8qd/T/arduino_build_968699/sketch/sketch_feb28a.ino.cpp:1:
    /Users/craig/Arduino.app/Contents/Java/hardware/teensy/avr/cores/teensy3/usb_serial.h:40:11: error: operator '>=' has no left operand
     #if F_CPU >= 20000000 && !defined(USB_DISABLED)
               ^
    Error compiling for board Teensy 3.6.
    I'm sure it's something silly and obvious, but this is all terra nueva to me...

  2. #2
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    2,952
    It is saying that F_CPU (which is defined when you select Teensy 3.6) is defined to be nothing. F_CPU should be defined to be the CPU speed.

    You may want to start from scratch. Get a new version of Arduino 1.8.8 and Teensydunio 1.45 and go through the steps listed here:


    That page does say you need to run Arduino once on Mac before running the Teensydunio installer (I only use Linux, so I can't say whether that might cause your problem).

  3. #3
    Junior Member
    Join Date
    Mar 2019
    Posts
    12
    I restarted and it gets further this time. It compiles successfully:
    Code:
    Opening Teensy Loader...
    Sketch uses 10716 bytes (1%) of program storage space. Maximum is 1048576 bytes.
    Global variables use 3828 bytes (1%) of dynamic memory, leaving 258316 bytes for local variables. Maximum is 262144 bytes.
    And then I see the little window with "Push button on Teensy to manually enter program mode", so I push the button, but nothing happens...

  4. #4
    Junior Member
    Join Date
    Mar 2019
    Posts
    12
    Thanks for the response, Michael.

    Turns out I was using a bad USB cable. Grabbed another and it works correctly and I can upload my own programs now.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •