Beginner - I don't understand the pin assignments

Status
Not open for further replies.

shmsih

New member
Hi,
I've used Arduinos for several simple projects and now I want to use Teensy for a usb-midi project. Looking at the pin assignments for a Teensy 3.2, I don't understand if a pin is analog or digital, or if it can be used for either. For example, pin 23 looks like it's the same as A9. At this point I would guess that I could use this pin for an analogRead(A9), but if I set it with pinMode(23, INPUT), I could use it to read a digital signal?

thanks
 
Hi,
I've used Arduinos for several simple projects and now I want to use Teensy for a usb-midi project. Looking at the pin assignments for a Teensy 3.2, I don't understand if a pin is analog or digital, or if it can be used for either. For example, pin 23 looks like it's the same as A9. At this point I would guess that I could use this pin for an analogRead(A9), but if I set it with pinMode(23, INPUT), I could use it to read a digital signal?

thanks

Note, this was the same with many of the Arduino boards, where you could use the majority of the analog pins as digital pins (on the Uno for instance A0 .. A5 overlapped with digital pins). The macro 'A9' in fact is just a define for 23. Note, you want to use 'A9' rather than 23, since it would allow you to move your stuff to new board, where 'A9' might have a different pin number.

On the Teensy 3.2, there are only a few analog input pins that cannot be used as a digital pin. The analog only pins are:
  • A14 (through hole on the back row) -- this pin can be used for analogInput and analogOutput, and it changes the voltage level;
  • A10 & A11 (through hole on the inside row); (and)
  • A12 & A13 (solder pads underneath the teensy).

In addition, while the digital pins on the 3.2 (and 3.5, but not LC/3.6/4.0) can accept 5v inputs, the analog only pins might be damaged if the input voltage is over 3.3v.
 
Status
Not open for further replies.
Back
Top