Pages: 1 [2]   Go Down
Author Topic: Problen with module robox IRdirection  (Read 2666 times)
0 Members and 1 Guest are viewing this topic.
London/ Leicester UK
Offline Offline
Newbie
*
Karma: 0
Posts: 8
Mechatronic Engineering Student. Using arduino for home and course projects.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey Guys

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
Logged

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

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.

~ Prash.
Logged

London/ Leicester UK
Offline Offline
Newbie
*
Karma: 0
Posts: 8
Mechatronic Engineering Student. Using arduino for home and course projects.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I found that the example code did not work with an UNO but does work with a MEGA.
Logged

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

Hi all. I had the same problem. My robox irdirection not work on MEGA 2560.
Below solution :

"

#include <SoftwareSerial.h>
void setup() 
{
  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)
{
  int  val,i;
  char c[5];

  Serial2.print(num_diode);  // select diode on IrDiredtion module

  while(1)
  {
    if(Serial2.read() == 10)  //stop at begin of data
      break;
  }

  for(i = 0; i < 5; i++)
  {
    while(1)
    {
      if(Serial2.available()) // wait to ready for transmit
        break;
    }

   c = Serial2.read();
  }

  val=0;
  for(i = 0; i < 5; i++)
  {
    if((c >= 48) && (c < 58)) // ASCII table 48 - "0" ... 57 -"9"
    {
      val = val * 10 + c - 48;
    }
    else
      return(val);
  }
}
/***********************************************************************/
void loop()
{
  int i,s;

  for(i = 0; i < 7; i++)
  {
      s=fire(i);
      Serial3.print(s);     
      Serial3.print(" ");
  }
      Serial3.println();
      delay(1000);
 }
"
Logged

Pages: 1 [2]   Go Up
Jump to: