-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consolidate all the proximity/ranging devices #688
Conversation
There isn't any clear need to use a |
var proximity = new five.Proximity({ | ||
pin: "A0", | ||
controller: "OA41SK" | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Weird indentation here
@rwaldron I added |
I will test that for you today! |
…five into frxnz-proximity-refactor * 'proximity-refactor' of https://github.com/frxnz/johnny-five: Pesky double quotes Refactoring data collection, adding SRF10 MB1003 added to Proximity class All sensors should be controllers, not devices Refactored analog sensors, updated tests
}); | ||
|
||
prox.on("motionend", function(err, timestamp) { | ||
led.off(); | ||
proximity.on("data", function(err, data) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For events, we're trying to get rid of the err, data
arguments. Update the class, tests, etc. to emit only a data
object
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I thought that was the case, but I opened a couple files and they had err
. I'll clean those up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clean up only for your Proximity and Motion classes. I have a patch I'm maintaining for all the rest
I'll take a look at this next |
@@ -0,0 +1,249 @@ | |||
var Board = require("../lib/board.js"), | |||
events = require("events"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add:
within = require("./mixins/within"),
__ = require("./fn"),
Definitely bugs :( |
I branched from your branch and committed a patch to fix the tests. You can pull it into your branch directly with:
|
@rwaldron I just updated the examples. If there are any changes let me know, otherwise I think this is ready to land. I'll open a separate PR for |
This does look beautiful
Not sure I understand this—why? Also, Ping is going to have two different controllers, so we need to coordinate with @ajfisher on naming. |
If you're not in a hurry to land I can do it here, but I may not be able to get to Ping until Monday. |
I'm not in a hurry :) |
Cool, that's helpful (good direction when I sit down to test) |
@rwaldron Rebased, updated the docs, and did a little cleanup. I don't know if you've had a chance to look at them, but the |
I haven't, but I will tomorrow. Thanks for all your works so far :) |
@@ -0,0 +1,19 @@ | |||
var five = require("johnny-five.js"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"johnny-five.js"
=> "../"
(this is automatically converted by the examples task)
Big thanks to @rwaldron and @Resseguie for helping me get the HC-SR04 tests working 🎉 |
Consolidate all the proximity/ranging devices. Closes #688.
This isn't done yet, but I wanted to get some input on the device/controller stuff. The way I understand it a device is used to transform the raw data from the sensor, while a controller is used to actually retrieve that data from the sensor. Specifically here.
cc @rwaldron @dtex