Shop OBEX P1 Docs P2 Docs Learn Events
Three infrareds on Boe Bot for maze. Need help with my code. — Parallax Forums

Three infrareds on Boe Bot for maze. Need help with my code.

So I'm teaching robotics to 7th and 8th graders. I didn't know a thing about programing or robotics a month ago. We are using the Boe bot and our school has been invited to compete with other Jr Highs in a small competition in April. One of the three events is the walled maze. The kids have been programming and practicing with modified fast roam and a modified artificial intelligence programs and have had good success. I'm looking to teach them how to fine tune the bot with one more IR set. I'm hoping to find a way to run the bot along the right wall until it sees something in front. then it should turn left and pick up the right wall again. I have attached my butchered code that i attempted to make today. It started out as a line following program. I have tested all the IR LEDs and receivers and all are working fine. Please help me and let me know if I'm on the right track or do I need another approach. Please forgive my poor coding skills since this is still very new to me. I'm only able to add this on IR set to the bot because the rules state that no more than $5 can be spent on the bot to prepare for this competition.

By the way the kids are having a great time learning and are excited to come into class. I have a 4 hour saturday class and they get there 40 min early and won't go home. It is very rewarding to see them so interested.

Rich

Comments

  • ercoerco Posts: 20,250
    Larry: Looks like you are on the right track, doing a frequency sweep to swag the range. Is this working for you?

    Here's another suggestion which could simplify our code, if you have time to order parts from Ebay China. I like these sensor modules: http://www.ebay.com/itm/121670026689 At $1.59, you could get three for less than $5: front, left, & right.

    Caution, these are 4-pin modules, vastly superior to the cheaper 3-pin modules (do NOT get these): http://www.ebay.com/itm/391086506274

    These are adjustable sensitivity, digital high/low modules which generate their own IR signal, they just go high or low if something (like a wall!) is sensed. High= nothing sensed, low=something sensed. Very easy to install & program, letting you focus on navigation. Here are a few videos I made about this 4-pin sensor:



  • i like that item but i don't think there would be time to get it from China and still get it dialed in. The code I wrote won't work yet. The left front IR works fine but the side and right front are still not working. I'm hoping to maintain a set point of 2 along the right side of the bot. so it will track the wall. I get no action from the two IR sets on the right. I still don't even know if this plan will perform. Maybe there is a better way to utilize the third IR set.
  • ercoerco Posts: 20,250
    Where are you? I could mail you 3 sensors. PM me if interested.
  • Thanks for the kind offer. I think I better stick with the factory stuff since it's the first year.
  • ercoerco Posts: 20,250
    Rich: No one has jumped in yet to help! Have you made any progress? I think your program is much more complicated than it needs to be, since you started with that existing program. Please describe your current status again and I'll try to help. You do have 3 IR LED/sensor pairs? I think you need 2 on the right front & rear and 1 facing forward.
Sign In or Register to comment.