Coder Social home page Coder Social logo

es-factory / es-timer Goto Github PK

View Code? Open in Web Editor NEW
47.0 2.0 2.0 21.19 MB

A USB timer powered by Digispark ATtiny85 according to πŸ… pomodoro time management technique

License: GNU General Public License v3.0

C++ 43.32% C 56.68%
c arduino usb cpp hid timer pcb work pomodoro student

es-timer's Introduction

⏲ ES Timer

ES Timer

A product from ES Factory, powered⚑ by Digispark ATtiny85 and it works based on πŸ… pomodoro time management technique a timer especially for those who deal with computers a lot, such as freelancers and have difficulty managing time.

Features of ES Timer in compare to existing softwares:

  • forcing to follow the breaks between tasks
  • it is simple and cheap to make around 10$
  • It is not dependent on the special OS and can works in the windows, linux and mac os without install anything

Contents

  1. How it works
  2. Requirements
  3. Assemble monitor version (Optional)
  4. Update from v1.x.x to v2.x.x
  5. Initialization Arduino IDE and Digispark ATtiny85
  6. Upload code
  7. Configurations
  8. Demos
  9. Donations
  10. License
  11. Acknowledgments

How it works

As mentioned, this timer works according to the Pomodoro technique, which you can refer to this link for more information about the technique. it works in such a way that when the user connects it to the port of a computer, it starts countdown according to the time specified by the user, and the user should to do his task during that time. when counter reach to zero, it using the HID protocol goes the computer to lock screen and it starts counting again for user rest. From this moment, it is not possible to use the computer by user and it cannot unlock the computer until the counting is over.

Note πŸ“: To let the timer know that you want to start the next Pomadoro, you have to keystroke the CapsLock key twice with a one second delay.

Requirements

  • Arduino IDE
  • Digispark ATtiny85
  • For monitor version (Optional)
    • Female and male pin header standard
    • LED
    • PCB prototype board
    • Soldering iron and wire
    • SSD1306 I2C OLED
    • Wire

Assemble monitor version

Step 1 Step 2 Step 3
Step 1 Step 2 Step 3
Step 4 Step 5 Step 6
Step 4 Step 5 Step 6
  1. Cut your PCB into square shape (10x10 holes) with cutter.
  2. Break female pin header into two pins 2 and 4 and put them on pcb like top photo then soldering them legs.
  3. The same work do on male pin header with the difference that, you have to break it into 3 and 6 pins, look to related picture.
  4. In this step putting digispark attiny85 on male pin headers and soldering their top legs related to 5V, GND, P0, P1, P2.
  5. According to the picture of the fifth step, do wiring and solder on the back of pcb.
  6. In the end, put OLED and LED on pin headers, in this moment your ES Timer is ready for next step.

Update from v1.x.x to v2.x.x

If you have used version 1.x.x ES Timer before, in order to update its, you must first delete the ES timer and EEPROM folders in the library folder of Arduino IDE which you can usually be found in the C:\Users\USER\Documents\Arduino\libraries path and update the bootloader of digispark attiny85 for this purpose, follow next step.

Initialization Arduino IDE and Digispark ATtiny85

In order to be able to upload codes into Digispark Attiny85, you first need to add it to ide. To do this, follow these steps:

Step 1

  1. In the Arduino IDE go to the "File" menu and select "Preferences"
  2. In the box labeled "Additional Boards Manager URLs" enter and click OK
    https://raw.githubusercontent.com/ArminJo/DigistumpArduino/master/package_digistump_index.json
    
  3. Go to the "Tools" menu and then the "Board" submenu - select "Boards Manager" and then type "Digistump AVR Boards" in filter box and click the "Install" button.
  4. You'll see the download progress on the bottom bar of the "Boards Manager" window, when complete it will show "Installed" next to that item on the list
  5. For Windows you must install the Digispark driver before you can program the board, download it here, open it and run InstallDrivers.exe (If you already have them installed, this installer will update them and install any that are missing)
  6. With the install complete, close the "Boards Manager" window and select the "Digispark" from the Tools β†’ Board β†’ Digistump AVR Boards menu
  7. Then select "16.5 MHz - For V-USB" from the Tools β†’ Clock menu
  8. After going through these steps, it is time to update the bootloader digispark attiny85, for which you only need to first click on the "Born Bootloader" option. After the message appears, connect the it to the usb port to start the update process.

Upload code

After opening the file "ESTimer.ino" in Arduino IDE In order to be able to upload the code on the device, you must add the zip file in the "lib" folder to IDE To do this, follow the path:

Arduino IDE Toolbar β†’ Sketch β†’ Include Library β†’ Add .ZIP Library...

Now to upload the code, 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 (will time out in 60 seconds) ... message. Connect the device to the computer. After a few seconds, the code will be uploaded.

Congratulations πŸŽ‰, your ES Timer is ready to use.

