Importing barcli and constructing our barcli graph

To import barcli, at the top of your print-light-sensor.js file, following the other require() statements, add:

const Barcli = require('barcli')

Then, in the board.on('ready') handler, we'll add the bar graph constructor:

let lightGraph = new Barcli({
label: 'Light Sensor',
range: [0, 255]
})
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.16.81.33