Skip to content

Commit 288d380

Browse files
committed
Move objects names to singular form
1 parent 003fc3b commit 288d380

26 files changed

+313
-208
lines changed

examples/Application/IrrigationSimple/CustomTasks.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ void openSolenoidValve()
3939
Serial.print("] Opening Valve: ");
4040

4141
// Open the Solid State Relay on Channel 1
42-
Relays.on(RELAYS_CH01);
42+
Relay.on(RELAY_CH01);
4343

4444
Serial.println("Valve Open");
4545
}
@@ -53,7 +53,7 @@ void closeSolenoidValve()
5353
Serial.print("] Closing Valve: ");
5454

5555
// Close the Solid State Relay on Channel 1
56-
Relays.off(RELAYS_CH01);
56+
Relay.off(RELAY_CH01);
5757

5858
Serial.println("Valve Closed");
5959
}
@@ -83,8 +83,8 @@ void getSensors()
8383

8484
Serial.print("Moisture: ");
8585

86-
auto value = getAverageInputsRead(INPUTS_05V_CH01);
87-
auto perc = getMoisturePerc(INPUTS_05V_CH01);
86+
auto value = getAverageInputRead(INPUT_05V_CH01);
87+
auto perc = getMoisturePerc(INPUT_05V_CH01);
8888

8989
DataPoint d{value, perc};
9090

examples/Application/IrrigationSimple/Helpers.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,33 +59,33 @@ float getAverage05VRead(int pin)
5959
constexpr size_t loops { 10 };
6060
constexpr float toV { 3.3f / float { (1 << ADC_RESOLUTION) - 1 } };
6161

62-
// Resistor divider on Inputs ports
62+
// Resistor divider on Input ports
6363
constexpr float rDiv { 17.4f / (10.0f + 17.4f) };
6464

6565
int tot { 0 };
6666

6767
analogReadResolution(ADC_RESOLUTION);
6868

69-
Inputs.enable();
69+
Input.enable();
7070
for (auto i = 0; i < loops; i++)
71-
tot += Inputs.analogRead(pin);
72-
Inputs.disable();
71+
tot += Input.analogRead(pin);
72+
Input.disable();
7373

7474
const auto avg = float { tot } * toV / float { loops };
7575

7676
return avg / rDiv;
7777
}
7878

79-
int getAverageInputsRead(int pin, const size_t loops)
79+
int getAverageInputRead(int pin, const size_t loops)
8080
{
8181
unsigned int tot { 0 };
8282

8383
analogReadResolution(ADC_RESOLUTION);
8484

85-
Inputs.enable();
85+
Input.enable();
8686
for (auto i = 0; i < loops; i++)
87-
tot += Inputs.analogRead(pin);
88-
Inputs.disable();
87+
tot += Input.analogRead(pin);
88+
Input.disable();
8989

9090
return tot / loops;
9191
}
@@ -96,7 +96,7 @@ int getMoisturePerc(int pin)
9696
static long dryValue { 2160 };
9797
static long wetValue { 975 };
9898

99-
auto val = getAverageInputsRead(pin);
99+
auto val = getAverageInputRead(pin);
100100

101101
// Self-update dry/wet values range.
102102
if (val > dryValue)

examples/Application/IrrigationSimple/Helpers.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@
44
#include "TimeHelpers.h"
55
#include <Arduino_EdgeControl.h>
66
#include <TimeAlarms.h>
7+
#include <mbed.h>
78

89
#include <list>
910
#include <map>
1011

1112
void setSystemClock(String date = __DATE__, String time = __TIME__);
1213
void statusPrint();
13-
int getAverageInputsRead(int pin, size_t loops = 20);
14+
int getAverageInputRead(int pin, size_t loops = 20);
1415
float getAverage05VRead(int pin);
1516
int getMoisturePerc(int pin);
1617

