Skip to content

Commit 58e8bb7

Browse files
committed
Added MeasureVoltageAndResistance measurement
1 parent 2634fee commit 58e8bb7

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

SBMInfo/SBMInfo.ino

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@
3232

3333
#define VERSION_EXAMPLE "4.0"
3434

35+
/*
36+
* This requires 4 resistors at Pins A0 to A3, see file MeasureVoltageAndResistance.cpp.h
37+
*/
38+
#define USE_VOLTAGE_AND_RESISTANCE_MEASUREMENT
39+
3540
/*
3641
* Activate the type of LCD you use
3742
*/
@@ -50,7 +55,7 @@
5055
#include <LiquidCrystal_I2C.h> // Use an up to date library version which has the init method
5156
#endif
5257
#if defined(USE_PARALELL_LCD)
53-
#include <LiquidCrystal.h>
58+
#include "LiquidCrystal.h"
5459
#endif
5560

5661
#if defined(USE_1602_LCD)
@@ -80,8 +85,10 @@ LiquidCrystal_I2C myLCD(0x27, LCD_COLUMNS, LCD_ROWS); // set the LCD address to
8085
LiquidCrystal myLCD(7, 8, 3, 4, 5, 6);
8186
#endif
8287

88+
#if defined(USE_VOLTAGE_AND_RESISTANCE_MEASUREMENT)
8389
// Include it after LCD settings, it requires the macros USE_LCD and USE_2004_LCD to be set
8490
#include "MeasureVoltageAndResistance.cpp.h"
91+
#endif
8592

8693
#define FORCE_LCD_DISPLAY_TIMING_PIN 3 // if pulled to ground, enables slow display timing as used for LiPo supply
8794

@@ -325,7 +332,9 @@ void setup() {
325332
Serial.flush();
326333
do {
327334
sI2CDeviceAddress = scanForAttachedI2CDevice();
335+
#if defined(USE_VOLTAGE_AND_RESISTANCE_MEASUREMENT)
328336
MeasureVoltageAndResistance();
337+
#endif
329338
delay(500);
330339
TogglePin(LED_BUILTIN);
331340
} while (sI2CDeviceAddress == SBM_INVALID_ADDRESS);

0 commit comments

Comments
 (0)