Shop OBEX P1 Docs P2 Docs Learn Events
Complete beginner need help in basic programming — Parallax Forums

Complete beginner need help in basic programming

Jose A.Jose A. Posts: 2
edited 2008-05-20 23:01 in Learn with BlocklyProp
Ok so I've been playing around with basic stamp programming in my free time and I'm basically trying to make my robot car run through a maze. To accomplish this I bought some ultrasonic range finders from parallax and placed them in the front and the left and right sides. Unfortunately, I have no experience with programming and I'm trying to make due with the few sample codes given, and its not working out. So if anyone could please help me I would appreciate it a ton.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-05-15 21:59
    Your question is way too general and vague.

    First you have to learn how to program while you're having enough fun to be encouraged. Parallax has lots of sample code and educational stuff that you can download from their website. Start by looking through their Stamps in Class Tutorials, beginning with What's a Microcontroller? and Robotics with the BoeBot. You can find these by going to the Resources tab on their main web page, then choosing Downloads, then Stamps in Class Downloads. There are also lots of useful articles in the Nuts and Volts Columns series also downloadable by going to the Resources tab..

    Subtasks for you include: 1) Learning to program in an organized fashion. 2) Understanding how the PING sensors work and the various sample programs that use them. There are programs for scanning the environment (which you can do by having your robot turn slightly between PING cycles) and navigation programs for infrared sensors from the IR Remote for the BoeBot tutorial that's been modified for use with the PING as well.
    3) Understanding the process of controlling robot movement and navigation using whatever sensors are available and experimenting with it. Again, start with existing sample programs.
  • Jose A.Jose A. Posts: 2
    edited 2008-05-19 22:13
    Thanks alot for your help I really do appreciate it. Sorry If i was to general or too vague so let me rephrase my question. I am using a Basic Stamp 2 OEM microprocessor and i plugged in the three ultrasonic range finders to pin 1, 2, and 3. I am also using pin 5 in the Basic stamp 2 OEM microprocessor to output data to a Pololu servo. I had to do this since I discovered the PWM function doesnt work very good with the sabertooth V1.03 were I have the motors connected to. From what I have understood i need to use the serout command in basic stamp to output the signal from the microprocessor to the servo and then to the sabertooth. I need alot of help with the programming code so if anyone could help me I would greatly appreciate it.
  • Mike GreenMike Green Posts: 23,101
    edited 2008-05-20 02:15
    Again, start with existing sample programs. There are plenty of them. Generally, people here are very happy to help, but that means explaining things and making suggestions, not doing the work for you. Work through the sample programs. Experiment with making changes to them. For example, get one of the PING sample programs working with one of your range finders, then see what it takes to modify the program to read from a different PING sensor, then try putting the program in a loop that reads from each of the sensors in turn displaying the distance in your debug window.
  • P!-RoP!-Ro Posts: 1,189
    edited 2008-05-20 23:01
    Try at least getting a start on the code, and I would be happy to help, but I would much rather make it for you like Mike said. Besides, you've got the robot, so if we make an error, we have to go through you to find out about it. Right now, I think you are probably getting a little too excited and want to make a robot right away, but sometimes it takes more time. Right now, I've only worked with the stamp for about a year, and I can hardly call myself a pro, but over time you will get better and be moving on to much more complex problems. Right now, what I advise you to do is get the Smart Sensors free download in the Parallax download section and see what the have to say in the sonar section. From there, you could do expiraments to find out how far the distance it reads needs to be to turn, then use something like the random varyable to somehow decide if it should turn or go forward (where possible). Once you figure out how to do this, you can slowly work up to possibly mapping the maze and having your robot know where it has gone and where it hasen't. This is just your first project, so expect it to take awhile, but once you get it right, you're on the fast track to being a pro. Good luck trying, and remember, don't give up!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    The Pi Guy
Sign In or Register to comment.