Show Posts
Pages: [1]
1  Using Arduino / Project Guidance / Arduino Internet: Ethernet shield VS. Wifi shield on: February 28, 2014, 10:01:48 pm
Hello! Arduino,

Could anyone please tell me what is the function of arduino Ethernet shield with POE module? How does this POE work in arduino, does it out put the power to power up the arduino? or input the power to power the wireless router?

And my other question is: which shield is better for arduino Internet project? Wifi shield or Ethernet shield??

Any suggestion would be appreciate!

Tony
2  Using Arduino / Programming Questions / Re: IRremote library "Error Compilling" Help! on: October 21, 2012, 08:49:56 pm
ok! Here you go. The following is my code and it work on my rover. Thank you guys.

Code:
///重复码的部分没处理好,我按着不放,它就动一下就不动了
#include <IRremote.h>


#define E1 6//左电机引脚

#define E2 5

#define M1 8//右电机引脚

#define M2 7

//红外遥控逻辑代码  自己通过串口监视器可以找出
#define UP    0xC26BF044    //我的遥控器UP键
#define DOWN  0xC4FFB646    //我的遥控器DOWN键
#define LEFT  0x758C9D82    //我的遥控器LEFT键
#define RIGHT 0x53801EE8   //我的遥控器RIGHT键
#define STOP  0x8AF13528    //我的遥控器STOP键


int RECV_PIN = 11;     //红外接收信号引脚

IRrecv irrecv(RECV_PIN);//初始化

decode_results results;//定义结构体类型

void setup()
{
  Serial.begin(9600);
  irrecv.enableIRIn(); // 开始接收
}

void loop()
{
  if (irrecv.decode(&results))
  {
        Serial.println(results.value, HEX);

        switch(results.value)
        {
              case UP://2键前进
              advance(255);
              break;
              case LEFT://4键左转
              left_handed(255);
              break;
              case DOWN://8键后退
              retreat(255);
              break;
              case RIGHT://6键右转
              right_handed(255);
              break;
              case STOP://5键前进
              stop_m();
              break;
             default:
delay(100);

        }
        irrecv.resume(); // Receive the next value
  }
 



}




void foreward_mechine_a()//左电机正转
{
    analogWrite(E1,255);
    digitalWrite(M1,LOW);

}
void inversion_mechine_a()//左电机反转
{
    analogWrite(E1,255);
    digitalWrite(M1,HIGH);

 
}

void stop_a(void)//左电机停止
{
      digitalWrite(E1,LOW);

}

void stop_b(void)//右电机停止
{
      digitalWrite(E2,LOW);

}

void foreward_mechine_b()//右电机正转
{
    analogWrite(E2,255);
    digitalWrite(M2,LOW);

}
void inversion_mechine_b()//右电机反转
{
    analogWrite(E2,255);
    digitalWrite(M2,HIGH);
 
}
void advance(int time)//小车前进
{
     foreward_mechine_a();
     foreward_mechine_b();
    delay(time); 
}
void retreat(int time)//小车后退
{
      inversion_mechine_a();
      inversion_mechine_b();
      delay(time); 
}

void left_handed(int time)//小车左转
{
    inversion_mechine_a();
    foreward_mechine_b();
    delay(time);
   
}
void right_handed(int time)//小车右转
{
    foreward_mechine_a();
    inversion_mechine_b();
    delay(time);
}
void stop_m(void)//小车停止
{
      stop_a();
      stop_b();
}
3  Using Arduino / Programming Questions / Re: IRremote library "Error Compilling" Help! on: October 20, 2012, 10:49:18 pm
IRrecvDemo.pde only includes IRremote.h and not IRremoteInt.h.  I think you should do the same.

Hello! johnwasser,

Thank you for your quick reply. Your suggestion works. However, my Robot Car isn't moving. Can you help me modify my code?

Here is the sample code in Manual on page 23

http://www.robotshop.com/content/PDF/dfrobotshop-rover-user-guide.pdf

Thank you!
4  Using Arduino / Programming Questions / IRremote library "Error Compilling" Help! on: October 20, 2012, 09:20:17 pm
Hello!

