Forum >Question about URM04-Libraries
ArduinoGeneral

Question about URM04-Libraries

userHead arduinofish 2012-06-05 11:04:24 7472 Views19 Replies
Hello,

i am using the URM04 Ultrasonic-ranger. Both libraries, Urm4parser and rxURM4, writing "U2" to the console when metering. Is it possible to avoid this? i just want to have the integer value to use it in "processing".


thanks
Peter
2012-06-11 06:17:56 thanks,... i found something for custom protocols.

Thread can be closed.
userHeadPic arduinofish
2012-06-11 06:17:56 thanks,... i found something for custom protocols.

Thread can be closed.
userHeadPic arduinofish
2012-06-07 23:02:22 ;)

You could custom a serial communication protocol for your project with the header byte and the sum byte.
When processing received the header byte, start  to read the distance value.
userHeadPic Lauren
2012-06-07 23:02:22 ;)

You could custom a serial communication protocol for your project with the header byte and the sum byte.
When processing received the header byte, start  to read the distance value.
userHeadPic Lauren
2012-06-07 22:28:44 actually if i want to use the output at processing its not very useful. i will see how to ignore this stuff. userHeadPic arduinofish
2012-06-07 22:28:44 actually if i want to use the output at processing its not very useful. i will see how to ignore this stuff. userHeadPic arduinofish
2012-06-07 22:11:58 :)

You're right. If you ganna to drive the sensor, using IO expansion shield v5 and mega. You need to wiring the Serial0 on the mega to the io expansion shield v5.

But I think the console is just used to debug the software, so it shouldn't case a big problem that show "U2". Right?
userHeadPic Lauren
2012-06-07 22:11:58 :)

You're right. If you ganna to drive the sensor, using IO expansion shield v5 and mega. You need to wiring the Serial0 on the mega to the io expansion shield v5.

But I think the console is just used to debug the software, so it shouldn't case a big problem that show "U2". Right?
userHeadPic Lauren
2012-06-07 22:04:42 Well,.. but the IOExpansion Shield V5 uses serial0. mmhh :( userHeadPic arduinofish
2012-06-07 22:04:42 Well,.. but the IOExpansion Shield V5 uses serial0. mmhh :( userHeadPic arduinofish
2012-06-07 18:03:57 Hi, peter

The "U2" is the command to read sensor data from URM04 via the TTL interface.But the serial monitor is also using TTL interface.If you ganna to avoid it, you could use mega board to drive the URM via Serial1.Also change your code and hardware connection a little bit.

Regards
Lauren ;)
userHeadPic Lauren
2012-06-07 18:03:57 Hi, peter

The "U2" is the command to read sensor data from URM04 via the TTL interface.But the serial monitor is also using TTL interface.If you ganna to avoid it, you could use mega board to drive the URM via Serial1.Also change your code and hardware connection a little bit.

Regards
Lauren ;)
userHeadPic Lauren
2012-06-07 09:52:02 any ideas?:) userHeadPic arduinofish
2012-06-07 09:52:02 any ideas?:) userHeadPic arduinofish
2012-06-06 00:05:32 its printed everytime there is a request to the sensor

in the Urm4praser its printByte(cmdst[j]); in this function.

[code]
void transmitCommands(){  // Send protocol via RS485 interface
  cmdst[5]=cmdst[0]+cmdst[1]+cmdst[2]+cmdst[3]+cmdst[4];
  delay(1);
  for(int j = 0; j < 6; j++){
    printByte(cmdst[j]);
//    delayMicroseconds(10);
  }
  delay(2);
}
[/code]

There is something compareable in the rxURM4.h.
userHeadPic arduinofish
2012-06-06 00:05:32 its printed everytime there is a request to the sensor

in the Urm4praser its printByte(cmdst[j]); in this function.

[code]
void transmitCommands(){  // Send protocol via RS485 interface
  cmdst[5]=cmdst[0]+cmdst[1]+cmdst[2]+cmdst[3]+cmdst[4];
  delay(1);
  for(int j = 0; j < 6; j++){
    printByte(cmdst[j]);
//    delayMicroseconds(10);
  }
  delay(2);
}
[/code]

There is something compareable in the rxURM4.h.
userHeadPic arduinofish
2012-06-05 20:01:30 Hi Peter,


I haven't used these libraries. Do you get the U2 in the console every time a value is returned or only for the first time?


You could write a function in processing to look for "U2" as a header for the sensor value, or just write a function which ignores the U2 value.



userHeadPic Hector
2012-06-05 20:01:30 Hi Peter,


I haven't used these libraries. Do you get the U2 in the console every time a value is returned or only for the first time?


You could write a function in processing to look for "U2" as a header for the sensor value, or just write a function which ignores the U2 value.



userHeadPic Hector
2012-06-05 11:04:24 Hello,

i am using the URM04 Ultrasonic-ranger. Both libraries, Urm4parser and rxURM4, writing "U2" to the console when metering. Is it possible to avoid this? i just want to have the integer value to use it in "processing".


thanks
Peter
userHeadPic arduinofish