Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #109978

Re: GoPiGo distence sensor

From Joel Goldstick <joel.goldstick@gmail.com>
Newsgroups comp.lang.python
Subject Re: GoPiGo distence sensor
Date 2016-06-15 11:13 -0400
Message-ID <mailman.75.1466003902.2288.python-list@python.org> (permalink)
References <24fc1dae-5411-44fa-89e2-d2859d27594f@googlegroups.com> <14e59bbf-34aa-f83e-ab2f-a623c1380310@mrabarnett.plus.com> <CAPM-O+xV62914Z1yFhxe9A-erf-rSZ4N5QYQ=oOGxFu7Y6m8kQ@mail.gmail.com>

Show all headers | View raw


On Wed, Jun 15, 2016 at 11:00 AM, MRAB <python@mrabarnett.plus.com> wrote:
> On 2016-06-15 15:15, ldompeling@casema.nl wrote:
>>
>> I have a small robot on wheels named the GoPiGo.
>> What I want is if the distence sensor read the same distence for let say 5
>> seconds then the GoPiGo go's backward.
>>
>> But I don't now how to program this in python.
>> The Api functions for the GoPiGo are here:
>> http://www.dexterindustries.com/GoPiGo/programming/python-programming-for-the-raspberry-pi-gopigo/
>>
>> Can someone help me with this.
>>
> Check the distance at regular intervals, like the ticks of a clock.
>
> At each tick, check the distance.
>
> If the distance is the same as the previous measurement, increment a
> counter, else reset the counter.
>
> If the counter reaches a certain value, it means that the robot has been at
> that distance for that many ticks. (If it checks every second and the
> counter reaches 5, then it has been at that distance for 5 seconds ...
> approximately ...)
>
> --
> https://mail.python.org/mailman/listinfo/python-list

This reminds me of a toy called 'Big Trak' made by Milton Bradley in
the 1980s https://en.wikipedia.org/wiki/Big_Trak

-- 
Joel Goldstick
http://joelgoldstick.com/blog
http://cc-baseballstats.info/stats/birthdays

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

GoPiGo distence sensor ldompeling@casema.nl - 2016-06-15 07:15 -0700
  Re: GoPiGo distence sensor Joel Goldstick <joel.goldstick@gmail.com> - 2016-06-15 10:59 -0400
  Re: GoPiGo distence sensor MRAB <python@mrabarnett.plus.com> - 2016-06-15 16:00 +0100
  Re: GoPiGo distence sensor Joel Goldstick <joel.goldstick@gmail.com> - 2016-06-15 11:13 -0400
  Re: GoPiGo distence sensor William Ray Wing <wrw@mac.com> - 2016-06-15 11:47 -0400

csiph-web