I'm working on my DFRobotShop Rover and I'm trying to control my car via Infrared and using IRremote library(https://github.com/shirriff/Arduino-IRremote).

However, After I verify the code it appear the error message:

Quote

IRremote\IRremote.cpp.o: In function "MATCH (int , int)':
/IRremoteInt.h:176:multiple definition of 'MATCH (int, int)'
sketch_oct21a.cpp.o:C:\\Documents and Settings\Administrator\My Documents\Arduino\libraries\IRremote/IRremoteInt.h:176: first defined here




Below is my code:

Code:
////重复码的部分没处理好,我按着不放,它就动一下就不动了
#include <IRremote.h>
#include <IRremoteInt.h>


//红外遥控逻辑代码  自己通过串口监视器可以找出
#define UP    0xC26BF044    //我的遥控器UP键
#define DOWN  0xC4FFB646    //我的遥控器DOWN键
#define LEFT  0x758C9D82    //我的遥控器LEFT键
#define RIGHT 0x53801EE85LL   //我的遥控器RIGHT键
#define STOP  0x8AF13528    //我的遥控器STOP键

/*To control the rover, Copy and paste the code below into the Arduino software*/
int E1 = 6; //M1 Speed Control
int E2 = 5; //M2 Speed Control
int M1 = 8; //M1 Direction Control
int M2 = 7; //M2 Direction Control



int RECV_PIN = 11;     //红外接收信号引脚

IRrecv irrecv(RECV_PIN);//初始化

decode_results results;//定义结构体类型


void setup(void)
{
  int i;
  for(i=5;i<=8;i++)
  pinMode(i, OUTPUT);
  Serial.begin(9600);
 
   irrecv.enableIRIn(); // 开始接收
}





void loop(void)
{
  if (irrecv.decode(&results))
  {
        Serial.println(results.value, HEX);

int leftspeed = 255;
int rightspeed = 255;

        switch(results.value)
        {
              case UP://2键前进
                forward (leftspeed,rightspeed);
                break;
              case DOWN://4键左转
                reverse (leftspeed,rightspeed);
                break;
              case LEFT://8键后退
                left (leftspeed,rightspeed);
                break;
              case RIGHT://6键右转
                right (leftspeed,rightspeed);
                break;
              case STOP://5键前进
                stop();
                break;
             default:
                stop();
                delay(100);
        }
        irrecv.resume(); // Receive the next value
  }
      stop();//松开按钮停止
}





void stop(void) //Stop
{
  digitalWrite(E1,LOW);
  digitalWrite(E2,LOW);
}
void forward(int a,int b)
{
  analogWrite (E1,a);
  digitalWrite(M1,LOW);
  analogWrite (E2,b);
  digitalWrite(M2,LOW);
}
void reverse (int a,int b)
{
  analogWrite (E1,a);
  digitalWrite(M1,HIGH);
  analogWrite (E2,b);
  digitalWrite(M2,HIGH);
}
void left (int a,int b)
{
  analogWrite (E1,a);
  digitalWrite(M1,HIGH);
  analogWrite (E2,b);
  digitalWrite(M2,LOW);
}
void right (int a,int b)
{
  analogWrite (E1,a);
  digitalWrite(M1,LOW);
  analogWrite (E2,b);
  digitalWrite(M2,HIGH);
}


Please help me figure out what's wrong with my program.

Thank you!
Tony
5  Development / Other Hardware Development / which is best Wifi shield for arduino? on: October 09, 2012, 08:46:12 am
 :)Hello! Anyone,

Any suggest which wifi shield best work for Arduino?

Also, any app for iphone to use iphone as the remote control?

Thank you!
6  Development / Other Hardware Development / which is best Wifi shield for arduino? on: October 09, 2012, 08:45:42 am
Hello! Anyone,

Any suggest which wifi shield best work for Arduino?

Also, any app for iphone to use iphone as the remote control?

Thank you!
7  Using Arduino / Installation & Troubleshooting / arduino 1.0.1 menu bar error. on: October 04, 2012, 12:11:22 pm
Hello!

My arduino 1.0.1 menu bar have incorrect error.

Please help me how to fix this problem.

Thank you!
Pages: [1]