PinMode

From Pinguino
Jump to: navigation, search

Name

pinMode

Description

pinMode configures a pin to be used as either input or ouput. A pin configured for input is allowed to read the voltage/level present on pin using digitalRead. A pin configured for ouput is allowed to drive the voltage/level according to its setting, the setting can be changed using digitalWrite.

Since
Beta 3

Syntax

P8
void pinMode(int pin, int mode);
P32
void pinMode(u8 pin, u8 mode);
Parameters
  • pin = pin number to set (from 0 to 17 for PIC18F2550)
  • mode = required mode INPUT (= 1) or OUTPUT (= 0)
Return
[None]

Example

First Example - TestBlink Example - PinMode Example - K2000 Example

Bugs

See also

Comments