pause 300 next low 2:low 0 ‘ stop & straighten pause 300 ‘ coast, let sensor voltage recover
goto main
One thing left for you to do is to control RoboCar with
the IR remote. You could drive it directly, much like the
radio control transmitter we ditched.
RoboCar is very different from most other bots I’ve
built. It’s not slow and precise and repeatable for dead
reckoning, but it’s fast and fun for outdoors. When I “took
it to the streets” for testing and video, I got plenty of
interest from passersby. It’s great to be outdoors in this fine
(southern California) autumn weather.
Or better, you could use the IR remote to select
between all of these different programs. They would all fit
easily in the PICAXE’s memory. Are you up to that
challenge?
I could see moving up to bigger buggies and rovers to
navigate on sidewalks and deal with uneven terrain; maybe
even a GPS-guided bot as used in RoboMagellan contests.
Besides this particular car, there are plenty of other RC
cars and toys which could be hacked and controlled exactly
as we did here. All it takes is a bit of sleuthing to figure out
where to tap into the H-bridges. Many moons ago, I did
just that to hack this large Tyco N-Sect: www.youtube
.com/watch?v=pZwkync_WLE.
By now, you are likely starting to understand these
code listings just by looking at them. The great thing about
the BASIC language is that it’s fairly readable in plain
words. Once you grasp what HIGH, LOW, PAUSE,
FOR/NEXT, and DO/LOOP mean, you’re well on your way to
being a programmer. Feel free to modify the listings and try
some new maneuvers.
Besides toys, you can apply much of this basic
information about H-bridges and PWM (and servos
previously) to bigger robots with larger PICAXE chips like a
20M2 with 16 I/O pins. What could you build using a
dozen servos or a half dozen PWM channels? Have fun
experimenting!
Just avoid blowing up your H-bridges with conflicting
commands. Always turn something off before turning the
opposite thing on.
There’s still much to do with our 08M2. We’ll wrap up
next month making a more traditional mobile robot, and
hack some servos and ultrasonic sensors. Order several
HXT900 servos now and stay tuned! SV
SERVO 12.2015 51