August 2018
Beginner to intermediate
214 pages
6h 39m
English
Remove the console.log() line from the lightSensor.on('change') handler and replace it with:
lightGraph.update(this.value)
Then you're ready to roll! Move the project folder over to the Pi, navigate to the folder in your Pi SSH session, and run:
npm i
To make sure that barcli is properly installed on the Pi, run the command:
sudo node light-sensor-barcli.js
You should see a bar graph now, shown as follows, that changes when you shine light on or cover the sensor:

Now, for our night-light project, you'll want to find a value for the light sensor that we will use to turn the LED on and off; barcli makes this much ...
Read now
Unlock full access