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,13 +22,15 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
var m = require('mraa'); //require mraa
"use strict";
x = new m.I2c(0)
x.address(0x62)
x.writeReg(0, 0)
x.writeReg(1, 0)
const mraa = require('mraa'); //require mraa
x.writeReg(0x08, 0xAA)
x.writeReg(0x04, 255)
x.writeReg(0x02, 255)
let i2cDevice = new mraa.I2c(0);
i2cDevice.address(0x62);
i2cDevice.writeReg(0, 0);
i2cDevice.writeReg(1, 0);
i2cDevice.writeReg(0x08, 0xAA);
i2cDevice.writeReg(0x04, 255);
i2cDevice.writeReg(0x02, 255);