Show Posts
Pages: [1]
1  Topics / Robotics / Someon help me out. Wireless controll caterpillar vehicle. VB program on PC. on: December 12, 2011, 02:26:09 am
I'm very interesting on the wireless controll vehicle. My plan is to use Arduino on the vehicle, and run VB programed on PC to wireless control the vehicle. I just want to start with the USB to serial APC220 based wireless transmitting & receiver. Can somebody answer me how to encode the wireless realtime control the vehicle & put a kind of sample codes here, and the VB control program. later on I'd like to put more servos and camera on this system. plx help me out. tkx.
2  Topics / Robotics / Re: autonomous car on: December 11, 2011, 06:48:34 am
continue interprete DC driver.
http://robotbase.taobao.com/search.htm?spm=11028vrd.3-1lRnb.6-2sLVzs&scid=123975700&scname=1rHB97Xnu%2FrH%2FbavsOU%3D&checkedRange=true&queryType=cat
There is another project using the ultrasonic sensor to detect thing 50cm and light up the light.  ultrasonic sensor is RB URF v1.1
http://item.taobao.com/item.htm?spm=11028vrd.3-1lRnb.2328234110&id=2723263199&
Code:
int inputPin=4;  // 定义超声波信号接收接口          define the ultrasonic receive port 
int outputPin=5; // 定义超声波信号发出接口          define the ultrasonic emitting port
int ledpin=13;
void setup()
{
  Serial.begin(9600);
  pinMode(ledpin,OUTPUT);
  pinMode(inputPin, INPUT);
  pinMode(outputPin, OUTPUT);
}
void loop()

