Shop OBEX P1 Docs P2 Docs Learn Events
Line following code? — Parallax Forums

Line following code?

jerdogjerdog Posts: 6
edited 2005-03-31 16:57 in General Discussion
Does anyone have some line follower code they would be willing to share? I have the Parallax Line follower module and have had some success with Jon Williams code (Thank You). I can read in the line and see it appear as a 5 bit integer. I have tried several ways to make the 5bit number trim/steer/control the servos but it seems very clunky and sporatic. I can only think that I am not handling or using the linefollower.class correctly. I am particularly looking for some code that will implement the linefollower.class (or other) and will follow complicated lines (ie a line that splits into two and how to follow say the left most or right most path).

Any help would be greatly appreciated.


▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
My Stamp smells like its burning!

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-03-29 22:33
    What's the story with your line? Maybe you're getting fluctuating readings due to a lack of contrast between the line and the background. Or, maybe you're getting interference from outside light (I made a paper skirt to go around my sensors). I'm not defending my code, it is what it is; that said, my little Javelin-powered BOE-Bot follows a line quite fluidly.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA
  • jerdogjerdog Posts: 6
    edited 2005-03-31 16:57
    Your code works exceptionally and reliably·well. ·I am just having trouble implementing it. I dont know what to do with the number you get·back from the "read" method (I assume this is the major method to use). Should I implement it as a background task? Task's are something I am not quite ready to grasp. I have read and sampled the code in the JBOT apps (for task/multitasking)·but am still trying to come to terms about what is actually happening. Just to follow the fixedmovementbot or other code to make the wheels turn using·all·of the classes is quite dizzying as you can end up 5 or 6 classes deep in function.

    Oh, also, do you have a class for the infrared module SSIR?

    http://www.parallax.com/detail.asp?product_id=28019

    or·will the code that comes in the JBOT apps for infrared distance/object detector work? I really hate to keep bothering you about all this but I am on a steep learning curve and need some professional help!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Stamp smells like its burning!
Sign In or Register to comment.