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()。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。