
# finish driving single URM function
# if use the IO expansion shield to drive the urm sensors, the measuring rate
may be 20Hz or slower[if you want].
# The sample code is compatible with the Arduino IDE 1.0 and also the earlier
version.
*/
#include "Urm4parser.h"
void setup(){
urmInit(); // Init the URM04 sensor
}
void loop(){
static unsigned long timePoint = 0;
runUrm4(); // Drive URM04 Sensor and transmit the protocol to the sens
or via RS485 interface
// (IO Expansion shield V5 for arduino)
decodeURM4(); // Read and get the distance value from the sensor
if(millis() - timePoint > 100){
PrintData(); // print the data
timePoint = millis();
}
// PrintData();
// delay(100);
}
void PrintData(){
Serial.print("Distance value: ");
for(int i = 0; i < urmAccount; i++){