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.
Open Irdirection.cpp and replace
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.
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.
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.
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.
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.
I tried with 0.23 version but even that didn't work for me I can get rid of the compile error but I still can't see the response from the sensor. Did it work for you?
No he recibido respuesta del modulo. Estoy igual que tu.
I have received no response from the module. I'm just like you.
Hi, I have some more information. But, I am not sure whether or not this will help.
Based on another site Robox Irdirection-红外方向传感器模块-Arduino中文社区 - Powered by Discuz! 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.
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........
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#########
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!
here are the driver files
test in atmega1280
int fire(char temp);
File2 : Irdirection.cpp
test in atmega1280
int irdirection::fire(char temp)
//unsigned int sj;
unsigned char i;
unsigned char hc;
if(Serial1.read() == 0X0A)//¼ì²â½øÈë
for(i = 0; i < 5; i++)
hc = Serial1.read();
I'm fairly new to Arduino, just got this module and been having the same problems as above. Has anybody found a full solution?
Thanks Sorin for posting the code. I know it has been a while but I wanted to thank you ... I tried your libraries a while back and even they seemed to have an issue. So, I gave up on this project altogether.
I found that the example code did not work with an UNO but does work with a MEGA.
Hi all. I had the same problem. My robox irdirection not work on MEGA 2560.
Below solution :
Serial3.begin(9600); // output to PC or other device
Serial3.println(“Running IR Fire detection…”);
Serial2.begin(4800); // port connected to Robox IRDirection module
int fire(char num_diode)
Serial2.print(num_diode); // select diode on IrDiredtion module
if(Serial2.read() == 10) //stop at begin of data
for(i = 0; i < 5; i++)
if(Serial2.available()) // wait to ready for transmit
c = Serial2.read();
- for(i = 0; i < 5; i++)*
if((c >= 48) && (c < 58)) // ASCII table 48 - “0” … 57 -“9”
_ val = val * 10 + c - 48;
for(i = 0; i < 7; i++)