So I copied and modified Dave Parker's 5-state line follow program and made it into a MyBlock. We wanted it to work for only three rotations, but I am not sure how to connect it using a variable. The program and MyBlock are attached.
Could someone make some recommendations on how to use a MyBlock for linefollowing?
Line Following MyBlock Help Me Please!
-
- Posts: 4
- Joined: 02 Oct 2012, 23:04
Line Following MyBlock Help Me Please!
- Attachments
-
- 9-25linfollowmyblock.rbtx
- 5 state line follower
- (531.08 KiB) Downloaded 421 times
-
- Posts: 346
- Joined: 27 Sep 2010, 03:05
- Contact:
Re: Line Following MyBlock Help Me Please!
I would suggest looking at the values from the light sensor and see what gets returned when it is or isn't on the line. Unfortunately, this program won't do a very good job of following the line.datbikerguy wrote:So I copied and modified Dave Parker's 5-state line follow program and made it into a MyBlock. We wanted it to work for only three rotations, but I am not sure how to connect it using a variable. The program and MyBlock are attached.
Could someone make some recommendations on how to use a MyBlock for linefollowing?
Maybe you could create a flow-chart or truth-table identifying what you what the robot to do, with different light sensor readings.
Steve
---> Link to lots of MINDSTORMS stuff under my picture --->
-
- Posts: 4
- Joined: 02 Oct 2012, 23:04
Re: Line Following MyBlock Help Me Please!
Here is my truth table for line following, this part works fine by itself but I'm trying to convert it into a myblock that stops after a variable number of rotations.
Light Reading Robots Response
81-100 Hard Left
60-80 Gentle Left
40-59 Straight
20-39 Gentle Right
0-19 Hard Right
We don't know how to change the duration of the loop according to the number of rotations it makes. We tried having a rotation sensor go through a compare block and put the output into the loop control, but we did something wrong. Can you make any recomendations
Light Reading Robots Response
81-100 Hard Left
60-80 Gentle Left
40-59 Straight
20-39 Gentle Right
0-19 Hard Right
We don't know how to change the duration of the loop according to the number of rotations it makes. We tried having a rotation sensor go through a compare block and put the output into the loop control, but we did something wrong. Can you make any recomendations
- Attachments
-
- left side LineFollow5.rbt
- Here's what we tried
- (1.5 MiB) Downloaded 445 times
-
- Posts: 346
- Joined: 27 Sep 2010, 03:05
- Contact:
Re: Line Following MyBlock Help Me Please!
Well, the solution is pretty simple. Maybe you need to think about how wires work a bit more.
When are you reading the rotation sensor? Or, to put it another way, how often are you reading the rotation sensor in the MyBlock?
(I already know the answer, but that's what you need to understand)
Steve
When are you reading the rotation sensor? Or, to put it another way, how often are you reading the rotation sensor in the MyBlock?
(I already know the answer, but that's what you need to understand)
Steve
---> Link to lots of MINDSTORMS stuff under my picture --->
-
- Posts: 4
- Joined: 02 Oct 2012, 23:04
Re: Line Following MyBlock Help Me Please!
That helped a lot! We got it to work. Thank you so much.
Who is online
Users browsing this forum: Semrush [Bot] and 4 guests