Skip to content
luni64 edited this page Mar 17, 2020 · 12 revisions

Work in progress

Pin Info: Pins

Setting pin modes

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...

Analog Input

Not all pins are capable for analog input. (See the orange colored numbered on the pinout cards) can use digitalWriteFast and digititalReadFast.

Example

analogRead...

Analog output

PWM based

TBD Example

...

DAC

Example

...

Other Pin functions

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.

Alternate Pin Functions

Some of the additional pin functions can be moved to alternative pins. TBD

Clone this wiki locally