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:
committed by
Alex Tereschenko
parent
43d9f6c400
commit
075a7b1225
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user