fix typos and minor bugs
This commit is contained in:
parent
f8436e2a81
commit
79d8b4e1d0
2 changed files with 5 additions and 5 deletions
|
@ -9,8 +9,8 @@ var RC = function (arduino, pin) {
|
||||||
|
|
||||||
RC.prototype.send = function(tristate) {
|
RC.prototype.send = function(tristate) {
|
||||||
var str = '';
|
var str = '';
|
||||||
for(i = 0; i < s.length; i+=2) { str += String.fromCharCode(parseInt(tristate.substr(i,2), 16)); }
|
for(i = 0; i < tristate.length; i+=2) { str += String.fromCharCode(parseInt(tristate.substr(i,2), 16)); }
|
||||||
arduino.write(new Buffer('W' + String.fromCharCode(97 + this.pin) + str,'ascii'));
|
this.arduino.write(new Buffer('W' + String.fromCharCode(97 + this.pin) + str,'ascii'));
|
||||||
}
|
}
|
||||||
|
|
||||||
RC.prototype.sendDecimal = function (len, val) {
|
RC.prototype.sendDecimal = function (len, val) {
|
||||||
|
|
|
@ -19,8 +19,8 @@ router.get('/toggleLight', function (req, res) {
|
||||||
for(i = 0; i < s.length; i+=2) { str += String.fromCharCode(parseInt(s.substr(i,2), 16)); }
|
for(i = 0; i < s.length; i+=2) { str += String.fromCharCode(parseInt(s.substr(i,2), 16)); }
|
||||||
arduino.write(new Buffer('Wl' + str,'ascii'));
|
arduino.write(new Buffer('Wl' + str,'ascii'));
|
||||||
res.send('switch light');*/
|
res.send('switch light');*/
|
||||||
|
rc_db.find(1, function (error, results, fields) {
|
||||||
rc_db.fidn(1, function (error, results, fields) {
|
if(error) console.log(error);
|
||||||
rc.send(results[0].on_value);
|
rc.send(results[0].on_value);
|
||||||
});
|
});
|
||||||
res.send('switch light');
|
res.send('switch light');
|
||||||
|
|
Reference in a new issue