本文整理汇总了TypeScript中wiring-pi.digitalWrite函数的典型用法代码示例。如果您正苦于以下问题:TypeScript digitalWrite函数的具体用法?TypeScript digitalWrite怎么用?TypeScript digitalWrite使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了digitalWrite函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: setInterval
setInterval(function() {
wpi.digitalWrite(pin, value)
value = +!value
}, 500)
示例2:
console.log(wpi.VERSION);
// Setup
let ret: number = wpi.wiringPiSetup();
ret = wpi.wiringPiSetupGpio();
ret = wpi.wiringPiSetupPhys();
ret = wpi.wiringPiSetupSys();
ret = wpi.setup('wpi');
// Core functions
wpi.pinModeAlt(1, wpi.FSEL_ALT0);
wpi.pinMode(2, wpi.INPUT);
wpi.pullUpDnControl(2, wpi.PUD_UP);
let read: number = wpi.digitalRead(2);
wpi.pinMode(3, wpi.OUTPUT);
wpi.digitalWrite(3, wpi.HIGH);
wpi.pinMode(4, wpi.PWM_OUTPUT);
wpi.pwmWrite(4, 1023);
ret = wpi.gertboardAnalogSetup(5);
read = wpi.analogRead(5);
wpi.analogWrite(6, 100);
read = wpi.pulseIn(2, read);
wpi.delay(2);
wpi.delayMicroseconds(3);
ret = wpi.millis();
ret = wpi.micros();
// Interupts
wpi.wiringPiISR(2, wpi.INT_EDGE_BOTH, (delta: number) => console.log(delta));
wpi.wiringPiISRCancel(2);
// Raspberry Pi hardware specific functions
ret = wpi.piBoardRev();