So this (demonstrated in a rather poorly executed gif) is what I’m thinking for the action to take when the front left bumper hits on my car. basically reverse, spin right, move forwards again, spin left to attempt to maintain a straight direction of travel, then finally move forward hopefully avoiding the obstacle.
Having tried out the code this evening though i’m not convinced it’s going to work. It might be worth looking at the other interrupt options available to me.
So I wrote some basic control methods for the car I’ve added to this over the last few days to add some interrupts. I need to add some switches to my breadboard set up so I can test the code out as I’ve never done anything with interrupts on the Arduino. I’m trying out PciManager as this looks like the simplest approach. Hopefully I’ll get some time to play over the next couple of days.
So basic control of the car has been established. I have written code to control the basic functions of movement; forwards, backwards, spinning left and right, as well as stopping as simulated by the four tri-colour LEDs.
I now need to look into some sensors to make this little motor autonomous, i’m thinking micro switches as an initial stab. Further down the line I need to investigate what will happen running the two sides at different speeds, I’d hope for a turning effect but I’ll have to wait to get the circuits on board before I can really play with that.
Progress on my car, I now have a circuit, I just need to hook up forward and reverse for left and right to pins on the Arduino and write some code to drive it.
Then once I’m happy the fun task of soldering this all to two half-size proto breadyboard things and then comes fun part of finding fixings to fasten it all to the car itself, but for now I’m not going to even think about how I attach it. Maybe if it all works I might even get a board fabricated for it with precise holes for mounting.
Well, so after building my car pretty quickly and throwing together a simple circuit using two H-Bridge Motor Driver I came up with an issue.
The motors would only move if I connected either forward or reverse to ground (pins 2 or 7), while this was the opposite to the documentation I’d read I was still not perturbed as I thought to myself I know I’ll just mark the pins as low on my Arduino. To my great annoyance this didn’t work so tonight I’m going to simplify the circuit and try to figure out where I made a mistake, as I assume it has to be me rather than dodgy chips.
I wish I could stop collecting…
So its been ages since I last posted on here, I just can’t seem to focus on anything.
So since I last posted I’ve tried to improve my python skills, which I think I’ve done OK but I just can’t get motivated to work on my music player idea, or anything else for that matter.
I’ve also tried to learn more about electronics, to this end I’ve got a Ardunio and shedloads of components. (Hence the collecting in the title of this post). But again I can’t seem to think of anything permanent to do, I just hook up a circuit then take it apart again.
While this is useful - I’m leaning how things work - its also really depressing, I wish I could think of something useful to do with my pi and now my electronics.
Anyhoo back to the collecting until inspiration hits me.
I know I should know better but when I fried my SD card I lost the work I was doing on my google music player. That’ll teach me for not backing up my work.
To avoid this situation in the future I have signed up to github and will be maintaining the work in a repository there.
not having used git before, and as I’m still learning python I have created a couple of repositories:
Anyway, my adventures continue…..