Compare commits

..

1 Commits

Author SHA1 Message Date
Frans van Bellen 4fb086a1c2
Update Bahn.ino
Dark mode enabled
2021-01-27 12:51:30 +01:00
9 changed files with 2869 additions and 858 deletions

3
.gitignore vendored
View File

@ -1,3 +0,0 @@
.vscode
fontconvert

97
Bahn.ino Normal file
View File

@ -0,0 +1,97 @@
#include <Watchy.h> //include the Watchy library
#include <DIN_1451_Engschrift_Regular64pt7b.h>
#include <DIN_1451_Engschrift_Regular12pt7b.h>
class WatchFace : public Watchy { //inherit and extend Watchy class
public:
void drawWatchFace() { //override this method to customize how the watch face looks
int16_t x1, y1, lasty;
uint16_t w, h;
String textstring;
bool light = false;
//drawbg
display.fillScreen(light ? GxEPD_WHITE : GxEPD_BLACK);
display.fillRoundRect(2,2,196,196,8,light ? GxEPD_BLACK : GxEPD_WHITE);
display.fillRoundRect(6,6,188,188,2,light ? GxEPD_WHITE : GxEPD_BLACK);
display.setFont(&DIN_1451_Engschrift_Regular64pt7b);
display.setTextColor(light ? GxEPD_BLACK : GxEPD_WHITE);
display.setTextWrap(false);
//draw hours
textstring = currentTime.Hour;
display.getTextBounds(textstring, 0, 0, &x1, &y1, &w, &h);
display.setCursor(184-w, 100-5);
display.print(textstring);
//draw minutes
if (currentTime.Minute < 10) {
textstring = "0";
} else {
textstring = "";
}
textstring += currentTime.Minute;
display.getTextBounds(textstring, 0, 0, &x1, &y1, &w, &h);
display.setCursor(183-w, 100+3+h);
display.print(textstring);
// draw battery
display.fillRoundRect(16,16,34,12,4,light ? GxEPD_BLACK : GxEPD_WHITE);
display.fillRoundRect(49,20,3,4,2,light ? GxEPD_BLACK : GxEPD_WHITE);
display.fillRoundRect(18,18,30,8,3,light ? GxEPD_WHITE : GxEPD_BLACK);
float batt = (getBatteryVoltage()-3.8)/0.40;
if (batt > 0) {
display.fillRoundRect(20,20,26*batt,4,2,light ? GxEPD_BLACK : GxEPD_WHITE);
}
display.setFont(&DIN_1451_Engschrift_Regular12pt7b);
lasty = 200 - 16;
//draw steps
textstring = sensor.getCounter();
textstring += " steps";
display.getTextBounds(textstring, 0, 0, &x1, &y1, &w, &h);
display.fillRoundRect(16,lasty-h-2,w + 7,h+4,2,light ? GxEPD_BLACK : GxEPD_WHITE);
display.setCursor(19, lasty-3);
display.setTextColor(light ? GxEPD_WHITE : GxEPD_BLACK);
display.print(textstring);
display.setTextColor(light ? GxEPD_BLACK : GxEPD_WHITE);
lasty += -8-h;
// draw year
textstring = currentTime.Year + 1970;
display.getTextBounds(textstring, 0, 0, &x1, &y1, &w, &h);
display.setCursor(16, lasty);
display.print(textstring);
lasty += -20;
// draw date
textstring = monthShortStr(currentTime.Month);
textstring += " ";
textstring += currentTime.Day;
display.getTextBounds(textstring, 0, 0, &x1, &y1, &w, &h);
display.setCursor(16, lasty);
display.print(textstring);
lasty += -20;
// draw day
textstring = dayStr(currentTime.Wday);
display.getTextBounds(textstring, 0, 0, &x1, &y1, &w, &h);
display.setCursor(16, lasty);
display.print(textstring);
}
};
WatchFace m; //instantiate your watchface
void setup() {
m.init(); //call init in setup
}
void loop() {
// this should never run, Watchy deep sleeps after init();
}

View File

