HT stopfen modifies. Some improvements in the firmare.
This commit is contained in:
parent
3c2eb795ff
commit
7be4fe23ab
4 changed files with 32 additions and 28 deletions
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -1,15 +1,17 @@
|
||||||
|
|
||||||
|
radius=25;
|
||||||
|
height=30;
|
||||||
|
|
||||||
union() {
|
union() {
|
||||||
difference() {
|
difference() {
|
||||||
cylinder(h=30, r=25, $fn=300);
|
cylinder(h=height, r=radius, $fn=300);
|
||||||
translate([0, 0, -5])
|
translate([0, 0, -5])
|
||||||
cylinder(h=40, r=23, $fn=300);
|
cylinder(h=height+10, r=radius-2, $fn=300);
|
||||||
}
|
}
|
||||||
difference() {
|
difference() {
|
||||||
union() {
|
union() {
|
||||||
translate([0, 0, 30])
|
translate([0, 0, height])
|
||||||
cylinder(h=3, r=30, $fn=300);
|
cylinder(h=3, r=radius+5, $fn=300);
|
||||||
color("green")
|
color("green")
|
||||||
translate([-22, -12, 31])
|
translate([-22, -12, 31])
|
||||||
cube([44, 24, 5]);
|
cube([44, 24, 5]);
|
||||||
|
|
Loading…
Reference in a new issue