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

Thread: Teensy LC pull-up

  1. #1
    Junior Member
    Join Date
    Aug 2015
    Posts
    11

    Teensy LC pull-up

    Gents.

    Do I need to wire in a pull-up resistor for a button press, or is there a command which can be used so I can run from wire to button without a resistor.

    Regards Not Bart

  2. #2
    Senior Member Davidelvig's Avatar
    Join Date
    Aug 2015
    Location
    Wisconsin
    Posts
    234
    As I understand it, and have used it, teensy supports the arduino pinmode arguments at
    https://www.arduino.cc/en/Reference/PinMode
    That web page, and it's links talk about enlisting an internal resistor with pinmode of INPUT_PULLUP
    Does that help?

  3. #3
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,166
    Yes, pinMode(pin, INPUT_PULLUP) works great on Teensy-LC. No need for a real resistor.

  4. #4
    Junior Member
    Join Date
    May 2018
    Location
    Brisbane, Australia
    Posts
    4
    Quote Originally Posted by PaulStoffregen View Post
    Yes, pinMode(pin, INPUT_PULLUP) works great on Teensy-LC. No need for a real resistor.
    Hi Paul
    Does this hold true for the Teensy LC's D0 (which I'm using as a serial receive RX1)?

  5. #5
    Quote Originally Posted by vk4ghz View Post
    Does this hold true for the Teensy LC's D0 (which I'm using as a serial receive RX1)?
    Yes, all the digital pins can do internal pullup or pulldown.

    If you are using the Serial interface(s) the function Serial.Begin() will override the pin direction though. No need to specify pin direction with serial.

  6. #6
    Senior Member
    Join Date
    Oct 2015
    Location
    Roma (IT, EU)
    Posts
    193
    Don't want to sound picky, but it's Serial1.begin() for the hardware serial (D0/D1). Serial.begin() is for USB-serial.

  7. #7
    Junior Member
    Join Date
    May 2018
    Location
    Brisbane, Australia
    Posts
    4
    Quote Originally Posted by jacky4566 View Post
    Yes, all the digital pins can do internal pullup or pulldown.

    If you are using the Serial interface(s) the function Serial.Begin() will override the pin direction though. No need to specify pin direction with serial.
    Thank you for the answer.

    I'm aware of the pin direction being set when used as a serial port.
    It's whether the RX port was going to be left floating, or not, when D0 was being used as serial port.
    ie; some unexpected behavior traps in different modes.

    Some of the Teensy documentation is very outdated (refers only to Teensy 1.0 and Teensy 2.0), so I'd thought I'd check.

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

  8. #8
    Junior Member
    Join Date
    May 2018
    Location
    Brisbane, Australia
    Posts
    4
    Follow up.

    When used as a serial RX, there is no need for specifying an internal pull-up.

    In my case D0 (RX1).

    ie: pinMode(0, INPUT_PULLUP)

    In fact, having this causes the serial RX to stop working.

Posting Permissions

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