Processing, 类GPIO
中的releasePin()
用法介绍。
用法
.releasePin(pin)
参数
pin
(int)
通用输入输出引脚
返回
void
说明
将 pin 的所有权归还给操作系统
如果不调用此函数,即使在草图关闭后,引脚仍将保持当前状态。
例子
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);
} else {
GPIO.digitalWrite(4, GPIO.HIGH);
}
}
// cleanup on keypress
void keyPressed() {
GPIO.releasePin(4);
exit();
}
相关用法
- Processing GPIO.releaseInterrupt()用法及代码示例
- Processing GPIO.pinMode()用法及代码示例
- Processing GPIO.digitalRead()用法及代码示例
- Processing GPIO.waitFor()用法及代码示例
- Processing GPIO.attachInterrupt()用法及代码示例
- Processing GPIO.interrupts()用法及代码示例
- Processing GPIO.noInterrupts()用法及代码示例
- Processing GPIO.digitalWrite()用法及代码示例
- 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.releasePin()。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。