Here's my first robot, 3d printed myself but have no idea how to connect or program it.
I can build/wire anything, but programming is well outside my pay grade.
I'm trying to do this with my son as he's in the school robotics team, I'd really appreciate some step by step simple advice.
It's actually pretty hard to find any noob language guides on the net.
Basically I've built what is supposed to be a tracked obstacle avoidance robot.
2x SpringRC continuous rotation servos are the motors.
I've powered them via a 3A UBEC, and have connected jumper leads to the signal lines so as to plug them straight into the Arduino UNO.
I've got 2x HC-SR04 sonar sensors slightly angled for left and right sensing, and have spliced power and ground jumper leads into "double adapters" so as to avoid using a breadboard.
Obviously I know where to plug the sensor power and ground leads, but could someone please simply state where I plug in the following:
Left servo signal wire
Right servo signal wire
Left sonar echo wire
Left sonar trigger wire
Right sonar echo wire
Right sonar trigger wire
If someone could literally spell it out for me this first time I'd really appreciate it.
My son seems to have an understanding of code from school (doesn't mean I won't be back later asking for help), but for now I'd just like to plug it all in and let him run with it and see how he goes.
If one of you wouldn't mind, it would be a great help.
Avoid using pins zero and one, but other than that, it doesn't really matter where you put them, just make sure you write them down.
I'd avoid the special purpose pins like I2C and SPI in case you want them for something else later.
I'm really hoping someone would just put a pin number beside the lines I listed this first time, it's not as simple for me as for some here as I've never seen/done any of this before.
I'm not being lazy, this is just new to me.
I did put a lot of work into the cad and printing by the way.
As AWOL mentioned it doesn't matter much which pins you use and they are easily changed.
In the program you tell the Arduino what pin each device is connected to, unlike most other devices that tell you what needs to be connected to each pin.
Hutkikz:
As AWOL mentioned it doesn't matter much which pins you use and they are easily changed.
In the program you tell the Arduino what pin each device is connected to, unlike most other devices that tell you what needs to be connected to each pin.
I am looking at tutorials right now, but to be honest they are very confusing.
As you'll see from the pics I've used 2 sonar sensors rather than one rotating on a servo, and most of the tutorials only show one.
I was under the impression that some of the pins were strictly for inputs and some for outputs, and that I'd have to use either digital or analog depending upon the type of device connected.
All pins(even the analog ones) can be used as digital input or output.
Some pins also have special functions such as Analog input, PWM output etc.
So yeah it's all good as long as you don't need the special function of a particular pin and even then it's just a matter of moving the wire to another pin
Those pin assignments save the analog input pins, the I2C and SPI pins, 3 PWM pins and the external interrupts for future use. The rangefinders do not require analog pins.
Those pin assignments save the analog input pins, the I2C and SPI pins, 3 PWM pins and the external interrupts for future use. The rangefinders do not require analog pins.
Thank you so very much for your clear, straight answer.