topshed / ZeroBot

4 stars 3 forks source link

using hcsr04sensor #2

Open alaudet opened 8 years ago

alaudet commented 8 years ago

Hi just wondering if the hcsr04sensor causes your robot to react late when coming close to an object. If so you could reduce the sample size with value.raw_distance(sample_size=3) instead of the default 11. Each sample takes .3 of a second. Wish I had a 3d printer. Saw this in magpi and thought it was cool that someone used my small library to control a robot.

Cheers

topshed commented 8 years ago

Hi, yes it does if left on the default: I normally set it to 2 or 3. There is limited space in the tutorial and I have to keep things simple, hence just using the default value. Your library is excellent and I've used it in quite a few applications. Some of the kids in my CodeClub are using it to check distance measurements as part of a a project. Thanks very much!

alaudet commented 8 years ago
                                                                                  That's great thanks for sharing that. I just uploaded a new version that allows you to simply pass trig and echo to the Measurement class instead of including temp, unit and rounding which are now default values. You can of course override them and existing code using it will still work.Cheers