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


Groups > comp.lang.python > #98007

Re: GoPiGo script

X-Received by 10.129.148.129 with SMTP id l123mr7150172ywg.35.1446226330877; Fri, 30 Oct 2015 10:32:10 -0700 (PDT)
X-Received by 10.50.122.103 with SMTP id lr7mr99306igb.10.1446226330849; Fri, 30 Oct 2015 10:32:10 -0700 (PDT)
Path csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!enother.net!enother.net!peer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!m48no3534461qgd.0!news-out.google.com!z4ni41018ign.0!nntp.google.com!i2no823313igv.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups comp.lang.python
Date Fri, 30 Oct 2015 10:32:10 -0700 (PDT)
In-Reply-To <IkNYx.3165$PJ.1385@fx05.am1>
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=198.133.214.10; posting-account=QnRR_woAAABCN3o9NKfJV3oj6njOg5Qm
NNTP-Posting-Host 198.133.214.10
References <IkNYx.3165$PJ.1385@fx05.am1>
User-Agent G2/1.0
MIME-Version 1.0
Message-ID <145f0361-1341-481a-a839-b024d7775b34@googlegroups.com> (permalink)
Subject Re: GoPiGo script
From hakugin.gin@gmail.com
Injection-Date Fri, 30 Oct 2015 17:32:10 +0000
Content-Type text/plain; charset=ISO-8859-1
X-Received-Bytes 2704
X-Received-Body-CRC 1738104081
Xref csiph.com comp.lang.python:98007

Show key headers only | View raw


On Friday, October 30, 2015 at 12:58:43 PM UTC-4, input/ld...@casema.nl wrote:
> The GoPiGo is a little robot on wheels.
> 
> I want that this script restart when its ends.
> I tried with "while True"and"return"and also "continue"
> But those functions gives me errors.
> What for function else can I use to restart this script.
> 
> Thanks
> -------------------------------------------------------------------------------
> 
> from gopigo import *
> import time
> 
> 
> set_right_speed(150)
> set_left_speed(105)
> 
> while True:
> #def test():
> enable_servo()
> mindist = 80
> servo(90)
> fwd()#wheels go forward
> print ("forward1x")
> #time.sleep(5)
> #stop()
> 
> if mindist > us_dist(15):
>      #enc_tgt(1,1,72)
>     bwd()#wheels go backward
>     print ("backward1x",us_dist(15))
>     time.sleep(2)
>     left_rot()#wheels rotate left
>     print("left rot",us_dist(15))
>     time.sleep(3)
>     stop()
> 
> if mindist < us_dist(15):
>    #enc_tgt(1,1,72)
>     fwd()#wheels go forward
>     print("forward2x",us_dist(15))
>     time.sleep(2)
>     stop()
> 
> for x in range(3):
> 
>     if mindist > us_dist(15):
>          bwd()#wheels go backward
>          print("backward2x",us_dist(15))
>                                              
> 
> 
> -- 
> --------------------------------- --- -- -
> Posted with NewsLeecher v7.0 Beta 2
> Web @ http://www.newsleecher.com/?usenet
> ------------------- ----- ---- -- -

Can you please provide a copy/paste of the errors you are receiving? I will also try to provide an example of a constant loop when I get a chance between tasks I am working on.

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


Thread

GoPiGo script input/ldompeling@casema.nl - 2015-10-30 16:58 +0000
  Re: GoPiGo script Peter Pearson <pkpearson@nowhere.invalid> - 2015-10-30 17:27 +0000
    Re: GoPiGo script input/ldompeling@casema.nl - 2015-11-02 13:29 +0000
      Re: GoPiGo script hakugin.gin@gmail.com - 2015-11-02 05:45 -0800
        Re: GoPiGo script hakugin.gin@gmail.com - 2015-11-02 05:49 -0800
          Re: GoPiGo script input/ldompeling@casema.nl - 2015-11-02 14:28 +0000
            Re: GoPiGo script hakugin.gin@gmail.com - 2015-11-02 07:19 -0800
            Re: GoPiGo script MRAB <python@mrabarnett.plus.com> - 2015-11-02 15:21 +0000
              Re: GoPiGo script hakugin.gin@gmail.com - 2015-11-02 07:30 -0800
      Re: GoPiGo script Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2015-11-02 09:10 -0500
        Re: GoPiGo script input/ldompeling@casema.nl - 2015-11-02 14:32 +0000
          Re: GoPiGo script Robin Koch <robin.koch@t-online.de> - 2015-11-02 20:31 +0100
            Re: GoPiGo script Larry Hudson <orgnut@yahoo.com> - 2015-11-02 13:06 -0800
              Re: GoPiGo script Robin Koch <robin.koch@t-online.de> - 2015-11-03 01:45 +0100
  Re: GoPiGo script hakugin.gin@gmail.com - 2015-10-30 10:32 -0700
    Re: GoPiGo script input/ldompeling@casema.nl - 2015-10-30 18:18 +0000
      Re: GoPiGo script hakugin.gin@gmail.com - 2015-10-30 12:59 -0700
        Re: GoPiGo script input/ldompeling@casema.nl - 2015-10-31 10:28 +0000
          Re: GoPiGo script MRAB <python@mrabarnett.plus.com> - 2015-10-31 17:42 +0000
            Re: GoPiGo script input/ldompeling@casema.nl - 2015-10-31 18:59 +0000
              Re: GoPiGo script MRAB <python@mrabarnett.plus.com> - 2015-10-31 19:42 +0000
                Re: GoPiGo script input/ldompeling@casema.nl - 2015-10-31 20:18 +0000
                Re: GoPiGo script MRAB <python@mrabarnett.plus.com> - 2015-10-31 21:12 +0000

csiph-web