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

Thread: Teensy 3.5 Use of A10 as digital write.

  1. #1
    Member
    Join Date
    Jan 2014
    Location
    Seattle, WA
    Posts
    30

    Teensy 3.5 Use of A10 as digital write.

    Perhaps I'm an idiot, but I can't seem to do a basic digital write when using A10. It works fine on the other 20 pins I'm using. Is there something special I need to do? I even tried the blink sketch and just changed 13 to A10...and nada..

    Code:
    const int ledPin =  13;      // the number of the LED pin
    const int ledPin2 =  A10;      // the number of the LED pin
    
    // Variables will change:
    int ledState = LOW;             // ledState used to set the LED
    long previousMillis = 0;        // will store last time LED was updated
    
    long interval = 5000;           // interval at which to blink (milliseconds)
    
    void setup() {
      pinMode(ledPin, OUTPUT);      
      pinMode(ledPin2, OUTPUT);      
    }
    
    void loop()
    {
      unsigned long currentMillis = millis();
     
      if(currentMillis - previousMillis > interval) {
        previousMillis = currentMillis;   
    
        if (ledState == LOW)
          ledState = HIGH;
        else
          ledState = LOW;
    
        digitalWrite(ledPin, ledState);
        digitalWrite(ledPin2, ledState);
      }
    }

  2. #2
    Senior Member
    Join Date
    May 2017
    Posts
    238
    A10 is an analog only pin. It does not have digital drivers.
    https://www.pjrc.com/store/teensy35.html

  3. #3
    Member
    Join Date
    Jan 2014
    Location
    Seattle, WA
    Posts
    30
    which is why I also tried it as an analog write, with the same results. I thought this should be able to light a 3v LED...

    Code:
    void setup() {
      pinMode(A10, OUTPUT);      
    }
    
    void loop()
    {
          analogWrite(A10, 255);
    
    }
    The only thing I can think of is that somehow I "broke" my A10 port
    Last edited by mikeleslie; 01-26-2021 at 01:53 AM.

  4. #4
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    4,015
    On the Teensy 3.2, 3.5 and 3.6, the following pins are only for analog input (i.e. you can't do digital read, digital write or analog write, you can only do analog read):
    • A10, A11


    On the Teensy 3.5 and 3.6, the following pins are only for analog input or real analog output (i.e. the voltage varies, it doesn't flash the pin with PWM, like analog write does with digital pins):
    • A21, A22

  5. #5
    Member
    Join Date
    Jan 2014
    Location
    Seattle, WA
    Posts
    30
    Thanks! I was thinking that might be the case but like I said, I'm not always the sharpest tool in the shed.

Posting Permissions

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