Go Down

Topic: Student First Project - Help and Advice needed (Read 1 time) previous topic - next topic

AWOL

Code: [Select]
const int trigPin = 2;
const int echoPin = 4;
const int trigPin2 = 13;
const int echoPin2 = 12;

int irsens = A0;
int irsens2 = A5;
This suggests to me that you are going to change the pins that the IR sensors are connected to, during execution of your sketch.

Also, do really need a datatype with a range -32768 to 32767, to describe a pin number on a very small microcontroller?
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.
I speak for myself, not Arduino.

ShayUK

#16
Dec 05, 2017, 12:53 pm Last Edit: Dec 05, 2017, 12:58 pm by ShayUK
Thanks to all for great feedbacks and suggestions/Questions :


@ vinceherman :  Yes they are continuous rotation servos and yes you are right about the wheels. For the battery, because the design is aready done, we decided to use 3 x 9v batteries to see what will happen, we are still thinking about that, just found out in a pdf file of servos which showing using 4 x 1.5V batteries for servos and one 9v for sensors . do you know the current of those power banks by the way?
5 seconds could be changed later, it is for servo motors to not lead the robot out of the ring when the white edge is detected ( it's a 2 colored ring, black and white), which we are going to place it.


@slipstick : I explained it in the first post, 0 and 180 rotates the robot to detect another robot and go forward to it to hit it and push it outside the ring.


@ TomGeorge : What is acoustic cross talk between the 2 servos?

A question, What happens is when everything is connected with all the sensors, the 2 servos are not rotating at the same speed, do you know what is the problem?
We will use your commentsa and check the links and hopefully will post a new code soon.
Thank you very much.

@Thanks, when we use INT command it is -32768 to 32767 storage by default. There is no need to change it anyway .


Appreciate to all again!



AWOL

Quote
Thanks, when we use INT command it is -32768 to 32767 storage by default. There is no need to change it anyway .
"int" (note case) is a datatype,  not a command, and by default, when used to describe pin numbers, wastes memory.
Besides, the concept of negative pin numbers is plain silly.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.
I speak for myself, not Arduino.

TomGeorge

Thanks to all for great feedbacks and suggestions/Questions :

@ TomGeorge : What is acoustic cross talk between the 2 servos?
I am referring to the two SR04 ultrasonic units.
When they transmit their ping, the pings are on the same frequency.
So if you ping too close together you can get reflections in one SR04 that come from the other SR04. the fact that they are facing away from each other will help prevent this.
Tom... :)
Everything runs on smoke, let the smoke out, it stops running....

ShayUK

Thanks, AWOL, I checked with our guys and tutor, they said we have enough free memory and really no need to change that at this stage, but I personally agree with you want to know how it can be changed?

Dear Tom, I discussed it with my teammates now, the sensors are opposite direction, we still have a bit of that, not too much, we are going to test the robot, I will keep you posted about what happened in reality.

I also attached some pics of the progress, we used Fusion 360 to see and measure the parts and laser printed chassis etc... before building it.


The code is still the same, the very first post contains the code, as well as one of the posts which included it. after testing the physical robot, we will see if the code worked well enough or not.

Thanks for all your support!

Best Regards
Shay









ShayUK

P.S We also had to use a voltage regulator, as we use 3 x 9v batteries, 1 for arduino and 2 for servo motors.

The voltage regulator is for servo motors, we used 1 battery and it stopped working very soon, so now we use 2 x 9v but with voltage regulator, we give them 6V from 2 sources (2 x 9v ), if that makes sense.

AWOL

Quote
we give them 6V from 2 sources (2 x 9v ), if that makes sense.
No, it doesn't.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.
I speak for myself, not Arduino.

ShayUK

AWOL, why? what would be the problem? it's our first time using such a things, what do you suggest?
Or it is the way I explained it maybe?

Best regards,
Shay

AWOL

2x9V is about the same since as 4xAA.
9V batteries are an expensive way of supplying Coulombs.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.
I speak for myself, not Arduino.

Go Up