@ -93,9 +93,8 @@ const uint8_t DIN_1451_Engschrift_Regular12pt7bBitmaps[] PROGMEM = {
0x18, 0x70, 0x60, 0xFF, 0xF0, 0xC6, 0x10, 0xC2, 0x18, 0xC3, 0xFF, 0xC0,
0x3B, 0xD8, 0xC6, 0x31, 0x8C, 0x67, 0x30, 0xC6, 0x31, 0x8C, 0x63, 0x1E,
0x70, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xE7, 0x8C, 0x63, 0x18, 0xC6, 0x30,
0xCE, 0x63, 0x18, 0xC6, 0x31, 0xBD, 0xC0,
0x6F, 0xFF, 0xFF, 0x6F, 0xF0 // º symbol, normally 0xBA, stored at 0x7e
};
0xCE, 0x63, 0x18, 0xC6, 0x31, 0xBD, 0xC0, 0x38, 0x2F, 0xCF, 0x1F, 0xA0,
0xE0 };
const GFXglyph DIN_1451_Engschrift_Regular12pt7bGlyphs[] PROGMEM = {
{ 0, 1, 1, 4, 0, 0 }, // 0x20 ' '
@ -192,25 +191,11 @@ const GFXglyph DIN_1451_Engschrift_Regular12pt7bGlyphs[] PROGMEM = {
{ 1104, 5, 20, 7, 0, -15 }, // 0x7B '{'
{ 1117, 2, 19, 5, 1, -15 }, // 0x7C '|'
{ 1122, 5, 20, 7, 1, -15 }, // 0x7D '}'
{ 1135, 4, 9, 6, 1, -15 } // 0x7E '~' replaced by 'º'
};
// Approx. 1818 bytes
{ 1135, 11, 4, 16, 2, -9 } }; // 0x7E '~'
const GFXfont DIN_1451_Engschrift_Regular12pt7b PROGMEM = {
(uint8_t *)DIN_1451_Engschrift_Regular12pt7bBitmaps,
(GFXglyph *)DIN_1451_Engschrift_Regular12pt7bGlyphs,
0x20, 0xBA, 27 };
0x20, 0x7E, 27 };
// 'feet', 32x32px
// Generated using https://javl.github.io/image2cpp/
const unsigned char png_feet [] PROGMEM = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x01, 0xb7, 0x00, 0x00,
0x06, 0x87, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0xfc, 0x00, 0x00, 0x1b, 0xfc, 0x60, 0x00,
0x07, 0xfc, 0x70, 0x00, 0x07, 0xfc, 0x76, 0x00, 0x0f, 0xfc, 0x75, 0x80, 0x0f, 0xf8, 0x01, 0x00,
0x0f, 0xf0, 0x00, 0xc0, 0x0f, 0xe0, 0x78, 0xc0, 0x07, 0xe0, 0xfe, 0x30, 0x07, 0xe0, 0xff, 0x30,
0x07, 0xe0, 0xff, 0x80, 0x03, 0xe0, 0x7f, 0x80, 0x03, 0xf0, 0x3f, 0xc0, 0x03, 0xf8, 0x3f, 0xc0,
0x03, 0xfc, 0x3f, 0x80, 0x01, 0xfc, 0x3f, 0x80, 0x01, 0xfc, 0x3f, 0x00, 0x01, 0xf8, 0x7f, 0x00,
0x00, 0xf0, 0xfe, 0x00, 0x00, 0x01, 0xfc, 0x00, 0x00, 0x03, 0xf8, 0x00, 0x00, 0x07, 0xf8, 0x00,
0x00, 0x07, 0xf0, 0x00, 0x00, 0x07, 0xf0, 0x00, 0x00, 0x03, 0xe0, 0x00, 0x00, 0x01, 0xc0, 0x00
};
// Approx. 1813 bytes

File diff suppressed because it is too large Load Diff

21
LICENSE
View File

