Skip to content

Commit 5569a7b

Browse files
rootroot
root
authored and
root
committed
@miles updated URM37 library for Arduino 1.0
1 parent 1f1a4a5 commit 5569a7b

File tree

4 files changed

+58
-14
lines changed

4 files changed

+58
-14
lines changed

lib/URMSerial/URMSerial.cpp renamed to URMSerial.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
*/
4646

4747
#include "URMSerial.h"
48-
#include <HardwareSerial.h>
4948

5049
URMSerial::URMSerial(void)
5150
{

lib/URMSerial/URMSerial.h renamed to URMSerial.h

+9-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
/*
55
URMSerial.h - URM 37 Control Library Version 2.0.0
6-
Author: Miles Burton, miles@mnetcs.com
6+
Author: Miles Burton, www.milesburton.com
77
Copyright (c) 2009 Miles Burton All Rights Reserved
88
99
This library is free software; you can redistribute it and/or
@@ -38,11 +38,18 @@
3838
3939
*/
4040

41+
#include <Arduino.h>
42+
4143
#include <inttypes.h>
4244
#include <stdio.h>
45+
#include "HardwareSerial.h"
4346

44-
#include <Arduino.h>
47+
#if defined(ARDUINO) && ARDUINO >= 100
4548
#include <SoftwareSerial.h>
49+
#else
50+
#include <NewSoftSerial.h>
51+
#endif
52+
4653

4754
// The measurement we're taking
4855
#define DISTANCE 1

src/example.ino renamed to examples/DistanceBySoftwareSerial/DistanceBySoftwareSerial.ino

+3-11
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
2-
DistanceBySoftwareSerial.pde - URM 37 Control Library Version 2.0.0
3-
Author: Miles Burton, miles@mnetcs.com
2+
DistanceBySoftwareSerial.pde - URM 37 Control Library Version 2.5.0
3+
Author: Miles Burton, www.milesburton.com
44
Copyright (c) 2009 Miles Burton All Rights Reserved
55
66
This library is free software; you can redistribute it and/or
@@ -19,16 +19,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1919
2020
*/
2121

22+
#include <SoftwareSerial.h>
2223
#include <URMSerial.h>
2324

24-
25-
// The measurement we're taking
26-
#define DISTANCE 1
27-
#define TEMPERATURE 2
28-
#define ERROR 3
29-
#define NOTREADY 4
30-
#define TIMEOUT 5
31-
3225
URMSerial urm;
3326

3427
int value; // This value will be populated
@@ -61,7 +54,6 @@ int getMeasurement()
6154
void setup() {
6255
Serial.begin(9600); // Sets the baud rate to 9600
6356
urm.begin(7,6,9600); // RX Pin, TX Pin, Baud Rate
64-
//urm.setMode(MODE_SERIAL);
6557
Serial.println("URM37 Library by Miles Burton - Distance. Version 2.0"); // Shameless plug
6658
}
6759

keywords.txt

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#######################################
2+
# Syntax Coloring Map For URM37
3+
#######################################
4+
5+
#######################################
6+
# FUNCTIONS (KEYWORD2)
7+
#######################################
8+
9+
Firmata KEYWORD1
10+
callbackFunction KEYWORD2
11+
hasReading KEYWORD2
12+
reqTimeout KEYWORD2
13+
getMeasurement KEYWORD2
14+
requestMeasurement KEYWORD2
15+
requestMeasurementOrTimeout KEYWORD2
16+
setServo KEYWORD2
17+
setServoMax KEYWORD2
18+
setServoMin KEYWORD2
19+
setTimeout KEYWORD2
20+
setSensorThresholdMin KEYWORD2
21+
setSensorThresholdMax KEYWORD2
22+
getSensorThresholdMin KEYWORD2
23+
getSensorThresholdMax KEYWORD2
24+
setMode KEYWORD2
25+
26+
#######################################
27+
# Constants (LITERAL1)
28+
#######################################
29+
30+
DISTANCE LITERAL1
31+
TEMPERATURE LITERAL1
32+
ERROR LITERAL1
33+
NOTREADY LITERAL1
34+
TIMEOUT LITERAL1
35+
COMMAND_TEMP LITERAL1
36+
COMMAND_DISTANCE LITERAL1
37+
COMMAND_EEPROMREAD LITERAL1
38+
COMMAND_EEPROMWRITE LITERAL1
39+
Header LITERAL1
40+
HighByte LITERAL1
41+
LowByte LITERAL1
42+
Sum LITERAL1
43+
MODE_SERIAL LITERAL1
44+
MODE_AUTO LITERAL1
45+
MODE_PWM LITERAL1
46+

0 commit comments

Comments
 (0)