examples/Application/IrrigationSimple/IrrigationSimple.ino

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,19 +90,19 @@ void setup()
9090
// Init the sensors inputs.
9191
// If needed, will also take care of enabling the
9292
// 3V3 and 12V power rails and to initialize the IO Expander.
93-
Inputs.begin();
93+
Input.begin();
9494

9595
Latching.begin();
9696
Latching.channelDirection(LATCHING_OUT_1, POSITIVE);
9797
Latching.strobe(5000);
9898
Latching.channelDirection(LATCHING_OUT_1, NEGATIVE);
9999
Latching.strobe(5000);
100100

101-
Relays.begin();
101+
Relay.begin();
102102
delay(1000);
103-
Relays.on(RELAYS_CH01);
103+
Relay.on(RELAY_CH01);
104104
delay(5000);
105-
Relays.off(RELAYS_CH01);
105+
Relay.off(RELAY_CH01);
106106

107107
// Load alarm tasks list from file on SD.
108108
// See example alarmtab.txt for example and

examples/Application/IrrigationSimpleLCD/CustomTasks.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ void openSolenoidValve()
5454
LCD.print("Opening Valve ");
5555

5656
// Open the Solid State Relay on Channel 1
57-
Relays.on(RELAYS_CH01);
57+
Relay.on(RELAY_CH01);
5858

5959
LCD.setCursor(0, 1);
6060
LCD.print("Valve Open ");
@@ -74,7 +74,7 @@ void closeSolenoidValve()
7474
LCD.print("Closing Valve ");
7575

7676
// Close the Solid State Relay on Channel 1
77-
Relays.off(RELAYS_CH01);
77+
Relay.off(RELAY_CH01);
7878

7979
LCD.setCursor(0, 1);
8080
LCD.print("Valve Closed ");
@@ -110,8 +110,8 @@ void getSensors()
110110
String msg = "Moisture: ";
111111
Serial.print(msg);
112112

113-
auto value = getAverageInputsRead(INPUTS_05V_CH01);
114-
auto perc = getMoisturePerc(INPUTS_05V_CH01);
113+
auto value = getAverageInputRead(INPUT_05V_CH01);
114+
auto perc = getMoisturePerc(INPUT_05V_CH01);
115115

116116
DataPoint d{value, perc};
117117

examples/Application/IrrigationSimpleLCD/Helpers.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -102,33 +102,33 @@ float getAverage05VRead(int pin)
102102
constexpr size_t loops { 10 };
103103
constexpr float toV { 3.3f / float { (1 << ADC_RESOLUTION) - 1 } };
104104

105-
// Resistor divider on Inputs ports
105+
// Resistor divider on Input ports
106106
constexpr float rDiv { 17.4f / (10.0f + 17.4f) };
107107

108108
int tot { 0 };
109109

110110
analogReadResolution(ADC_RESOLUTION);
111111

112-
Inputs.enable();
112+
Input.enable();
113113
for (auto i = 0; i < loops; i++)
114-
tot += Inputs.analogRead(pin);
115-
Inputs.disable();
114+
tot += Input.analogRead(pin);
115+
Input.disable();
116116

117117
const auto avg = float { tot } * toV / float { loops };
118118

119119
return avg / rDiv;
120120
}
121121

122-
int getAverageInputsRead(int pin, const size_t loops)
122+
int getAverageInputRead(int pin, const size_t loops)
123123
{
124124
unsigned int tot { 0 };
125125

126126
analogReadResolution(ADC_RESOLUTION);
127127

128-
Inputs.enable();
128+
Input.enable();
129129
for (auto i = 0; i < loops; i++)
130-
tot += Inputs.analogRead(pin);
131-
Inputs.disable();
130+
tot += Input.analogRead(pin);
131+
Input.disable();
132132

133133
return tot / loops;
134134
}
@@ -139,7 +139,7 @@ int getMoisturePerc(int pin)
139139
static long dryValue { 2160 };
140140
static long wetValue { 975 };
141141

142-
auto val = getAverageInputsRead(pin);
142+
auto val = getAverageInputRead(pin);
143143