@ -1,21 +0,0 @@
MIT License
Copyright (c) 2021 Frans van Bellen
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -1,212 +0,0 @@
#include <Watchy.h> //include the Watchy library
#include "settings.h" // stupid static constants
#include "DIN_1451_Engschrift_Regular64pt7b.h"
#include "DIN_1451_Engschrift_Regular12pt7b.h"
#include "heavitas12pt7b.h"
// RTC_DATA_ATTR weatherData currentWeather;
class WatchFace : public Watchy { //inherit and extend Watchy class
using Watchy::Watchy;
public:
//! Change these if you want light background, dark text
uint16_t bg = GxEPD_BLACK;
uint16_t fg = GxEPD_WHITE;
void drawWatchFace() { //override this method to customize how the watch face looks
int16_t x1;
int16_t y1;
uint16_t w;
uint16_t h;
String textstring;
int16_t lasty;
// Flood fill with background
// display.fillScreen(bg);
// display.fillRoundRect(2,2,196,196,8,bg);
// display.fillRoundRect(6,6,188,188,5,fg);
display.setFont(&DIN_1451_Engschrift_Regular64pt7b);
display.setTextColor(fg);
display.setTextWrap(false);
drawTime( 183, 92 );
drawBattery( 8, 4 );
display.setFont(&DIN_1451_Engschrift_Regular12pt7b);
display.setTextColor(fg);
drawSteps( 8, 20 );
drawDate( 8, 140 );
display.setFont(&DIN_1451_Engschrift_Regular12pt7b);
display.setTextColor(fg);
display.setTextColor(fg);
lasty = 120;
// weather things
weatherData currentWeather = getWeatherData(settings.cityID, settings.weatherUnit,
settings.weatherLang, settings.weatherURL,
settings.weatherAPIKey, settings.weatherUpdateInterval);
textstring = "";
textstring += currentWeather.weatherDescription;
display.getTextBounds(textstring, 0, 0, &x1, &y1, &w, &h);
display.setCursor(16, lasty);
display.print(textstring);
lasty += -20;
// draw temperature
textstring = currentWeather.temperature;
if( currentWeather.isMetric ) {
textstring += "~ C"; // ~ will be rendered as º
} else {
textstring += "~ F"; // ~ will be rendered as º
}
display.getTextBounds(textstring, 0, 0, &x1, &y1, &w, &h);
display.setCursor(16, lasty);
display.print(textstring);
}
private:
// Draw step counter and footrpints icon
// x and y are the top corner
void drawSteps(uint8_t x, uint8_t y) {
int16_t x1;
int16_t y1;
uint16_t w;
uint16_t h;
String textstring;
//reset step counter at midnight
if(currentTime.Hour == 00 && currentTime.Minute == 00) {
sensor.resetStepCounter();
}
// Put the feet icon down
display.drawBitmap(x, y, png_feet, 32, 32, fg);
textstring = "000000"; // prototype 6-digit number
display.getTextBounds(textstring, 0, 0, &x1, &y1, &w, &h);
// Now we know how wide a 6-digit number would be. We want to right-justify
// our number. So figure out how wide 6 digits are, and subtract how wide
// our current number is.
x = w; //hang on to width
textstring = String(sensor.getCounter());
display.getTextBounds(textstring, 0, 0, &x1, &y1, &w, &h);
display.setCursor( x + 42 - w, y + 32 ); // add 32 because of icon, right justify
display.print(textstring);
}
//! Draw the battery symbol with its x and y coordinates starting at x,y
#define BATTWIDTH 26
void drawBattery( uint8_t x, uint8_t y ) {
float batt;
// draw battery
display.fillRoundRect( x, y, 34, 12, 4, fg ); // overall frame
display.fillRoundRect( x+34, y+2, 4, 8, 2, fg ); // nub, to look like battery
display.fillRoundRect( x+2, y+2, 30, 8, 3, bg ); // area for battery charge
// According to 7_SEG, 3.8 is the voltage floor. Below that is rendered as
// flat battery on that watch face.
batt = (getBatteryVoltage()-3.3)/0.9;
if (batt > 0) {
display.fillRoundRect( x+4, y+4, (BATTWIDTH*batt), 4, 2, fg ); // actual charge
}
}
void drawTemperature() {
}
//! Draw time on the right side of the face.
/**
* Note that x is the RIGHT margin, not the left. The
* numbers are right justified. The y is the top of the
* numbers.
**/
void drawTime( uint8_t x, uint8_t y ) {
int16_t x1;
int16_t y1;
uint16_t w;
uint16_t h;
String textstring;
// draw hours with leading 0
if( currentTime.Hour < 10 ) {
textstring = "0";
} else {
textstring = "";
}
textstring += currentTime.Hour;
display.getTextBounds(textstring, 0, 0, &x1, &y1, &w, &h);
display.setCursor( x-w, y );
display.print(textstring);
y = y + h + 8;
if( currentTime.Minute < 10 )
{
textstring = "0";
} else {
textstring = "";
}
textstring += currentTime.Minute;
display.setTextColor(fg);
display.getTextBounds(textstring, 0, 0, &x1, &y1, &w, &h);
display.setCursor( x-w, y );
display.print(textstring);
}
#define BOXX (70)
#define BOXY (50)
void drawDate( uint8_t x, uint8_t y ) {
int16_t x1;
int16_t y1;
uint16_t w;
uint16_t h;
uint8_t width;
uint8_t newx;
uint8_t newy;
String textstring;
// draw box
display.fillRoundRect( x, y, BOXX, BOXY, 2, fg ); // overall frame
// draw short day name inverted
display.setFont(&Heavitas12pt7b);
display.setTextColor(bg);
textstring = currentTime.Day;
display.getTextBounds(textstring, 0, 0, &x1, &y1, &w, &h);
h = h/2; // this font seems really tall.
// center text in box
newx = x + ((BOXX-w) / 2 );
display.setCursor( newx, y + 20 );
display.print(textstring);
// draw day
textstring = dayShortStr(currentTime.Wday);
textstring.toUpperCase();
display.setFont(&Heavitas12pt7b);
display.setTextColor(bg);
display.getTextBounds(textstring, 0, 0, &x1, &y1, &w, &h);
h = h/2; // this font seems really tall.
// Start at bottom of box, go up height, plus a small margin
newy = y + BOXY - h; // Near bottom of box
newx = x + ((BOXX-w) / 2 );
display.setCursor( newx, newy );
display.print(textstring);
}
};
WatchFace w(settings); //instantiate your watchface
void setup() {
// Weather settings are in settings.h now
w.init(); //call init in setup
}
void loop() {
// this should never run, Watchy deep sleeps after init();
}

