We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7949940 commit 5cb344fCopy full SHA for 5cb344f
coder-apps/tests/gpio_test/app/app.js
@@ -119,8 +119,12 @@ var enableGPIO = function() {
119
// Set up the LED output GPIO
120
console.log("Setting up LED as an output on GPIO " + ledGPIOID );
121
ledDevice = gpio.export( ledGPIOID, {
122
- direction: "out",
123
ready: function() {
+ // This works around a bug in gpio, where sometimes this device
124
+ // doesn't become immediately available.
125
+ setTimeout( function() {
126
+ ledDevice.setDirection("out");
127
+ }, 100); //wait 100 ms before setting direction
128
}
129
});
130
0 commit comments