LISTSERV mailing list manager LISTSERV 16.5

Help for VADCFLL-L Archives


VADCFLL-L Archives

VADCFLL-L Archives


VADCFLL-L@LISTSERV.JMU.EDU


View:

Message:

[

First

|

Previous

|

Next

|

Last

]

By Topic:

[

First

|

Previous

|

Next

|

Last

]

By Author:

[

First

|

Previous

|

Next

|

Last

]

Font:

Proportional Font

LISTSERV Archives

LISTSERV Archives

VADCFLL-L Home

VADCFLL-L Home

VADCFLL-L  July 2011

VADCFLL-L July 2011

Subject:

Re: Programming query- how to count inside of a sensor loop?

From:

Yi Chu <[log in to unmask]>

Reply-To:

Yi Chu <[log in to unmask]>

Date:

Mon, 11 Jul 2011 12:56:09 -0400

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (87 lines)

I am new to NXT so please forgive my ignorance.  I find that the loop
approach is more natural, and more generally applicable in
(procedural) programming.

The issue of having a block that says 'go forward forever' to me is
misleading.  One would think the code would just stuck in that block,
and never hit any code thereafter.  I know NXT does check the code
after, but that also means it does interrupt the 'forever' block (or
NXT is not single threaded). There are things in NXT that is beyond
simple procedure programming.  Using a loop accomplishes the same
thing, and the approach is more general in terms of programming in
general, as it is just basic procedural programming

I look forward to being corrected.

yi

On Mon, Jul 4, 2011 at 9:23 PM, Stuart & Lori Roll <[log in to unmask]> wrote:
> I had Brandy send me an example of her program to clarify the problem.
>
> The program used a loop to repeatedly test the touch sensor and either go
> forward or back up and turn.  She could have used a logic value to exit the
> loop but really the approach wasn’t the best to begin with.
>
> A better solution would be to tell the motors to go forward “forever”, use a
> WAIT block to wait for the touch sensor to be pressed, back up and turn.
> This sequence can be repeated as many times as needed.
>
> Of course a better programming approach would be to avoid duplicate code and
> create a My Block for the “go forward forever, wait for the touch sensor,
> back up” part.  Then the main program would be MB, turn right, MB, turn
> left, MB turn right.  Alternatively, the MB could do the turn itself using
> an input logic value to determine which direction to turn.  Then the main
> program would be MB, MB, MB.
>
> I sent her examples of these solutions directly.
>
> Thank you Brandy, for asking a good question!
>
>
> Stuart Roll
> River Bend Robotics Coach
>
> From: Brandy bergenstock
> Sent: Monday, July 04, 2011 11:46 AM
> To: [log in to unmask]
> Subject: [VADCFLL-L] Programming query- how to count inside of a sensor
> loop?
>
> I created a maze for my students and let them go at it.  One student choose
> to use a touch sensor, which was a good idea.  Now the maze had the robot
> traveling 1 right turn, two left turns, and then a right to finish the maze.
> ( On average this maze took 1.5 hours to program for each group.)  The
> student ended up using a timer on the loop, allotting the loops enough time
> to run until they finished their task and moving on to the next loop.   Not
> bad for a brand new programmer :)
>   But surely, there has to be a away to make the loops count themselves. How
> would you tell the robot, after each touch, count it, then stop after you
> reach "x" touches?
> I am really trying to wrap my head around the wires.  I know there is a
> logic and a math block that would possible to use for this idea, but that I
> can't seem to figure out how to wire it up.
>     Any help to this end would be greatly appreciated!
> (Also to the coach and his son that was considering an advanced robotic
> programming class on-line , I'm still eagerly awaiting that news on that
> seminar set :)
> Regards,
> Brandy
> ________________________________
> To UNSUBSCRIBE or CHANGE your settings, please visit
> https://listserv.jmu.edu/archives/vadcfll-l.html and select "Join or leave
> the list".
> VADCFLL administrative announcements are sent via VADCFLL-ANNOUNCEMENTS-L.
> Visit https://listserv.jmu.edu/archives/vadcfll-announcements-l.html to
> subscribe.
> ________________________________
> To UNSUBSCRIBE or CHANGE your settings, please visit
> https://listserv.jmu.edu/archives/vadcfll-l.html and select "Join or leave
> the list".
> VADCFLL administrative announcements are sent via VADCFLL-ANNOUNCEMENTS-L.
> Visit https://listserv.jmu.edu/archives/vadcfll-announcements-l.html to
> subscribe.

-- To UNSUBSCRIBE or CHANGE your settings, please visit https://listserv.jmu.edu/archives/vadcfll-l.html and select "Join or leave the list".

-- VADCFLL administrative announcements are sent via VADCFLL-ANNOUNCEMENTS-L. Visit https://listserv.jmu.edu/archives/vadcfll-ANNOUNCEMENTS-l.html to subscribe.

Top of Message | Previous Page | Permalink

Advanced Options


Options

Log In

Log In

Get Password

Get Password


Search Archives

Search Archives


Subscribe or Unsubscribe

Subscribe or Unsubscribe


Archives

February 2020
January 2020
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008

ATOM RSS1 RSS2



LISTSERV.JMU.EDU

Secured by F-Secure Anti-Virus CataList Email List Search Powered by the LISTSERV Email List Manager