Show Posts
Pages: [1]
1  Using Arduino / Project Guidance / Re: arduino and webcam on: September 30, 2013, 11:11:57 am
also this
2  Using Arduino / Project Guidance / Re: arduino and webcam on: September 30, 2013, 09:23:25 am
I see on youtube this video:

how can I do this.I have to use a camera module,and what components also?
3  Using Arduino / Project Guidance / Re: arduino and webcam on: September 30, 2013, 07:04:54 am
@paul s
With signals I think that if in the image there is a obstacle,the robot have to stop,for example.I think that i have to use Arduino Mega because it's the version of Arduino most powerful.A camera module have to connect to arduino,haven't it?
@peter h
what do you mean with wireless interface?can you link a website where I find this?
thanks
4  Using Arduino / Project Guidance / arduino and webcam on: September 30, 2013, 06:26:27 am
Hi! I want to make a project.I want to install a webcam(o ipcam) on my robot and i want to see the image that my robot sees on my pc.Possibly i would analize the image on pc for recognize object and obstacles and send a signals to my robot.How can i do this?I think that I have to use an Arduino Mega,and what else?I have to use a camera module or a ipcam?Help me,please
Thanks
5  International / Hardware / arduino e xbee:alcuni comandi non ricevuti on: December 14, 2012, 12:41:17 pm
Ciao!Ho un problema con il mio arduino Uno e con i miei xbee series 2(con antenna).Dopo aver caricato il codice sull'arduino e dopo aver collegato un xbee al pc e l'altro all'arduino,provo a mandare dei comandi via monitor seriale.Alcuni comandi funzionano(ad esempio left e right) ma altri tipo go o back no.Perchè?Aiutatemiii.Grazie mille
Usb board:
http://www.robot-italy.com/en/xbee-usb-board.html
La shield xbee che uso è questa(senza SD):
http://arduino.cc/en/Main/ArduinoWirelessShield
L'arduino è alimentato esternamente con una batteria da 9V come in questa figura:
http://www.arduino.cc/playground/Lea...BatteryAdapter

