Skip to content

Commit

Permalink
feat(led module): Native LED control
Browse files Browse the repository at this point in the history
  • Loading branch information
saoron committed Apr 24, 2018
1 parent c3732de commit 50bf1cf
Show file tree
Hide file tree
Showing 9 changed files with 73 additions and 6 deletions.
2 changes: 1 addition & 1 deletion config.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"name":"drideOS","version":"0.11.1","settings":{"debug":false,"videoRecord":true,"flipVideo":false,"gps":false,"speaker":false,"mic":false,"indicator":true,"resolution":"720","fps":30,"clipLength":1,"gSensorSensitivity":"medium","netwrok":{"ssid":"dride","password":"ilovedride"}}}
{"name":"drideOS","version":"0.12.0","settings":{"debug":false,"videoRecord":true,"flipVideo":false,"gps":false,"speaker":false,"mic":false,"indicator":true,"resolution":"720","fps":30,"clipLength":1,"gSensorSensitivity":"medium","netwrok":{"ssid":"dride","password":"ilovedride"}}}
5 changes: 3 additions & 2 deletions daemons/bluetooth/characteristic.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ var spawn = require('child_process').spawn;
var fs = require('fs');

var videoReady = require('./videoReady');
var led = require('../../modules/led/index');

var bleno = require('bleno');

Expand Down Expand Up @@ -33,14 +34,14 @@ buttonStream.prototype.onReadRequest = function(offset, callback) {
buttonStream.prototype.onSubscribe = function(maxValueSize, updateValueCallback) {
console.log('buttonStream: onSubscribe ');
ex = updateValueCallback;
spawn('python', ['/home/core/modules/indicators/python/states/standalone.py', 'isPaired']);
led.isPaired();
};

gpio.on('change', function(channel, value) {
if (value) {
var currentTimeStamp = new Date().getTime().toString();
videoReady.startListner(currentTimeStamp);
spawn('python', ['/home/core/modules/indicators/python/states/standalone.py', 'welcome']);
led.welcome();

if (ex) {
//update state that we need to encode video no matter what
Expand Down
Binary file added modules/led/bin/main
Binary file not shown.
13 changes: 13 additions & 0 deletions modules/led/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
var exec = require('child_process').exec;

module.exports = {
welcome: function() {
exec('sudo ./bin/test');
},
error: function() {
exec('sudo ./bin/test');
},
isPaired: function() {
exec('sudo ./bin/test');
}
};
38 changes: 38 additions & 0 deletions modules/led/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions modules/led/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "led",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"neopixels": "0.0.5",
"rpi-ws281x-native": "^1.0.0-alpha1"
}
}
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dride-core",
"version": "0.11.1",
"version": "0.12.0",
"description": "Open source dashcam for RaspberryPi ",
"scripts": {
"build": "node scripts/build.js",
Expand Down
2 changes: 1 addition & 1 deletion state/config.backup.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"name":"drideOS","version":"0.11.1","settings":{"debug":false,"videoRecord":true,"flipVideo":false,"gps":false,"speaker":false,"mic":false,"indicator":true,"resolution":"720","fps":30,"clipLength":1,"gSensorSensitivity":"medium","netwrok":{"ssid":"dride","password":"ilovedride"}}}
{"name":"drideOS","version":"0.12.0","settings":{"debug":false,"videoRecord":true,"flipVideo":false,"gps":false,"speaker":false,"mic":false,"indicator":true,"resolution":"720","fps":30,"clipLength":1,"gSensorSensitivity":"medium","netwrok":{"ssid":"dride","password":"ilovedride"}}}

0 comments on commit 50bf1cf

Please sign in to comment.