-
Notifications
You must be signed in to change notification settings - Fork 5
GPIO
Work in progress
Pin Info: Pins
pinMode(pin, mode)
accepts the following modes
Mode | Description |
---|---|
OUTPUT | Low impedance output mode. Pin can be set using digitalWriteFast |
OUTPUT_OPENDRAIN | |
INPUT | High impedance input mode. Pin can be read with digitalReadFast and analogRead. This mode is set per default. Reading an open pin gives undefined values. |
INPUT_PULLUP | Adds a pull up resistor (~10k?) to the pin. Open pin reads HIGH |
INPUT_PULLDOWN | Adds a pull down resistor (~10k?) to the pin. Open pin reads LOW |
INPUT_DISABLE | Disables the pin |
To access the digital pins (numbered gray on the pinout cards) can use digitalWriteFast
and digititalReadFast
. (You can also use the slower digitalRead and digitalWrite functions but other than compatibility to Arduino code there is no advantage)
Example
digitalReadFast...
Not all pins are capable for analog input. (See the orange colored numbered on the pinout cards) can use digitalWriteFast
and digititalReadFast
.
Example
analogRead...
TBD Example
...
Example
...
Besides the general purpose input/output (GPIO) functionality, most of the pins can can have additional functions like UART, SPI, I2C etc. (See Pins for detailed info ). If those functions are used, setting a pin mode is not necessary in general.
Some of the additional pin functions can be moved to alternative pins. TBD
Teensy is a PJRC trademark. Notes here are for reference and will typically refer to the ARM variants unless noted.