Note πŸ“: After clicking the upload option, you will see a few warning related to core code like the one below. Do not worry about this issue:

C:\Users\USER\Documents\Arduino\libraries\ESTimer\ESTimerC.c: In function 'usbFunctionSetup':
....

Configurations

Definition description
SYSTEM_OS To go to the Lock screen, you must specify your operating system type (WINDOWS or LINUX or MACOS).
INCLUDE_OLED Change it to true if you assemble monitor version.
ADDRESS_OLED Usually the ssd1306 address is this value, but if your ssd1306 value was different you can change it (use Digispark_Examples/i2cScanner to get it).
BRIGHTNESS_OLED In the range 0 to 1, where 1 is the maximum OLED brightness and 0 means it is completely off.
FLIP_CONTENT_OLED If you have connect your ES Timer to usb port of right side of computer should change it to true.
WORK_DURATION The duration of each work can be a maximum of 99 minutes, which you can use up to a second accuracy.
SHORT_BREAK_DURATION The duration of each short break can be a maximum of one-fifth work time, which you can use up to a second accuracy.
LONG_BREAK_RATE There should be take a long break after all four pomodoros, which is four times the short break by default.
SHORT_BREAK_COUNTER The method of counting short break for long break, STATIC according by done pomodoros, DYNAMIC after plugging timet to system.
PAUSABLE_WORK_PHASE If you want the work phase counter to pause when the timer is unplugged and resume it when again plugged, change it to true.

Demos

Video
Monitor version Only digispark

Donations

This is free, open-source peripheral. If you'd like to support the development of future projects, or say thanks for this one, you can donate:

BTC ETH
BTC qrcode ETH qrcode
bc1q0l8rn8y5rlka278ypq6u4dvapyue7d64uvhgct C3e0fF9534F54e91439AD877149903E7bFa50920

License

Copyright (C) 2021  ES factory

ES Timer is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

ES Timer is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see https://www.gnu.org/licenses/.

Acknowledgments

es-timer's People

Contributors

erfansn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

aospino jumbokh

es-timer's Issues

Starts in sleep mode, no sequence reset

I love this design and have made it according to your instructions. Thank you for posting them here. It's working for me but I have a couple of issues. Apologies for not being able to fix it myself - I'm a novice programmer and some of your code is beyond my abilities.

My issue is that on first use the timer puts my PC to sleep immediately. I have tried changing bits of the code but to no avail. Reuploading the code with different values doesn't take effect until the first round is complete as the timer remembers where it was in the sequence before the key is removed.

Changing awake and sleep times works, but again the timer picks up from where in the sequence it was previously and therefore the new values don't take effect immediately. Is there something I'm missing or is this how the code is expected to work?

Doc for keystroke values

I tried ES-Timer on a Linux based system. The flash seemed to work. The lights seem to match, but the keystroke did not lock. My issue might have to do with my udev rules.

Can you explain these values found in ./lib/ESTimer.zip ESTimer/ESTimer.h?

#if SYSTEM_OS == WINDOWS
#   define LOCK_SHORTCUT 0x08, 0x0F
#elif SYSTEM_OS == LINUX
#   define LOCK_SHORTCUT 0x01 | 0x04, 0x0F
#else
#   define LOCK_SHORTCUT 0x01 | 0x08, 0x14
#endif

I assume it correlates to these values:

  • 0x08 = Windows or super key
  • 0x0F = l
  • 0x01 = Control
  • 0x04 = Alt
  • 0x14 = q

I read hut1_3_0.pdf pages 88-94 and hid1_11.pdf pages 59 and 60, but I am still having trouble understanding the Super, Control, and Alt portion. What differentiates between 0x08 being a modifier and being the letter e?

Newbie Problem

Hi! I'm trying to build your OLED version.
The EEPROM part seems working: the PC go to standby mode after a minute (i set that so)
But the problem is the OLED that have no signs of working.

  • I added the .h files and putted "true" in the code
  • wiring and soldering is correct (the OLED work with other projects)
  • libraries added

Am i missing something?
Thank you and compliments for you awesome project!

FC from ITA

Lock instead of sleep?

Cool project!

I am interested in modifying ES-Timer to lock the machine instead of sending it to sleep as sleep breaks the WiFi connection and I work with remote servers frequently. I could just use tmux or screen after I remote in, but locking the screen would be simple. Locking instead of sleeping also has a security benefit of ensuring someone else cannot press the power button to access the machine while away on a break.

With DigiKeyboard.h, the method to send the CTRL+ALT+l keystroke would be like this:

DigiKeyboard.sendKeyStroke(KEY_L, MOD_ALT_LEFT | MOD_CONTROL_LEFT);

Can you help me understand which line of code is doing the sleep key? Is it this line in ESTimer.h within ESTimer.zip?

#define SLEEP           0x82

If that is correct, do you know how to send multiple keys to build a keystroke in this way without using DigiKeyboard.h?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.