Pages: [1] 2   Go Down
Author Topic: Problen with module robox IRdirection  (Read 2561 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi all.
I can not run the following module: http://www.cutedigi.com/robotics/irdirection-ir-breakout-with-uart.html
even with the simple example. I think it's a problem of the libraries. If anyone has ever used or known, please I would appreciate any help. Thank you.
« Last Edit: September 11, 2012, 06:07:19 am by Feder » Logged

Gosport, UK
Offline Offline
Faraday Member
**
Karma: 21
Posts: 3113
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Open Irdirection.cpp and replace
Code:
#include <WProgram.h>

with
Code:
#include "Arduino.h"
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you. I've done it, and have resolved all errors and I was able to load the program, but the module does not send any signal to arduino, I think there should be more errors in the library. I'll try to find them.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Feder,

Did you figure out what the problem is and how to solve it? I too am having the same issue where there is no response back from ir.fireway() method. I am guessing it has to do with the line "if(i==97)" in Irdirection.cpp. I am guessing the code changed from 97 to something else.

Thanks.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi prashsaka,
I could not get a response from the module. I have not found the problem. Seek from the line of code that you show me, "if (i == 97)", to see if I find it.

Thanks.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I got in touch with the customer service at CuteDigi and they suggested that I try swapping Tx and Rx. I tried that but I still couldn't make it work.

Based on their internal testing, it seems to be working. I am not sure why it isn't for me. The only difference is that I am using Arduino Uno and they have something else.

Here is what they sent me.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I think the problem may be in the libraries incompatible with the Arduino IDE version because <WProgram.h> referred to the original program, it disappears from the 0023 version.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I tried with 0.23 version but even that didn't work for me smiley-sad I can get rid of the compile error but I still can't see the response from the sensor. Did it work for you?

Thanks.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

No he recibido respuesta del modulo. Estoy igual que tu.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have received no response from the module. I'm just like you.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi, I have some more information. But, I am not sure whether or not this will help.

Based on another site http://www.arduino.cn/thread-30-1-1.html I see that the library and the example code have changed. I can't download the new zip file as I am required to register and I don't know how to register.

If you want to, you can certainly try downloading the new zip and see whether it will work.

Good luck.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hello, I was unable to register, do not understand the Chinese captchas. I tried searching the new libraries elsewhere, but have not found anything. The search continues........
Logged

0
Offline Offline
Newbie
*
Karma: 2
Posts: 5
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have one of those sensors and it is working pretty well. Internally it uses COM1 (4800). With the demo file from examples, you must connect the sensor to COM1 (it is hardcodded into the driver)

I use Arduino 1280 with Arduino 1.0.1 IDE

The test program is:
//############test for Serial1 in arduino1280,arduino2560#########

#include "Irdirection.h"
 
void setup()
{
 Serial.begin(9600);
}
void loop()
{
  irdirection x;
 char a=Serial.read();
 int w=x.fire(a);
 Serial.println(w);
}
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Sorin,

Thanks for the tip. By the way, do you have the libraries? And if so, could you share it with us? If you don't mind, could you copy and paste the contents of Irdirection.h and Irdirection.cpp files as replies to this post? If you prefer, you can email the libraries to me at psaka4 at gmail dot com.

I think I am using older libraries and they do not have any "fire" method. Using the sample code you provided with the libraries I have, I get a compile error on line "int w=x.fire(a);". Instead, the method is "int irdirection::fireway(int rx, int tx, int temp)".

Thanks a lot!
Logged

0
Offline Offline
Newbie
*
Karma: 2
Posts: 5
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

here are the driver files
****************************************************************************************************************
File1: Irdirection.h
/*
  robox irdirection 
               auther:haishen
               date:2012.6.21
               test in atmega1280
               from:arduino.cn
*/
#ifndef IRDIRECTION_H_
#define IRDIRECTION_H_


class irdirection
{
 public:
      irdirection();
      int fire(char temp);
  private:
     int sj;
};

#endif

********************************************************************************************************************
File2 : Irdirection.cpp
/*
  robox irdirection 
               auther:haishen
               test in atmega1280
               date:2012.6.21
               from:arduino.cn
*/
#include <arduino.h>
#include "irdirection.h"

irdirection::irdirection()
{
  Serial1.begin(4800);     //³õʼ»¯Ó²¼þ´®¿Ú1£¬Îª±£Ö¤Í¨ÐÅÎȶ¨£¬arduinoÓëÄ£¿éÖ®¼äµÄͨÐÅÉèÖÃΪ²¨ÌØÂÊ4800
}
int irdirection::fire(char temp)
{

  //unsigned int sj;
  unsigned char i;
  unsigned char hc[5];
  Serial1.print(temp); 
  while(1)
  {
    if(Serial1.read() == 0X0A)//¼ì²â½øÈë 
      break;
  }
  for(i = 0; i < 5; i++)
  {
    while(1)
    {
      if(Serial1.available())//½ÓÊÕ×Ö·û
        break;
    }
    hc = Serial1.read();
  }
  sj = 0;
  for(i = 0; i < 5; i++)
  {
    if((hc >= 48) && (hc < 58)) //ÅжÏÊÇ·ñ½áÊø
    {
      sj = sj * 10 + hc - 48;
    }
    else
      return(sj);
  }
 // return(0xffff);
    } 

* Irdirection.cpp (0.89 KB - downloaded 28 times.)
* Irdirection.h (0.33 KB - downloaded 15 times.)
Logged

Pages: [1] 2   Go Up
Jump to: