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/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 SENSOR_TEMPERATURE 0

View File

@ -62,6 +62,8 @@ void setup() {
digitalWrite(STATUS_LED_PIN, HIGH);
lowBatCheck(getBatteryVoltage());
// Establish WiFi connection
String wifiName = "oko-weather-" + String(ESP.getChipId());
@ -111,7 +113,7 @@ void setup() {
digitalWrite(STATUS_LED_PIN, LOW);
lowBatCheck();
lowBatCheck(currentSensorData[SENSOR_BAT_VOLTAGE]);
WiFi.mode(WIFI_OFF);
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
Serial.println("Low battery, going into deep sleep.");
@ -140,8 +142,6 @@ void lowBatCheck()
void loop() {
lowBatCheck();
#ifdef POWERSAVING
delay(50);
return;

View File

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