rwaldron / johnny-five

JavaScript Robotics and IoT programming framework, developed at Bocoup.
http://johnny-five.io
Other
13.3k stars 1.77k forks source link

Line Tracker Example #1081

Closed roboflank closed 6 years ago

roboflank commented 8 years ago

Can you kindly update the line tracker example? The current one requires a ReflectedArray file which can't seem to be found. ReflectArray = require("./reflect.array"), http://johnny-five.io/examples/line-follower/ Or is the file in the library?

roboflank commented 8 years ago

Am using SparkFun Line Follower Array and it doesn't seem to have the emitter object, anyway to go about it?

henricavalcante commented 8 years ago

Maybe this one? https://github.com/rwaldron/johnny-five/blob/master/eg/ir-reflect-array.js

rwaldron commented 8 years ago

I don't even know why that code is there, it's not doing anything.

rwaldron commented 8 years ago

Unfortunately, the QRE1113 is a completely different protocol that's not supported by the IR.Reflect.Array class. That's not to say that it can't be supported, just that the work hasn't been done yet because no one has ever asked about it (that I can recall).

@BrianGenisio any thoughts?

rwaldron commented 8 years ago

I just ordered one of these components, I'll let you know when it arrives and keep you posted on support progress.

roboflank commented 8 years ago

@rwaldron Okay, thanks.

BrianGenisio commented 8 years ago

The emitter pin is something that the Pol0lu sensor has. It looks like this SparkFun emitter is always on. Looks like a pretty straight-forward I2C interface to write against, but @rwaldron is right... it isn't currently supported. Only the Analog Pololu sensor has support currently, but a clean I2c interface would be really nice for that sensor (less wires FTW!)

I think we are talking about pulling the Reflection Array into a separate J5 plugin. I'm ordering one also so I can hack on it.

BrianGenisio commented 8 years ago

@denzelwamburu I have a POC of the SparkFun reflectance array working with Johnny-Five. Can you pull my fork here, and see if it works for you? https://github.com/BrianGenisio/johnny-five/tree/sen-13582

You don't need pins or enable with this component, but you need to tell it which controller to use. An example:

five.Board().on("ready", function() {
  var eyes = new five.IR.Reflect.Collection({
    controller: 'SEN_13582',
    autoCalibrate: true
  });

  eyes.on("line", function(line) {
    console.log("line: ", line);
  });
});
roboflank commented 8 years ago

@BrianGenisio Great thank you. Let me check it out then i will get back to you :)

BrianGenisio commented 7 years ago

@denzelwamburu Did you ever try this branch to see if the code here works for you?

@rwaldron I just realized that I have a mostly working driver sitting in that branch for that sensor, which also enables that component to add other sensor array variants. I forgot I wrote it. Hoping to get this resurrected some time soon.

stale[bot] commented 6 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.