Shop OBEX P1 Docs P2 Docs Learn Events
Code Optimization — Parallax Forums

Code Optimization

AA Posts: 22
edited 2007-12-28 18:18 in Robotics
Hello All,

Its been awhile since I posted anything.· I've been workin on a small robot based on a rc hummer frame.· The bot works great and is able to get around·the house without to much problems.· This is really a fairly challenging environment using only ping and ir. The biggest problem is objects with a small surface area ie table legs,chairs or cloth surfaces which diffuse the pings ultrasound.· Anyway I·want to overcome these problems using more sensors.· Before I do that I am wondering if anyone·has any suggestions for optimizing the current code.· It's heavily commented to ease the suffering.. A few notes about the bot.· The·motor is driven by a seperate PWM and H-bridge circuit.· The stamp controls a dac to change the PWM values.· The speed the bot travels is dynamic based on accelerometer readings indicating that motion has started.· The·steering·servo is also controlled with the second channel of the dac and some 555 timers.· I have 4 ir detectors and a ping mounted on the front of the bot.· 2 of the ir's point to the sides.· Of the attached code the packet routine is not complete or being used..its·for wireless to a gui if anyone is wondering.· Also the stuck routine is new and very simple not yet of much importance.· I plan on using the last two file slots for custom wireless commands and for a return home routine.·To·that end I have·the compass and a wheel encoder with·the position calcs being handled by the gui

Thanks in advance

AW·

Comments

Sign In or Register to comment.