QTR-8RC IR Reflectance Array #868
Replies: 3 comments
-
Posted at 2016-06-06 by @allObjects Looking at the guide lines to measure things - decay of a charge - is not the most enticing for Javascript... It would have to go low level to catch the times... may be with some help from @ClearMemory041063 his ideas outlined in Peeking at Espruino Board Timers 2, 3, 4, and 5 conversation... ...with a |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-06-06 by @gfwilliams @allObjects yes, you could go all out trying to use the built-in hardware on 8 channels simultaneously to get really accurate results... Because you're just measuring pulse lengths you can use @ClearMemory041063's code (or this for the Pico) as is (without having to have anything running on interrupt), because you don't care if you miss a reading or not (the latest value will always be in the register). OR you could just do what the Arduino code does, which only needs 4 lines of code and works on any pin:
I reckon that would work relatively well - you might get one or two glitchy readings but on the whole it'd be good enough. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-06-06 by ClearMemory041063 As far as using timers is concerned, there is a timer method that I've yet to implement, Input Capture. This would allow 4 signals per timer to be measured. In Input Capture mode the timer is clocked by the internal clock. When one of the 4 input channels sees a signal on it's pin the counter value is copied into a separate register that a peek command can access. Hopefully within a week or so I'll get to the input capture modes part of the project. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2016-06-05 by PakJeff
As far as I can find, there are no Espruino modules yet for IR reflectance sensor arrays like the QTR-8RC from Pololu (https://www.pololu.com/product/961). I would really like to use it for some simple line following stuff but writing a module is probably out of my league. I'm wondering if anyone else has already done it or has an interest in writing the module. Looks like a library already exist for Arduino so maybe an Espruino module wouldn't need to be totally from scratch.
Beta Was this translation helpful? Give feedback.
All reactions