HT stopfen modifies. Some improvements in the firmare.

This commit is contained in:
klaute 2018-08-05 09:50:46 +02:00
parent 3c2eb795ff
commit 7be4fe23ab
4 changed files with 32 additions and 28 deletions

View file

@ -1,2 +1,3 @@
https://arduinodiy.wordpress.com/2017/01/02/reviewing-the-wemos-battery-shield/ https://arduinodiy.wordpress.com/2017/01/02/reviewing-the-wemos-battery-shield/
https://arduinodiy.wordpress.com/2016/12/25/monitoring-lipo-battery-voltage-with-wemos-d1-minibattery-shield-and-thingspeak/ https://arduinodiy.wordpress.com/2016/12/25/monitoring-lipo-battery-voltage-with-wemos-d1-minibattery-shield-and-thingspeak/
https://www.thingiverse.com/thing:3015533

View file

@ -1,6 +1,7 @@
#define DEBUG 1 //#define DEBUG 1
#define BATTERY_POWERED 1
#define POWERSAVING 1 #define POWERSAVING 1
#define SENSOR_TEMPERATURE 0 #define SENSOR_TEMPERATURE 0

View file

@ -62,6 +62,8 @@ void setup() {
digitalWrite(STATUS_LED_PIN, HIGH); digitalWrite(STATUS_LED_PIN, HIGH);
lowBatCheck(getBatteryVoltage());
// Establish WiFi connection // Establish WiFi connection
String wifiName = "oko-weather-" + String(ESP.getChipId()); String wifiName = "oko-weather-" + String(ESP.getChipId());
@ -111,7 +113,7 @@ void setup() {
digitalWrite(STATUS_LED_PIN, LOW); digitalWrite(STATUS_LED_PIN, LOW);
lowBatCheck(); lowBatCheck(currentSensorData[SENSOR_BAT_VOLTAGE]);
WiFi.mode(WIFI_OFF); WiFi.mode(WIFI_OFF);
WiFi.forceSleepBegin(); WiFi.forceSleepBegin();
@ -126,9 +128,9 @@ void setup() {
//*************************************************************************// //*************************************************************************//
void lowBatCheck() void lowBatCheck(float v)
{ {
if (currentSensorData[SENSOR_BAT_VOLTAGE] <= BAT_LOW_VOLTAGE) if (v <= BAT_LOW_VOLTAGE)
{ {
#ifdef DEBUG #ifdef DEBUG
Serial.println("Low battery, going into deep sleep."); Serial.println("Low battery, going into deep sleep.");
@ -140,8 +142,6 @@ void lowBatCheck()
void loop() { void loop() {
lowBatCheck();
#ifdef POWERSAVING #ifdef POWERSAVING
delay(50); delay(50);
return; return;

View file

@ -1,22 +1,24 @@
radius=25;
union() { height=30;
difference() {
cylinder(h=30, r=25, $fn=300); union() {
translate([0, 0, -5]) difference() {
cylinder(h=40, r=23, $fn=300); cylinder(h=height, r=radius, $fn=300);
} translate([0, 0, -5])
difference() { cylinder(h=height+10, r=radius-2, $fn=300);
union() { }
translate([0, 0, 30]) difference() {
cylinder(h=3, r=30, $fn=300); union() {
color("green") translate([0, 0, height])
translate([-22, -12, 31]) cylinder(h=3, r=radius+5, $fn=300);
cube([44, 24, 5]); color("green")
} translate([-22, -12, 31])
color("red") cube([44, 24, 5]);
translate([-20, -10, 25]) }
cube([40, 20, 15]); color("red")
} translate([-20, -10, 25])
} cube([40, 20, 15]);
}
}