Control a 3 LED traffic light
Uses AWS IOT SDK
$ npm install
Optional: $ npm install forever -g
(may require sudo)
Place certificate and key in project directory and rename to TrafficLight.private.key and TrafficLight.cert.pem Replace clientId with thing ID from AWS IOT console.
$ node app.js
To run continuously in the background: $ forever start app.js
Stop the forever process: $ forever stop app.js
The app expects a boolean value for green, yellow, and red. For example, to set the desired state using the AWS IOT thing rest API
{
"state":{
"desired":{
"red":true,
"yellow":false,
"green":false
}
}
}
Note: each LED can be toggled independently