Teensy 3.5 Use of A10 as digital write.

Status
Not open for further replies.

mikeleslie

Active member
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);
  }
}
 
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:
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
 
Status
Not open for further replies.
Back
Top