View File

@ -1,19 +1,3 @@
# Bahn for Watchy
# Bahn-for-Watchy
My very first watchface for Watchy. Forked from [Bahn for Watchy](https://github.com/BraininaBowl/Bahn-for-Watchy) by [braininabowl](https://github.com/BraininaBowl). His original design inspired by [Din Time for Pebble](https://christianliljeberg.se/din-time/) by [Christian Liljeberg](https://christianliljeberg.se/).
## Additions
- Foot icon by step counter
- Reading ambient temperature from RTC if internet is not available.
- Added degree symbol (º) to font
- Added leading zero to single-digit hours
## Useful Links
- [Online font converter](https://oleddisplay.squix.ch/#/home) Choose a font, size, and make sure to have it create **AdaFruit GFX Font**
- [LCD Image Converter](https://github.com/riuson/lcd-image-converter) and [rop.nl](https://rop.nl/truetype2gfx/)
- [DIN 1451 Engschrift](http://www.peter-wiegel.de/Din1451-H.html) font
## URL for openweathermap
- [API call](http://api.openweathermap.org/data/2.5/weather?id=4751935&units=imperial&appid=ca4849c5f0c3949bda419307e34a669e)
My very first watchface for Watchy. Design inspired by Din Time for Pebble by Christian Liljeberg.

View File

@ -1,172 +0,0 @@
const uint8_t Heavitas12pt7bBitmaps[] PROGMEM = {
0x07, 0xE0, 0x1F, 0xF8, 0x3F, 0xFC, 0x7F, 0xFC, 0x7F, 0xFE, 0x7E, 0x3E,
0xFC, 0x3F, 0xF8, 0x1F, 0xF8, 0x1F, 0xF8, 0x1F, 0xF8, 0x1F, 0xFC, 0x3F,
0x7E, 0x7E, 0x7F, 0xFE, 0x3F, 0xFC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, // 0x31 '1'
{ 59, 13, 18, 16, 1, -17 }, // 0x32 '2'
{ 89, 13, 18, 14, 0, -17 }, // 0x33 '3'
{ 119, 15, 18, 16, 0, -17 }, // 0x34 '4'
{ 153, 14, 18, 15, 0, -17 }, // 0x35 '5'
{ 185, 13, 18, 15, 1, -17 }, // 0x36 '6'
{ 215, 13, 18, 14, 0, -17 }, // 0x37 '7'
{ 245, 14, 18, 15, 0, -17 }, // 0x38 '8'
{ 277, 14, 18, 16, 1, -17 }, // 0x39 '9'
{ 309, 5, 11, 6, 0, -10 }, // 0x3A ':'
{ 316, 5, 14, 6, 0, -10 }, // 0x3B ';'
{ 325, 11, 14, 13, 1, -15 }, // 0x3C '<'
{ 345, 11, 11, 13, 1, -13 }, // 0x3D '='
{ 361, 11, 14, 13, 1, -15 }, // 0x3E '>'
{ 381, 14, 18, 14, -1, -17 }, // 0x3F '?'
{ 413, 16, 18, 19, 2, -17 }, // 0x40 '@'
{ 449, 20, 18, 19, -1, -17 }, // 0x41 'A'
{ 494, 15, 18, 17, 1, -17 }, // 0x42 'B'
{ 528, 18, 18, 19, 0, -17 }, // 0x43 'C'
{ 569, 16, 18, 19, 1, -17 }, // 0x44 'D'
{ 605, 14, 18, 16, 1, -17 }, // 0x45 'E'
{ 637, 14, 18, 16, 1, -17 }, // 0x46 'F'
{ 669, 20, 18, 20, 0, -17 }, // 0x47 'G'
{ 714, 16, 18, 19, 1, -17 }, // 0x48 'H'
{ 750, 5, 18, 8, 1, -17 }, // 0x49 'I'
{ 762, 13, 18, 15, 0, -17 }, // 0x4A 'J'
{ 792, 16, 18, 18, 1, -17 }, // 0x4B 'K'
{ 828, 13, 18, 15, 1, -17 }, // 0x4C 'L'
{ 858, 20, 18, 24, 1, -17 }, // 0x4D 'M'
{ 903, 17, 18, 20, 1, -17 }, // 0x4E 'N'
{ 942, 18, 18, 20, 1, -17 }, // 0x4F 'O'
{ 983, 15, 18, 17, 1, -17 }, // 0x50 'P'
{ 1017, 19, 18, 20, 0, -17 }, // 0x51 'Q'
{ 1060, 16, 18, 18, 1, -17 }, // 0x52 'R'
{ 1096, 14, 18, 16, 1, -17 }, // 0x53 'S'
{ 1128, 15, 18, 15, 0, -17 }, // 0x54 'T'
{ 1162, 16, 18, 19, 1, -17 }, // 0x55 'U'
{ 1198, 19, 18, 20, 0, -17 }, // 0x56 'V'
{ 1241, 27, 18, 27, 0, -17 }, // 0x57 'W'
{ 1302, 19, 18, 18, -1, -17 }, // 0x58 'X'
{ 1345, 18, 18, 17, 0, -17 }, // 0x59 'Y'
{ 1386, 15, 18, 17, 1, -17 } }; // 0x5A 'Z'
const GFXfont Heavitas12pt7b PROGMEM = {
(uint8_t *)Heavitas12pt7bBitmaps,
(GFXglyph *)Heavitas12pt7bGlyphs,
0x30, 0x5A, 24 };
// Approx. 1728 bytes

View File

@ -1,28 +0,0 @@
#ifndef SETTINGS_H
#define SETTINGS_H
//Weather Settings
#define CITY_ID "4751935" // Chantilly, VA https://openweathermap.org/current#cityid
#define OPENWEATHERMAP_APIKEY "ca4849c5f0c3949bda419307e34a669e" //use your own API key :)
#define OPENWEATHERMAP_URL "http://api.openweathermap.org/data/2.5/weather?id=" //open weather api
#define TEMP_UNIT "imperial" //metric = Celsius , imperial = Fahrenheit
#define TEMP_LANG "en"
#define WEATHER_UPDATE_INTERVAL 30 //must be greater than 5, measured in minutes
//NTP Settings
#define NTP_SERVER "0.us.pool.ntp.org"
#define GMT_OFFSET_SEC 3600 * -5 //New York is UTC -5
#define DST_OFFSET_SEC 3600
watchySettings settings{
CITY_ID,
OPENWEATHERMAP_APIKEY,
OPENWEATHERMAP_URL,
TEMP_UNIT,
TEMP_LANG,
WEATHER_UPDATE_INTERVAL,
NTP_SERVER,
GMT_OFFSET_SEC,
DST_OFFSET_SEC
};
#endif