Private
Public Access
2
0

JS examples: refactor for clarity and consistent style

Signed-off-by: Kassandra Perch <the@nodebotani.st>
Signed-off-by: Alex Tereschenko <alext.mkrs@gmail.com>
This commit is contained in:
Kas Perch
2017-02-23 00:57:19 -06:00
committed by Alex Tereschenko
parent 43d9f6c400
commit 075a7b1225
12 changed files with 145 additions and 127 deletions

View File

@@ -22,9 +22,11 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
var m = require('mraa'); //require mraa
console.log('MRAA Version: ' + m.getVersion()); //write the mraa version to the console
"use strict";
var myDigitalPin = new m.Gpio(5); //setup digital read on pin 5
myDigitalPin.dir(m.DIR_OUT); //set the gpio direction to output
const mraa = require('mraa'); //require mraa
console.log('MRAA Version: ' + mraa.getVersion()); //write the mraa version to the console
let myDigitalPin = new mraa.Gpio(5); //setup digital read on pin 5
myDigitalPin.dir(mraa.DIR_OUT); //set the gpio direction to output
myDigitalPin.write(1); //set the digital pin to high (1)