Skip to content

Commit 17d742c

Browse files
committed
Add Y700 to menu-a-la-carte example
#421, #423
1 parent 5c8cc20 commit 17d742c

File tree

3 files changed

+35
-3
lines changed

3 files changed

+35
-3
lines changed

examples/menu_a_la_carte/menu_a_la_carte.ino

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2221,6 +2221,38 @@ Variable* y560Temp =
22212221
#endif
22222222

22232223

2224+
#if defined BUILD_SENSOR_YOSEMITECH_Y700
2225+
// ==========================================================================
2226+
// Yosemitech Y700 Pressure Sensor
2227+
// ==========================================================================
2228+
/** Start [yosemitech_y700] */
2229+
#include <sensors/YosemitechY700.h>
2230+
2231+
// NOTE: Extra hardware and software serial ports are created in the "Settings
2232+
// for Additional Serial Ports" section
2233+
2234+
// NOTE: Use -1 for any pins that don't apply or aren't being used.
2235+
byte y700ModbusAddress = 0x70; // The modbus address of the Y700
2236+
const int8_t y700AdapterPower = sensorPowerPin; // RS485 adapter power pin
2237+
const int8_t y700SensorPower = A3; // Sensor power pin
2238+
const int8_t y700EnablePin = -1; // Adapter RE/DE pin
2239+
const uint8_t y700NumberReadings = 5;
2240+
// The manufacturer recommends averaging 10 readings, but we take 5 to minimize
2241+
// power consumption
2242+
2243+
// Create a Y700 pressure sensor object
2244+
YosemitechY700 y700(y700ModbusAddress, modbusSerial, y700AdapterPower,
2245+
y700SensorPower, y700EnablePin, y700NumberReadings);
2246+
2247+
// Create pressure and temperature variable pointers for the Y700
2248+
Variable* y700Pres =
2249+
new YosemitechY700_Pressure(&y700, "12345678-abcd-1234-ef00-1234567890ab");
2250+
Variable* y700Temp =
2251+
new YosemitechY700_Temp(&y700, "12345678-abcd-1234-ef00-1234567890ab");
2252+
/** End [yosemitech_y700] */
2253+
#endif
2254+
2255+
22242256
#if defined BUILD_SENSOR_YOSEMITECH_Y4000
22252257
// ==========================================================================
22262258
// Yosemitech Y4000 Multiparameter Sonde (DOmgL, Turbidity, Cond, pH, Temp,

sensor_tests/Yosemitech_test_Y700_Y4000_simple_logging/Yosemitech_test_Y700_Y4000_simple_logging.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ MaximDS3231 ds3231(1);
165165
// NOTE: Use -1 for any pins that don't apply or aren't being used.
166166
byte y700ModbusAddress = 0x01; // The modbus address of the Y700
167167
const int8_t y700AdapterPower = sensorPowerPin; // RS485 adapter power pin
168-
const int8_t y700SensorPower = A3; // Sensor power pin
168+
const int8_t y700SensorPower = modbusSensorPowerPin; // Sensor power pin
169169
const int8_t y700EnablePin = -1; // Adapter RE/DE pin
170170
const uint8_t y700NumberReadings = 5;
171171
// The manufacturer recommends averaging 10 readings, but we take 5 to minimize

src/sensors/YosemitechY700.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@
9999
#define Y700_PRES_VAR_NAME "pressureGauge"
100100
/// @brief Variable unit name in
101101
/// [ODM2 controlled vocabulary](http://vocabulary.odm2.org/units/);
102-
/// "millimeterofWater" (mm H2O)
103-
#define Y700_PRES_UNIT_NAME "millimeterofWater"
102+
/// "millimeterOfWater" (mmH2O)
103+
#define Y700_PRES_UNIT_NAME "millimeterOfWater"
104104
/// @brief Default variable short code; "Y700Pres"
105105
#define Y700_PRES_DEFAULT_CODE "Y700Pres"
106106
/**@}*/

0 commit comments

Comments
 (0)