Show Posts
Pages: [1] 2 3 ... 5
1  Using Arduino / Programming Questions / Arduino + bluetooth sync to phone. is this possible? on: May 23, 2011, 03:33:48 pm
Hy ppl:D
sorry if this question is stupid but i'd search today a lot to fiind how to make this bluetooth module( http://www.cooking-hacks.com/index.php/shop/arduino/arduino-bluetooth-module.html ) work and connected to my cell phone( it has bluetooth on it). I did not fiind any examples of code or somethig, smiley-sad plz help me, with some code or some steps for me to make this work ....

i just wannt to upload a schetch and make the arduino connect to a bluetooth device wich is in proximity. THNX very much.
2  Using Arduino / Microcontrollers / Re: ATMEGA 328 were else can i connect it and use it ? on: April 05, 2011, 01:33:03 pm
Quote
can easily be used in other environments such as the Atmel Studio 4

Thank you smiley is there more programes in wich i could program the microcontroler with out the arduino ?
3  Using Arduino / Microcontrollers / ATMEGA 328 were else can i connect it and use it ? on: April 05, 2011, 06:33:24 am
Were else can i connect it and use it ? its a general question like other platforme than arduino its there possible ?
TNX
4  Topics / Robotics / Re: Robot Car Algorith on: March 26, 2011, 02:40:48 am
TNX very much smiley
5  Topics / Robotics / Re: Robot Car Algorith on: March 25, 2011, 04:36:21 pm
no one know's ? can i use a syntax or something to make the car do somethig ( like go forward) on if the sensor has the values betwen 30 and 50 for example ?

