teensy 3.5 port mapping

Status
Not open for further replies.

jacko91

Active member
Good day,

I am fairly new to the teensy. So I tried the port mapping from
HTML:
https://forum.pjrc.com/threads/34808-K66-Beta-Test?p=106291&viewfull=1#post106291

I hooked pin 26 to 3.3V.
As pin 26 should be bit 14 from Port A I then used:
Serial.println(GPIOA_PDIR,BIN);
But I only get 0 as output.

Any ideas?

Thanks
 
The forum rule (at the top) says
Always post complete source code & details to reproduce any issue!

so we can't tell if you did pinMode(26,INPUT);

you have to set pinMode() before reading/writing digital pin (unlike Arduino AVR's). Without the pinMode() the PDIR value will be 0

Why not digitalRead(26); ??
 
Any ideas?

Normally the expectation is posting a complete program (eg, the "Forum Rule"), so we can see what you really did. This saves a lot of time and lets us help you much better.

So, without that, I'm going to blind guess that perhaps the pin was never configured? The pins default to a low power disabled state, so if you never call pinMode() or write their config registers, you can expect them to do nothing.
 
Thank you guys very much and sorry for the missing code.
And yes the pinMode solved the problem.
Thanks for the quick and great support.

Greetings
 
Status
Not open for further replies.
Back
Top