Ah, one of the servos are on
Ah, one of the servos are on a non PWM line actually. And actually i did twist the servos manually a few times to find the center position. (this was the DFrobot Pan/Tilt Kit)
And yes, the Uno and Mega are talking.
I could probably run the entire project just on the Mega, but I just thought it was cool ut utilize both of them.
The idea is that the Uno runs an IR eye and a sonar as well as the Rover, and and tells the Mega about what the sensors see. It also runs two servos.
Then the Mega is running the rest of the show, with a small OS I am working on, controlled by 4 pushbuttons and an old Panasonic TV remote trough an IR reciever (LTR301). It shows the user whats happening on an 128x64 LCD. It has other sensors and stuff connected to it. It makes the actual decisions. (so for example the Uno says 'hey the sonar says we are 50mm away from an obstacle what to do?! then the Mega says back ‘well stop the Rover for a second and lets probe the environment!’)
I am using Arduino 1.0.3’s servo library as well as IRremote.h by some guy i dont remember just the name of just now.
Maybe i am straining the Uno a bit too much, EVERY analog, digital and power pins is occupied and in use!
I also have the DFrobot IO Expansion Shield v5 that can be used for servos, but at the moment i am wondering how to use this shield with sensors as well.(do i get the power from the analog or digital block’s power lines or does this not work at all!) This shield also accepts separate power inputs
It’s going to be a unholy mess to supply power to all these units and connect their grounds as well I’m up to 6 batteries now, if i am to use this shield too
Just for the ease of managing one battery, I am tempted to run with a LiPo NiMh and dive into more theory (voltage regulators and so on). Thanks for that tip.
I understand a whole lot more now than when i got the Uno with my SIK 3-4 months ago
So far, the only accident I’ve had was to power the tmp36 sensor the wrong way, and that smoked a wire lol.
Edit: I will also work on getting the grounds connected together. I kind of understand why, but what bothers me is why does the reference points matter if all that is connected together are analog and digital signal pins ? For example, the Uno and the Mega are connected ONLY trough Rx/Tx, Aren’t these signals already filtered and regulated to match, or am I actually expanding the whole circuit by having two boards connected this way with each their own battery?
Edit 2:
And by the same token, i fail to understand why the battery for the sonar should be connected to the ground of the Uno, when all that is actually connected between them is one analog and one digital signal.
Edit 3:
And also with the Rover batteries connected to the Dagu board. Because what i am thinking is if i connect the grounds of 4 batteries (3 9v ones and one 5 volt one), the 9v batteries are going to fry the 5v battery, or this difference is going to fry other components ? Thats just my naive intuition saying this though!
Edited: LiPo->NiMh