144144
// Self-update dry/wet values range.
145145
if (val > dryValue)

examples/Application/IrrigationSimpleLCD/Helpers.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,16 @@
44
#include "TimeHelpers.h"
55
#include <Arduino_EdgeControl.h>
66
#include <TimeAlarms.h>
7+
#include <mbed.h>
8+
#include <mbed_mktime.h>
79

810
#include <list>
911
#include <map>
1012

1113
void setSystemClock(String date = __DATE__, String time = __TIME__);
1214
void statusLCD();
1315
void backlightOff(bool powerDown);
14-
int getAverageInputsRead(int pin, size_t loops = 20);
16+
int getAverageInputRead(int pin, size_t loops = 20);
1517
float getAverage05VRead(int pin);
1618
int getMoisturePerc(int pin);
1719
void displayMsg(const String msg, const unsigned timeout = 5000, const unsigned line = 0, const bool clear = true, const bool off = true);

examples/Application/IrrigationSimpleLCD/IrrigationSimpleLCD.ino

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,19 +89,19 @@ void setup()
8989
// Init the sensors inputs.
9090
// If needed, will also take care of enabling the
9191
// 3V3 and 12V power rails and to initialize the IO Expander.
92-
Inputs.begin();
92+
Input.begin();
9393

9494
Latching.begin();
9595
Latching.channelDirection(LATCHING_OUT_1, POSITIVE);
9696
Latching.strobe(5000);
9797
Latching.channelDirection(LATCHING_OUT_1, NEGATIVE);
9898
Latching.strobe(5000);
9999

100-
Relays.begin();
100+
Relay.begin();
101101
delay(1000);
102-
Relays.on(RELAYS_CH01);
102+
Relay.on(RELAY_CH01);
103103
delay(5000);
104-
Relays.off(RELAYS_CH01);
104+
Relay.off(RELAY_CH01);
105105

106106
// Init the LCD display
107107
LCD.begin(16, 2);

examples/Application/LowPowerDataLogger/Helpers.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ void powerOn()
2222
Wire.begin();
2323
delay(500);
2424
Expander.begin();
25-
Inputs.begin();
25+
Input.begin();
2626
}
2727

2828
void powerOff()
@@ -35,24 +35,24 @@ void powerOff()
3535
}
3636
DebugSerial.println();
3737

38-
Inputs.end();
38+
Input.end();
3939
Expander.end();
4040
Wire.end();
4141
Power.off(PWR_3V3);
4242
Power.off(PWR_VBAT);
4343
pwrMutex.unlock();
4444
}
4545

46-
int getAverageInputsRead(int pin, const size_t loops)
46+
int getAverageInputRead(int pin, const size_t loops)
4747
{
4848
unsigned int tot { 0 };
4949

5050
analogReadResolution(ADC_RESOLUTION);
5151

52-
Inputs.enable();
52+
Input.enable();
5353
for (auto i = 0; i < loops; i++)
54-
tot += Inputs.analogRead(pin);
55-
Inputs.disable();
54+
tot += Input.analogRead(pin);
55+
Input.disable();
5656

5757
return tot / loops;
5858
}

examples/Application/LowPowerDataLogger/LowPowerDataLogger.ino

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
#include <SPIFBlockDevice.h>
3939
#include <TDBStore.h>
4040
#include <chrono>
41+
#include <mbed.h>
4142

4243
/*
4344
To enable debugging print on Serial Monitor define DEBUG on "DebugMode.h" or
@@ -298,7 +299,7 @@ void readSensors()
298299
delay(50);
299300
Expander.digitalWrite(EXP_LED1, HIGH);
300301

301-
auto value = getAverageInputsRead(INPUTS_05V_CH01, 10);
302+
auto value = getAverageInputRead(INPUT_05V_CH01, 10);
302303

303304
String key = "key_";
304305
auto ts = time(nullptr);

0 commit comments

Comments
 (0)