Processing, 類GPIO
中的digitalWrite()
用法介紹。
用法
.digitalWrite(pin, value)
參數
pin
(int)
通用輸入輸出引腳value
(int, boolean)
GPIO.HIGH (1) 或 GPIO.LOW (0)value
(boolean, int)
對或錯
返回
void
說明
例子
import processing.io.*;
boolean ledOn = false;
void setup() {
GPIO.pinMode(4, GPIO.OUTPUT);
// On the Raspberry Pi, GPIO 4 is pin 7 on the pin header,
// located on the fourth row, above one of the ground pins
frameRate(0.5);
}
void draw() {
ledOn = !ledOn;
if (ledOn) {
GPIO.digitalWrite(4, GPIO.LOW);
fill(204);
} else {
GPIO.digitalWrite(4, GPIO.HIGH);
fill(255);
}
stroke(255);
ellipse(width/2, height/2, width*0.75, height*0.75);
}
相關用法
- Processing GPIO.digitalRead()用法及代碼示例
- Processing GPIO.pinMode()用法及代碼示例
- Processing GPIO.releasePin()用法及代碼示例
- Processing GPIO.releaseInterrupt()用法及代碼示例
- Processing GPIO.waitFor()用法及代碼示例
- Processing GPIO.attachInterrupt()用法及代碼示例
- Processing GPIO.interrupts()用法及代碼示例
- Processing GPIO.noInterrupts()用法及代碼示例
- Processing GPIO用法及代碼示例
- Processing FFT用法及代碼示例
- Processing SawOsc.pan()用法及代碼示例
- Processing FloatDict用法及代碼示例
- Processing FFT.stop()用法及代碼示例
- Processing join()用法及代碼示例
- Processing () (parentheses)用法及代碼示例
- Processing Pulse用法及代碼示例
- Processing PShader用法及代碼示例
- Processing PVector.set()用法及代碼示例
- Processing FloatDict.sortKeysReverse()用法及代碼示例
- Processing texture()用法及代碼示例
- Processing IntDict.add()用法及代碼示例
- Processing PShape.enableStyle()用法及代碼示例
- Processing FloatDict.sub()用法及代碼示例
- Processing String用法及代碼示例
- Processing PImage.pixels[]用法及代碼示例
注:本文由純淨天空篩選整理自processing.org大神的英文原創作品 GPIO.digitalWrite()。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。