1
2 // # Editor : ZRH from DFRobot
3 // # Date : 29.08.2014
4
5 // # Product name: URM V4.0 ultrasonic sensor
6 // # Product SKU : SEN0001
7 // # Version : 1.0
8
9 // # Description:
10 // # The sketch for using the URM37 Serial mode from DFRobot
11 // # and writes the values to the serialport
12
13 // # Connection:
14 // # Vcc (Arduino) -> Pin 1 VCC (URM V4.0)
15 // # GND (Arduino) -> Pin 2 GND (URM V4.0)
16 // # Pin TX1 (Arduino) -> Pin 8 RXD (URM V4.0)
17 // # Pin RX0 (Arduino) -> Pin 9 TXD (URM V4.0)
18 // # Working Mode: Serial Mode.
19
20 uint8_t EnTempCmd[4]={0x11,0x00,0x00,0x11}; // temperature measure comm
and
21 uint8_t TempData[4];
22 unsigned int TempValue=0;
23 void setup()
24 {
25 Serial.begin(9600);
26 delay(100);
27 Serial.println("Init the sensor");
28 }
29 void loop()
30 {
31 SerialCmd();
32 delay(200);
33 }