Merge branch 'master' of github.com:openenergymonitor/emonth2
This commit is contained in:
commit
14b070732f
|
|
@ -101,6 +101,8 @@ const byte DIP_switch2= 8;
|
||||||
const byte pulse_countINT= 1; // INT 1 / Dig 3 Screw Terminal Block Number 4 on emonTH V1.5 - Change to INT0 DIG2 on emonTH V1.4
|
const byte pulse_countINT= 1; // INT 1 / Dig 3 Screw Terminal Block Number 4 on emonTH V1.5 - Change to INT0 DIG2 on emonTH V1.4
|
||||||
const byte pulse_count_pin=3; // INT 1 / Dig 3 Screw Terminal Block Number 4 on emonTH V1.5 - Change to INT0 DIG2 on emonTH V1.4
|
const byte pulse_count_pin=3; // INT 1 / Dig 3 Screw Terminal Block Number 4 on emonTH V1.5 - Change to INT0 DIG2 on emonTH V1.4
|
||||||
#define ONE_WIRE_BUS 17 // D19 emonTH V1.5
|
#define ONE_WIRE_BUS 17 // D19 emonTH V1.5
|
||||||
|
cost byte DHT22_PWR= 6; // Not used in emonTH V2.0, 10K resistor R1 connects DHT22 pins
|
||||||
|
cost byte DHT22_DATA= 16; // Not used in emonTH V2.0, 10K resistor R1 connects DHT22 pins.
|
||||||
|
|
||||||
OneWire oneWire(ONE_WIRE_BUS);
|
OneWire oneWire(ONE_WIRE_BUS);
|
||||||
DallasTemperature sensors(&oneWire);
|
DallasTemperature sensors(&oneWire);
|
||||||
|
|
@ -134,7 +136,17 @@ void setup() {
|
||||||
//################################################################################################################################
|
//################################################################################################################################
|
||||||
|
|
||||||
pinMode(LED,OUTPUT); digitalWrite(LED,HIGH); // Status LED on
|
pinMode(LED,OUTPUT); digitalWrite(LED,HIGH); // Status LED on
|
||||||
|
|
||||||
|
// Unused pins configure as input pull up for low power
|
||||||
|
// http://electronics.stackexchange.com/questions/43460/how-should-unused-i-o-pins-be-configured-on-atmega328p-for-lowest-power-consumpt
|
||||||
|
// port map: https://github.com/openenergymonitor/emonth2/blob/master/hardware/readme.md
|
||||||
|
pinMode(DHT22_PWR, INPUT_PULLUP); //DHT22 not used on emonTH V2.
|
||||||
|
pinMode(DHT22_DATA, INPUT_PULLUP); //DHT22 not used on emonTH V2
|
||||||
|
pinMode(14, INPUT_PULLUP);
|
||||||
|
pinMode(20, INPUT_PULLUP);
|
||||||
|
pinMode(21, INPUT_PULLUP);
|
||||||
|
pinMode(4, INPUT_PULLUP);
|
||||||
|
|
||||||
//READ DIP SWITCH POSITIONS - LOW when switched on (default off - pulled up high)
|
//READ DIP SWITCH POSITIONS - LOW when switched on (default off - pulled up high)
|
||||||
pinMode(DIP_switch1, INPUT_PULLUP);
|
pinMode(DIP_switch1, INPUT_PULLUP);
|
||||||
pinMode(DIP_switch2, INPUT_PULLUP);
|
pinMode(DIP_switch2, INPUT_PULLUP);
|
||||||
|
|
@ -276,7 +288,7 @@ void loop()
|
||||||
pulseCount = 0;
|
pulseCount = 0;
|
||||||
sei();
|
sei();
|
||||||
|
|
||||||
/*
|
|
||||||
if (DS18B20==1)
|
if (DS18B20==1)
|
||||||
{
|
{
|
||||||
digitalWrite(DS18B20_PWR, HIGH); dodelay(50);
|
digitalWrite(DS18B20_PWR, HIGH); dodelay(50);
|
||||||
|
|
@ -291,7 +303,6 @@ void loop()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
*/
|
|
||||||
emonth.battery=int(analogRead(BATT_ADC)*0.0322); //read battery voltage, convert ADC to volts x10
|
emonth.battery=int(analogRead(BATT_ADC)*0.0322); //read battery voltage, convert ADC to volts x10
|
||||||
|
|
||||||
//Enhanced battery monitoring mode. In this mode battery values
|
//Enhanced battery monitoring mode. In this mode battery values
|
||||||
Loading…
Reference in New Issue