I am not a programmer and never claimed to be one.. I just read and read
and read.. trying to learn and understand.. but for some reason I am not
sure I am understanding how this works... if someone doesn't mind I need
help to point me in the correct direction to get my project going.. What I
am able to do is make it work in python but I like the idea of node.js over
python..
The project is to use my raspberry pi to raise or lower a door (not a
garage door). At the top and bottom are Hall Effect sensors. Before raising
the door I want to verify the door is closed. If it is closed then raise
the door till it reaches the opendoor state. I have not had any luck with
node.js programming.. this is what I have come up with so far..
var gpio = require('rpi-gpio');
var doorclosed = 31; //hall effect sensor when door is closed
var dooropen = 33; //hall effect sensor when door is open
var opendoor = 35; //cause door to open
var closedoor = 37; //cause door to close
function raisedoor(callback) {
//verifydoorclosed(function verified door closed on gpio 31)
gpio.read(doorclosed, gpio.DIR_IN, readInput);
//if doorclosed is = true then opendoor till dooropen is true
if dooclosed = true
gpio.write(opendoor, 1, function(err){
gpio.read(dooropen, true, function(err){
gpio.write(opendoor, 0, function(err){
callback();
});
});
});
}
I don't mind reading if someone has a link that explains what I am
missing.. thank you
--
Job board: http://jobs.nodejs.org/
New group rules:
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/nodejs/7c63d61f-4cb7-46a9-96c9-3ca27bce8ad0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.