{
  digitalWrite(outputPin, LOW); // 使发出发出超声波信号接口低电平2μs        disable ultrasonic emitting 
  delayMicroseconds(2);                                                      delay 2μs
  digitalWrite(outputPin, HIGH); // 使发出发出超声波信号接口高电平10μs,这里是至少10μs      enable ultrasonic emitting,
  delayMicroseconds(10);                                                                      delay 10μs
  digitalWrite(outputPin, LOW);    // 保持发出超声波信号接口低电平                           disable ultrasonic emitting 
  int distance = pulseIn(inputPin, HIGH);  // 读出脉冲时间                                    read pulse
  distance= distance/58;   // 将脉冲时间转化为距离(单位:厘米)                              convert pulse into distance
  Serial.println(distance);   //输出距离值                                                   serial output distance
  delay(50);   
  if (distance >=50)
  {//如果距离大于50厘米小灯亮起                                     if distance is greater than 50cm, light the LED
     digitalWrite(ledpin,HIGH);
  }//如果距离小于50厘米小灯熄灭                                       if distance is smaller than 50cm, go out the LED
  else
     digitalWrite(ledpin,LOW);
}
3  Topics / Robotics / Re: autonomous car on: December 11, 2011, 06:22:15 am
First I can understand your feeling so far as a student in the school. All I want to know is you don' t have the coach from the teacher.Anyway I'm still a beginner for the Arduino. I purchase board from Taobao.com in China. And I'd like to share you some of my material for you. All the following is not exactly what you really need maybe, but I positively think you can start it up and just put the ultrasonic sensor together in the Arduino.
The vehicle platform. You also can visit the link(I don't mean a adv.) hope you don't mind the chinese web page. you can build the whole picture in this project.
http://trade.taobao.com/trade/itemlist/listBoughtItems.htm?action=itemlist/QueryAction&event_submit_do_query=1&prePageNo=1&clickMore=0&pageNum=2
Attach the program code as following, please ignore the chinese comment. I manually comment in English, wish it's helpful to you.
Code:
void setup()
{
  pinMode(8,OUTPUT);//定义I1接口                                define I1 port
  pinMode(9,OUTPUT);//定义I2接口                                define I2 port
  pinMode(10,OUTPUT);//定义EA(PWM调速)接口                      define EA PWM
  pinMode(5,OUTPUT);//定义EB(PWM调速)接口                       define EB PWM
  pinMode(6,OUTPUT);//定义I4接口                                define I4                            
  pinMode(7,OUTPUT);//定义I3接口                                define I3
  pinMode(3,INPUT);//定义左侧避障                               define left aviod obstacle sensor
  pinMode(4,INPUT);//定义中间避障                               define middle aviod obstacle sensor
  pinMode(11,INPUT);//定义右侧避障                              define right aviod obstacle sensor

}
void qianjin(int a)//前进                                      go forward sub
{
     analogWrite(10,a);//输入模拟值进行设定速度                analog value to set the speed
     analogWrite(5,a);                                        
     digitalWrite(7,LOW);//使直流电机(右)顺时针转            enable Right DC Motor clockwise rotate
     digitalWrite(6,HIGH);
     digitalWrite(8,HIGH);//使直流电机(左)逆时针转           enable Left DC Motor counter-clockwise rotate
     digitalWrite(9,LOW);

}
void youzhuan(int b)//右转                                     Turn right
{
     analogWrite(10,b);//输入模拟值进行设定速度                analog value to set the speed        
     analogWrite(5,b);
     digitalWrite(7,HIGH);//使直流电机(右)逆时针转           enable Right DC Motor counter-clockwise rotate
     digitalWrite(6,LOW);
     digitalWrite(8,HIGH);//使直流电机(左)顺时针转           enable Left DC Motor clockwise rotate
     digitalWrite(9,LOW);

}
void zuozhuan(int c)//左转                                    Turn Left
{
     analogWrite(10,c);//输入模拟值进行设定速度              analog value to set the speed  
     analogWrite(5,c);
     digitalWrite(7,LOW);//使直流电机(右)顺时针转          enable Right DC Motor clockwise rotate
     digitalWrite(6,HIGH);
     digitalWrite(8,LOW);//使直流电机(左)顺时针转          enable Left DC Motor clockwise rotate
     digitalWrite(9,HIGH);

}
void tingzhi()//停止                                         Stop
{
     digitalWrite(7,HIGH);//使直流电机(右)停转            enable Right DC Motor stop
     digitalWrite(6,HIGH);
     digitalWrite(8,HIGH);//使直流电机(左)停转            enable Left DC Motor stop
     digitalWrite(9,HIGH);
}
void houtui(int d)//后退                                    Go backward
{
     analogWrite(10,d);//输入模拟值进行设定速度             analog value to set the speed      

     analogWrite(5,d);
     digitalWrite(7,HIGH);//使直流电机(右)逆时针转       enable Right DC Motor counter-clockwise rotate  
     digitalWrite(6,LOW);
     digitalWrite(8,LOW);//使直流电机(左)顺时针转        enable Left DC Motor clockwise rotate
     digitalWrite(9,HIGH);
}
void loop()
{
    int r,m,l;
    r=digitalRead(11);
    m=digitalRead(4);
    l=digitalRead(3);
    if(l==HIGH &&m==HIGH && r==HIGH)
    qianjin(200);
    if(l==LOW &&m==LOW  && r==LOW )
      {
        houtui(200);
        delay(300);
        youzhuan(200);
        delay(300);
      }
    if(l==LOW &&m==HIGH  && r==LOW )
      {
        houtui(200);
        delay(300);
        youzhuan(200);
        delay(300);
      }
    if(l==HIGH  &&m==LOW  && r==HIGH  )
      {
        houtui(200);
        delay(300);
        youzhuan(200);
        delay(300);
      }
    if(l==LOW &&m==LOW  && r==HIGH )
    youzhuan(200);
    if(l==LOW && m==HIGH && r==HIGH)
    youzhuan(200);
    if(l==HIGH &&m==LOW  && r==LOW )
    zuozhuan(200);
    if(l==HIGH &&m==HIGH  && r==LOW )
    zuozhuan(200);
}


4  Topics / Robotics / Re: Internet controlled RC car. Is it possible? on: December 11, 2011, 02:56:21 am
it's really interesting. i'm so far working on the serial control a vehicle. I can not handle the encoding to control the vehicle. smiley-fat
5  Topics / Robotics / Re: IR Battle Tanks on: December 11, 2011, 01:47:06 am
hi Paulware, http://paulware.comeze.com/#Heng Long 1/16 Tank is really a good stuffs link. tkx sharing.
Pages: [1]