1. Got a question or need help troubleshooting? Post to the troubleshooting forum or Search the forums!

Arduino related code questions (sketches).

Discussion in 'Off Topic' started by BrooklynBay, Jul 1, 2021.

  1. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,479
    Likes Received:
    7,303
    That is for a teensy -- are you using that or the Leonardo?

    Granted the Teensy is a far more complete solution than a Leonardo. It is more powerful and much smaller :)
     
  2. BrooklynBay

    BrooklynBay Active Member

    Joined:
    Apr 7, 2018
    Messages:
    414
    Likes Received:
    49
    I'm using the Leonardo. I had the encoder library attached. Will this work with the Leonardo? If not, then I'll remove the library.
     
  3. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,479
    Likes Received:
    7,303
    I honestly do not know.
    I have used the Teensy extensively, but never tried to use libraries or code between it and any Arduino.
    It may work fine or not at all. I generally try to avoid mixing libraries between boards because they are not the same microprocessor and the libraries may not work correctly (or even at all).
     
  4. BrooklynBay

    BrooklynBay Active Member

    Joined:
    Apr 7, 2018
    Messages:
    414
    Likes Received:
    49
    The article showed a comparison of interrupt pins on various boards including the Leonardo, so I thought that this library was meant to be used with the boards in the list.
     
  5. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,479
    Likes Received:
    7,303
    The Arduino compiler is compatible with code written for Teensy 3.0, and is well supported on the Arduino IDE using Teensyduino.
    While most Arduino libraries work on Teensy, modifications to the libraries may be needed to make it cross-platform compatible. There are a few libraries curated on PJRC's website with modifications and special instructions specific to Teensy.

    Again, I have never tried using a Teensy library on an Arduino (nor the other way around)
     
  6. BrooklynBay

    BrooklynBay Active Member

    Joined:
    Apr 7, 2018
    Messages:
    414
    Likes Received:
    49
    I've read that Adafruit libraries are compatible with non Adafruit LCD displays. I don't know if their other libraries work with non Adafruit hardware.
     
  7. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,479
    Likes Received:
    7,303
    That is a different problem. The LCD is hardware but not a microprocessor (at least not one YOU can not write code for that runs ON the LCD). rather the board you attach it to provides the interface to it. The microprocessor on the Leonardo (and Tennsy or Mega or any of the others is a CPU and needs machine code specific to it. In many cases the Arduino compiler can totally generate code that is specific to the board (which is why you have to choose the board) and its CPU. In some cases the libraries are compatible as well (if you have the source code for a library and you compile it as part of the build process for the board you have then it absolutely will work). It has not so much to do with Adafruit as it does the boards themselves. When Adafruit build custom boards they usually provide details on what it is compatible with or they provide the source code.
     

Share This Page