Reference for Wiring 1.0 (ALPHA) 0017+. If you have a previous version, use the reference included with your software.
If you see any errors or have any comments, let us know.
Name
portMode()
Examples
int outport = 1;
int val = 0;
void setup() {
portMode(outport, OUTPUT);
}
void loop() {
portWrite(outport, val);
val = val + 1;
if(val > 255)
{
val = 0;
}
}
Description
The portMode() method sets a specified digital I/O port as INPUT or OUTPUT. A digital I/O port is a group of 8 pins. By writing 0 to a port it will set individually each of the 8 pins to 0 (LOW). Possible values range from 0 to 255. It possible to read or write a value of a digital I/O port by using the portRead() and portWrite() methods.
portMode() 메소드는 지정한
디지털 I/O 포트를 INPUT 또는
OUTPUT 으로 설정합니다.
디지털 I/O 포트는 8 개의
핀이 구룹되어
있습니다. 0 을
라이트하면 포트는 8
개핀 모두 0(LOW)이 됩니다.
가능한 값은 0 부터 255입니다.
portRead() 와 portWrite() 메소드에
의하여 디지털 I/O 포트
값을 읽거나 쓸수
있습니다.