Skip to content

Commit

Permalink
Release v1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
erfansn committed Oct 23, 2021
1 parent b2a768b commit 7f51bbc
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 30 deletions.
20 changes: 13 additions & 7 deletions ESTimer.ino
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
#define INCLUDE_OLED 0
#define INCLUDE_OLED false // Change it to true if you assemble monitor version
#define BRIGHTNESS_OLED 0.5 // In Range of 0 to 1
#define FLIP_VERTICAL_CONTENT false // If you have connect your ES Timer to right side of computer must change it to true

#include <ESTimer.h>
#if INCLUDE_OLED
#include "Fonts.h"
#include "Images.h"
#endif

#define seconds(n) (n)
Expand Down Expand Up @@ -50,6 +53,9 @@ void initTimer() {
EEPROM.get(8, countDonePomodoros);

#if INCLUDE_OLED
#if FLIP_VERTICAL_CONTENT
ESTimer.flipVerticalContent();
#endif
splash();

initNumbers();
Expand Down Expand Up @@ -126,6 +132,12 @@ void startCountdownTimer(bool isAwake) {
}

#if INCLUDE_OLED
void splash() {
ESTimer.drawBitmap(46, 0, 82, 8, es_logo);
ESTimer.delay(3000);
ESTimer.clear();
}

void drawNumbers(uint8_t m0, uint8_t m1, uint8_t s0, uint8_t s1) {
ESTimer.drawBitmap(65, 1, 100, 4, numbers[m0]);
ESTimer.drawBitmap(65, 4, 100, 7, numbers[m1]);
Expand All @@ -138,12 +150,6 @@ void initNumbers() {
drawNumbers(t, t, t, t);
}

void splash() {
ESTimer.drawBitmap(46, 0, 82, 8, es_logo);
ESTimer.delay(3000);
ESTimer.clear();
}

void initStatusPomodoros() {
for (uint8_t i = 0; i < 16; i += 2) {
if (i < 8) {
Expand Down
21 changes: 0 additions & 21 deletions Fonts.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,6 @@

// bitmap to code -> https://javl.github.io/image2cpp/

const unsigned char es_logo[] PROGMEM = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0xc0, 0xe0, 0xe0, 0xf0, 0xf0, 0xf0, 0xf8,
0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf0, 0xf0, 0xf0, 0xe0, 0xe0, 0xc0, 0xc0, 0x80, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xf8, 0xfe, 0xff, 0xff, 0xff, 0x3f, 0x0f, 0x0f,
0x07, 0x03, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x03, 0x07, 0x0f, 0x0f, 0x3f, 0xff,
0xff, 0xff, 0xfe, 0xf8, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff,
0xff, 0xff, 0x7f, 0x3f, 0x00, 0x80, 0xc0, 0x00, 0x00, 0x00, 0x00, 0xe7, 0xe7, 0xe7, 0xe7, 0xe7,
0xe7, 0xe0, 0xc0, 0xc0, 0x80, 0x80, 0x00, 0x00, 0x3f, 0x7f, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x00, 0x0f, 0x87, 0xe1, 0xf0, 0xfc, 0xfe, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0f, 0x1f, 0x1f, 0x3f, 0xff, 0xff, 0xfe, 0xfc, 0xf0, 0xe1,
0x87, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x01, 0x07, 0x1f, 0x3f, 0x7f, 0xff,
0xff, 0xfc, 0xf0, 0xe0, 0xe0, 0xc0, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00,
0x00, 0xf0, 0xfc, 0xff, 0xff, 0xff, 0x7f, 0x1f, 0x07, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x07, 0x07, 0x0f, 0x0f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f,
0x1f, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x07, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};

const uint8_t numbers[10][105] PROGMEM = {
{
// 0
Expand Down
24 changes: 24 additions & 0 deletions Images.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#include <avr/pgmspace.h>

// bitmap to code -> https://javl.github.io/image2cpp/

const unsigned char es_logo[] PROGMEM = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0xc0, 0xe0, 0xe0, 0xf0, 0xf0, 0xf0, 0xf8,
0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf0, 0xf0, 0xf0, 0xe0, 0xe0, 0xc0, 0xc0, 0x80, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xf8, 0xfe, 0xff, 0xff, 0xff, 0x3f, 0x0f, 0x0f,
0x07, 0x03, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x03, 0x07, 0x0f, 0x0f, 0x3f, 0xff,
0xff, 0xff, 0xfe, 0xf8, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff,
0xff, 0xff, 0x7f, 0x3f, 0x00, 0x80, 0xc0, 0x00, 0x00, 0x00, 0x00, 0xe7, 0xe7, 0xe7, 0xe7, 0xe7,
0xe7, 0xe0, 0xc0, 0xc0, 0x80, 0x80, 0x00, 0x00, 0x3f, 0x7f, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
0x00, 0x00, 0x0f, 0x87, 0xe1, 0xf0, 0xfc, 0xfe, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0f, 0x1f, 0x1f, 0x3f, 0xff, 0xff, 0xfe, 0xfc, 0xf0, 0xe1,
0x87, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x01, 0x07, 0x1f, 0x3f, 0x7f, 0xff,
0xff, 0xfc, 0xf0, 0xe0, 0xe0, 0xc0, 0xc0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00,
0x00, 0xf0, 0xfc, 0xff, 0xff, 0xff, 0x7f, 0x1f, 0x07, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x07, 0x07, 0x0f, 0x0f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f,
0x1f, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x07, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ After opening the file `EsTimer.ino` in `Arduino IDE` In order to be able to up

`Arduino IDE Toolbar -> Sketch -> Include Library -> Add .ZIP Library...`

If you have assembled the monitor version, you need to change the value of `INCLUDE_OLED` to `1`. Now to upload the code in `ES Timer` click on the arrow button or use shortcut `Ctrl + U`. Wait for the code to be compiled. After you see the `Please plug in the device ...` message. Connect the device to the computer. After a maximum of 5 seconds, the code will be uploaded. Congratulations 🎉, your ES Timer is ready to use.
If you have assembled the monitor version, you need to change the value of `INCLUDE_OLED` to `true`. Now to upload the code in `ES Timer` click on the arrow button or use shortcut `Ctrl + U`. Wait for the code to be compiled. After you see the `Please plug in the device ...` message. Connect the device to the computer. After a maximum of 5 seconds, the code will be uploaded. Congratulations 🎉, your ES Timer is ready to use.

## Configurations
You can customize the awake and sleep system. All you have to do is change the definition values of `AWAKE_TIME` and `SLEEP_TIME`.
You can customize the awake and sleep system. All you have to do is change the definition values of `AWAKE_TIME` and `SLEEP_TIME` also, if you want you can change the brightness OLED by changing `BRIGHTNESS_OLED` defines in range of `0..1` and if you have connected your ES Timer to right side of computer must change `FLIP_VERTICAL_CONTENT` to `true`

**Note 📝**: According to the code, the maximum definition time for `AWAKE_TIME` is 99 minutes and for `SLEEP_TIME` is a quarter `AWAKE_TIME`.

Expand Down
Binary file modified lib/ESTimer.zip
Binary file not shown.

0 comments on commit 7f51bbc

Please sign in to comment.