Skip to content

Commit 20ab6a7

Browse files
committed
Fixed keywords.txt.
Added `returnWheelSpeed()`. Algorithms.h/Algorithms.cpp renamed to Utils.h/Utils.cpp.
1 parent 23825dd commit 20ab6a7

File tree

6 files changed

+21
-7
lines changed

6 files changed

+21
-7
lines changed

keywords.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,10 @@ Controller KEYWORD1
33
Device KEYWORD1
44
WheelSpeedSensor KEYWORD1
55
pulseTriggered KEYWORD2
6-
equivalent KEYWORD2
6+
equivalent KEYWORD2
7+
returnWheelSpeed KEYWORD2
8+
LEFT_FRONT_WHEEL_SPEED_SENSOR LITERAL1
9+
RIGHT_FRONT_WHEEL_SPEED_SENSOR LITERAL1
10+
CENTER_REAR_WHEEL_SPEED_SENSOR LITERAL1
11+
LEFT_REAR_WHEEL_SPEED_SENSOR LITERAL1
12+
RIGHT_REAR_WHEEL_SPEED_SENSOR LITERAL1

src/LEADS.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#include "Algorithms.h"
21
#include "Controller.h"
32
#include "Device.h"
43
#include "WheelSpeedSensor.h"
4+
#include "Utils.h"
55
#include "PredefinedTags.h"

src/Algorithms.cpp renamed to src/Utils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "Algorithms.h"
1+
#include "Utils.h"
22
#include "Arduino.h"
33

44
bool pulseTriggered(int pin) { return digitalRead(pin) == LOW; }
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#ifndef ALGORITHMS_H
2-
#define ALGORITHMS_H
1+
#ifndef UTILS_H
2+
#define UTILS_H
33

44

55
bool pulseTriggered(int pin);
@@ -9,4 +9,4 @@ bool equivalent(long a, long b, float epsilon);
99
bool equivalent(float a, float b, float epsilon);
1010

1111

12-
#endif // ALGORITHMS_H
12+
#endif // UTILS_H

src/WheelSpeedSensor.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#include "WheelSpeedSensor.h"
2-
#include "Algorithms.h"
2+
#include "Utils.h"
33

44
WheelSpeedSensor::WheelSpeedSensor(int *const pins, OnUpdate onUpdate) : Device<float>(pins), _onUpdate(onUpdate) {
55
}
@@ -32,3 +32,9 @@ float WheelSpeedSensor::read() {
3232
String WheelSpeedSensor::debug() {
3333
return String(_t1) + " " + String(_t2);
3434
}
35+
36+
void returnWheelSpeed(String header, float n) {
37+
Serial.print(tag + ":");
38+
Serial.print(n);
39+
Serial.print(";");
40+
}

src/WheelSpeedSensor.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,7 @@ class WheelSpeedSensor : public Device<float> {
1919
String debug();
2020
};
2121

22+
void returnWheelSpeed(String header, float n);
23+
2224

2325
#endif // WHEELSPEEDSENSOR_H

0 commit comments

Comments
 (0)