somethig like this :
Code:
if (dist9 = [30; 50]
{
ForwardLeft
}
 else
{
Forward
}

something like that to read all the values betwen 30 and 50. Please help.
Tnx
6  Topics / Robotics / Re: Robot Car Algorith on: March 25, 2011, 07:32:20 am
Or can i use something the values like betwen 30 and 50 do FrontRight and if values betwen 10 and 20 do BackLeft ? it's this possible ? to do a map of values ? betwen the car should respons ?
7  Topics / Robotics / Re: Robot Car Algorith on: March 25, 2011, 03:52:36 am
now i see it when the car is closer to the wall she is doing both conditions is less then 50 and by 20 and it jam's  smiley-grin. i need to test it firs to the smallest distance that the car is responding and use that as a referencem, and to use some else ?


but how can i do something like this ?  The car to move forward 1m , stop, compare all the senzor distance and move(1m) toward the sensor that has the bigest distance in front of him ? can i do that, and it's possible plz can you give me an ideea how can i do it ?

Tnx very much
8  Topics / Robotics / Re: Robot Car Algorith on: March 24, 2011, 04:37:50 pm
Code:
if (dist9 < 50) {
  FrontLeft();
}

if (dist9 < 20) {
  backRight();
}

in this part "dist9" its the sensor in the right  so if the distant from him to the wall is less than 50 to go FrontLeft the opposite direction and if is less than 20 to backwars steer right, to get away from the wall. At lest that is the ideea smiley-sad. Do you have a better ideea how can i make this work, plz tell me i'm willing to try everything.
9  Topics / Robotics / Re: Robot Car Algorith on: March 24, 2011, 07:26:09 am




This is how it reacts smiley-sad Please give me something an ideea or something !
10  Topics / Robotics / Re: Robot Car Algorith on: March 24, 2011, 07:19:45 am
Sorry i writte the code in romanian language and translete it in englesh  smiley all the code stare with upper case letters.
yes i want the care to do something based on each sensor value. But way i thing i use to much "if" is because the Void lood has to read each IF statemant and the care is moving fast and dosent have time to react. if you want i can put a video smiley
11  Topics / Robotics / Re: Robot Car Algorith on: March 24, 2011, 06:47:16 am
this way i'm using to much "if" ... is there a simpler or an elegant solution ?
12  Topics / Robotics / Re: Robot Car Algorith on: March 24, 2011, 06:45:45 am
I write the hole code !This is the car
it has a shield l298n  wich has the pwm control on the pins 4 to 7

i only need some one to help me with the statement part ! wich is this :
Code:
Front();
if (dist3 < 70){
BackLeft();
}

if (dist9 < 50) {
  FrontLeft();
}

if (dist9 < 20) {
  backRight();
}

if (dist8 <50) {
  FrontRight();
}

if (dist8 < 20) {
  BackLeft();
}

if (dist2 < 40) {
  Front();
}
 

Conditions of driving
13  Topics / Robotics / Robot Car Algorith on: March 24, 2011, 06:26:14 am
Please some one help smiley-sad i'd tryed everithing i know smiley-sad i have a car toy with 4 ping sensors on it, and want to make it avoid the object. if is some one who can help plz. here is the code !
Code:
//_________________________________________________________________
// Bogdan T. Cristian                                              |
// Universitatea "1 Decembrie 1918" Alba Iulia                     |
// Facultatea de Stiinte, Specializare Matematica - Informatica    |
// Anul III - Gr. I                                                |
// R.A.I ( Robot Autonom Inteligent )                              |
// Software de conducere autonoma a mecanismului de deplasare.     |
//_________________________________________________________________|

//Declarare pini folositi!

//Senzorii
const int pingPin9 = 9; // Declararea pinului 9 ca si pin de semnal pentru senzor(dreapta)
const int pingPin8 = 8; // Declararea pinului 8 ca si pin de semnal pentru senzor(Stanga)
const int pingPin3 = 3; // Declararea pinului 3 ca si pin de semnal pentru senzor(Fata)
const int pingPin2 = 2; // Declararea pinului 2 ca si pin de semnal pentru senzor(Spate)

// Motoare
int E1 = 7; // Declararea pinului 7 ca si pin de semnal pentru Controlul Motorului electric 1
int M1 = 6; // Declararea pinului 6 ca si pin de semnal pentru Motorul electric 1
int E2 = 4; // Declararea pinului 4 ca si pin de semnal pentru Controlul Motorului electric 2
int M2 = 5; // Declararea pinului 5 ca si pin de semnal pentru Motorul electric 2

void setup()
  {
    Serial.begin(9600); // Citirea conexiuni seriale intre PC si Arduino
  pinMode(M1, OUTPUT); // Setarea pinului 6 ca si semnal de iesire
  pinMode(M2, OUTPUT); // Setarea pinului 5 ca si semnal de iesire
  }
 
  void loop()
{
  // pornire senzori !
  long dist2 = ping(pingPin2); // Stocarea datelor de la senzor in "dist2"
  delay(25); // Timpul de reactie a citiri senzorului
  long dist8 = ping(pingPin8); // Stocarea datelor de la senzor in "dist8"
  delay(25); // Timpul de reactie a citiri senzorului
  long dist3 = ping(pingPin3); // Stocarea datelor de la senzor in "dist3"
  delay(25); // Timpul de reactie a citiri senzorului
  long dist9 = ping(pingPin9); // Stocarea datelor de la senzor in "dist9"
  delay(25); // Timpul de reactie a citiri senzorului
 
//afisare pe Monitorul Serial valorile inregistrate de Senzori 
Serial.print("Back: "); Serial.println(dist2);    // Afisarea in monitorul serial a datelor receptionate de la senzorul aflat pe pinul 2
Serial.print("Left: "); Serial.println(dist8);   // Afisarea in monitorul serial a datelor receptionate de la senzorul aflat pe pinul 8
Serial.print("Front: "); Serial.println(dist3);     // Afisarea in monitorul serial a datelor receptionate de la senzorul aflat pe pinul 3
Serial.print("right: "); Serial.println(dist9);  // Afisarea in monitorul serial a datelor receptionate de la senzorul aflat pe pinul 9

//_____________________Conditii de deplasarea a dispozitivului mobil in functie de citirea senzorilor_______________________
Front();
if (dist3 < 70){
BackLeft();
}

if (dist9 < 50) {
  FrontLeft();
}

if (dist9 < 20) {
  backRight();
}

if (dist8 <50) {
  FrontRight();
}

if (dist8 < 20) {
  BackLeft();
}

if (dist2 < 40) {
  Front();
}
//__________________________________________________________________________________________________________________________________
}
// Functia de citire a senzorilor
  long ping(int pinNumToReadFrom)
{
  long duration, cm;
  pinMode(pinNumToReadFrom, OUTPUT); // Setarea de iesire pe canalul de semnal al senzorului
  digitalWrite(pinNumToReadFrom, LOW); // Valoarea trimisa pe canalul de semnal
  delayMicroseconds(2); // Durata de trimitere a valori pe canalul de semnal
  digitalWrite(pinNumToReadFrom, HIGH); // Valoarea trimisa pe canalul de semnal
  delayMicroseconds(5); // Durata de trimitere a valori pe canalul de semnal
  digitalWrite(pinNumToReadFrom, LOW); // Valoarea trimisa pe canalul de semnal
  pinMode(pinNumToReadFrom, INPUT); // Setarea ca si intrarea a canalului de semnal al senzorului
  duration = pulseIn(pinNumToReadFrom, HIGH); // Calculul pentru durata semnalului iesit pentru a reveni la senzor
  cm = microsecondsToCentimeters(duration); // Calcularea distantei in centimetri in functie de durata de semnalului
  return cm; // Returneaza valoarea in centimetri
}

long microsecondsToCentimeters(long microseconds)
{
  return microseconds / 29 / 2; // Transformarea microsecundelor in cm
}
 
 
 // Baza de comenzi prestabilite cu diferite moduri de conducere a dispozitivului mobil
 
void Front()
{
digitalWrite(M1,LOW);
digitalWrite(M2,HIGH);
analogWrite(E1, 255); 
analogWrite(E2, 0);
}

void FrontLeft()
{
digitalWrite(M1,LOW);
digitalWrite(M2,HIGH);
analogWrite(E1, 255); 
analogWrite(E2, 255);
}

void FrontRight()
{
digitalWrite(M1,LOW);
digitalWrite(M2,LOW);
analogWrite(E1, 255); 
analogWrite(E2, 255);
}

void Back()
{
digitalWrite(M1,HIGH);
digitalWrite(M2,HIGH);
analogWrite(E1, 255); 
analogWrite(E2, 0);
}

void BackLeft()
{
digitalWrite(M1,HIGH);
digitalWrite(M2,HIGH);
analogWrite(E1, 255); 
analogWrite(E2, 255);
}

void BackRight()
{
digitalWrite(M1,HIGH);
digitalWrite(M2,LOW);
analogWrite(E1, 255); 
analogWrite(E2, 255);
}
 
void Stop()
{
digitalWrite(M1,LOW);
digitalWrite(M2,LOW);
analogWrite(E1, 0);
analogWrite(E2, 0);
}
14  Using Arduino / Interfacing w/ Software on the Computer / Re: Arduino Robot Car(with ping sensor) + Web Cam Object recognition on: March 22, 2011, 04:11:41 pm
Ok thank you we will try to strap the leptop to the car. We will keep up up to date if you are interested ! smiley-grin  
15  Using Arduino / Interfacing w/ Software on the Computer / Re: Arduino Robot Car(with ping sensor) + Web Cam Object recognition on: March 22, 2011, 04:04:51 pm
ok if the arduino can process an image, can we strap on the car the leptop with the web cam and with the matlab software, and send the data to ardunino so the arduino know how to drive to the color ?
Pages: [1] 2 3 ... 5