ps:sull'arduino,ho collegato una motor shield e poi la xbee shield.La motorshield è questa:
http://www.dfrobot.com/wiki/index.ph...)_(SKURI0009)
Codice(non guardate i comandi dell'IR e dei LED):
char comando;
const int pinsensore=2;
int statesens=HIGH;
const int ledCount = 10;

int ledPins[] = {0,1,2,3,8,9,10,11,12,13};
void setup(){
Serial.begin(9600);
pinMode(6,OUTPUT);
pinMode(7,OUTPUT);
pinMode(4,OUTPUT);
pinMode(5,OUTPUT);
pinMode(ledPins[0], OUTPUT);
pinMode(ledPins[1], OUTPUT);
pinMode(ledPins[2], OUTPUT);
pinMode(ledPins[3], OUTPUT);
pinMode(ledPins[4], OUTPUT);
pinMode(ledPins[5], OUTPUT);
pinMode(ledPins[6], OUTPUT);
pinMode(ledPins[7], OUTPUT);
pinMode(ledPins[8], OUTPUT);
pinMode(ledPins[9], OUTPUT);
pinMode(pinsensore,INPUT);
}

void loop(){

/*if(digitalRead(pinsensore)==LOW)
{
stop();
back();
delay(500);
left();
delay(1500);
go();

}*/

digitalWrite(ledPins[0], HIGH);
digitalWrite(ledPins[9], HIGH);

if(Serial.available()>0){

comando=Serial.read();
Serial.println(comando);
switch(comando){
case 'g': go(); digitalWrite(ledPins[0], HIGH);
digitalWrite(ledPins[1], LOW);
digitalWrite(ledPins[2], LOW);
digitalWrite(ledPins[3], HIGH);
digitalWrite(ledPins[4], HIGH);
digitalWrite(ledPins[5], HIGH);
digitalWrite(ledPins[6], HIGH);
digitalWrite(ledPins[7], LOW);
digitalWrite(ledPins[8], LOW);
digitalWrite(ledPins[9], HIGH);break;
case 's': stop(); digitalWrite(ledPins[0], LOW);
digitalWrite(ledPins[3], LOW);
digitalWrite(ledPins[4], LOW);
digitalWrite(ledPins[5], LOW);
digitalWrite(ledPins[6], LOW);
digitalWrite(ledPins[9], LOW);
digitalWrite(ledPins[2], LOW);
digitalWrite(ledPins[7], LOW);break;
case 'b': back();digitalWrite(ledPins[0], HIGH);
digitalWrite(ledPins[3], HIGH);
digitalWrite(ledPins[4], HIGH);
digitalWrite(ledPins[5], HIGH);
digitalWrite(ledPins[6], HIGH);
digitalWrite(ledPins[9], HIGH);
break;
case 'r': right(); digitalWrite(ledPins[0], HIGH);
digitalWrite(ledPins[3], HIGH);
digitalWrite(ledPins[4], LOW);
digitalWrite(ledPins[5], LOW);
digitalWrite(ledPins[6], HIGH);
digitalWrite(ledPins[9], HIGH);
digitalWrite(ledPins[2], LOW);
digitalWrite(ledPins[7], LOW);break;
case 'l': left(); digitalWrite(ledPins[0], HIGH);
digitalWrite(ledPins[3], HIGH);
digitalWrite(ledPins[4], LOW);
digitalWrite(ledPins[5], LOW);
digitalWrite(ledPins[6], HIGH);
digitalWrite(ledPins[9], HIGH);
digitalWrite(ledPins[2], LOW);
digitalWrite(ledPins[7], LOW);
break;
}
}
}

void go(){
//Motore sinistro
digitalWrite(7,HIGH);
analogWrite(6,255);
//Motore destro
digitalWrite(4,HIGH);
analogWrite(5,255);
}
void stop(){
//Motore sinistro
digitalWrite(7,LOW);
analogWrite(6,0);
//Motore destro
digitalWrite(4,LOW);
analogWrite(5,0);
}
void back(){
//Motore sinistro
digitalWrite(7,LOW);
analogWrite(6,255);
//Motore destror

digitalWrite(4,LOW);
analogWrite(5,255);
}
void right(){
//Motore sinistro
digitalWrite(7,HIGH);
analogWrite(6,255);
//Motore destro
digitalWrite(4,LOW);
analogWrite(4,0);


}


void left(){
digitalWrite(7,LOW);
analogWrite(6,0);
//Motore destro
digitalWrite(4,HIGH);
analogWrite(5,255);

}

Foto robottino(shield xbee diversa ma struttura uguale):
http://imageshack.us/photo/my-images/22/imag0325w.jpg/

Grazieee
6  International / Software / Re: Far girare a destra e sinistra il mio robottino on: October 05, 2012, 10:54:20 am
mmm nn ho capito molto..cioè solo l'utilizzo del pmw mode ma come faccio a farlo ruotare di 90° sfruttando la libreria simpletimer??Grazie
7  International / Software / Far girare a destra e sinistra il mio robottino on: October 04, 2012, 11:05:20 am
ho costruito questo robottino

http://imageshack.us/a/img854/5521/imag0317kl.jpg

con arduino uno e shield motori 2A e gli ho caricato questo programmino:
char comando, vel;
int velocita=255;
const int pinsensore=2;
int statesens=HIGH;

void setup(){
Serial.begin(9600);
pinMode(6,OUTPUT);
pinMode(7,OUTPUT);
pinMode(4,OUTPUT);
pinMode(5,OUTPUT);
pinMode(pinsensore,INPUT);
}

void loop(){
if(digitalRead(pinsensore)==LOW) stop();
if(Serial.available()>0){
comando=Serial.read();
Serial.println(comando);
switch(comando){
case 'g': go();break;
case 's': stop(); break;
case 'b': back(); break;
case 'r': right(); break;
case 'l': left();go(); break;
case 'm': delay(500);
vel=Serial.read();
if(vel=='1') velocita=100;
else if(vel=='2') velocita=180;
else if(vel=='3') velocita=255;
if(vel) Serial.println("Velocita' modificata");
break;
}
}
}

void go(){
//Motore sinistro
digitalWrite(7,LOW);
analogWrite(6,velocita);
//Motore destro
digitalWrite(4,LOW);
analogWrite(5,velocita);
}
void stop(){
//Motore sinistro
digitalWrite(7,LOW);
analogWrite(6,0);
//Motore destro
digitalWrite(4,LOW);
analogWrite(5,0);
}
void back(){
//Motore sinistro
digitalWrite(7,HIGH);
analogWrite(6,velocita);
//Motore destror

digitalWrite(4,HIGH);
analogWrite(5,velocita);
}
void right(){
//Motore sinistro
digitalWrite(7,HIGH);
analogWrite(6,velocita);
//Motore destro
digitalWrite(4,LOW);
analogWrite(5,velocita);
}
void left(){
//Motore sinistro
digitalWrite(7,HIGH);
analogWrite(6,velocita);
//Motore destro

}
Link della shield motori che uso:
http://www.dfrobot.com/wiki/index.php?title=Arduino_Motor_Shield_(L298N)_(SKU:DRI0009)
tralasciando le righe di codice inerenti al sensore IR,quando tento di girare il robottino a destra o sinistra(case left/right) o gira su se stesso o va dritto.come mai?come devo modificare le funzioni left(),right() ??Io vorrei che quando deve girare a destra il mio robottino si fermi giri di 90° a destra e poi vada avanti.come faccio??avevo pensato di usare
la libreria simpletimer ma non so come implementare il tutto.mi aiutate???
Grazie
8  International / Generale / Re: Presentazioni nuovi iscritti, fatevi conoscere da tutti! on: October 04, 2012, 11:02:23 am
Ciao a tutti!!Con il mio arduino amo creare robottini!!!
Pages: [1]