wfdudley / T-watch-2020

a watch project for the TTGO T-watch-2020 version 1
BSD 3-Clause "New" or "Revised" License
85 stars 27 forks source link

Added Sound option to appStopWatch #28

Closed Fra4prg closed 3 years ago

Fra4prg commented 3 years ago

I made some additions to the stop watch and I would appreciate if you could merge this into your project. All changes are marked with the comment // Fra4prg:

Description of my changes: Added "Smart Sound" option. "Smart Sound" enables you to hear the number of minutes without having to look on the display. The idea behind this is that human brain can identify the number of 3 beeps as triple without counting them even if they are very short and fast. So up to 3 beeps are played slowly and preceeding triples are faster. For every 10 minutes a sweep sound is preceeding. A new top left button switches modes between [no sound] - [vibration + sound] - [only sound]

Some examples to show the sequence: Minute 1: C5 Minute 2: C5-E5 Minute 3: C5-E5-G5 Minute 4: triple - C5 Minute 5: triple - C5-E5 ... Minute 9: triple - triple - C5-E5-G5 Minute 10: sweep ... Minute 18: sweep - triple - triple - C5-E5 and so on...

As you can see this works well for short times up to 10 minutes then it gets weird... The idea came up when I was flying model helicopters where I had to control the flight time due to small batteries and must not loose visual contact to my heli model. So I made a small Arduino based timer called HeliTimer. But this function fits perfect to the T-watch :-)

Regards Frank

wfdudley commented 3 years ago

Looks like a well written mod.

wfdudley commented 3 years ago

you forgot to upload mp3files.h

I "fixed" it but am not sure if I got the order of the sounds right.

Bill Dudley

This email is free of malware because I run Linux.

On Sat, Jan 9, 2021 at 9:01 AM Fra4prg notifications@github.com wrote:

I made some additions to the stop watch and I would appreciate if you could merge this into your project. All changes are marked with the comment // Fra4prg:

Description of my changes: Added "Smart Sound" option. "Smart Sound" enables you to hear the number of minutes without having to look on the display. The idea behind this is that human brain can identify the number of 3 beeps as triple without counting them even if they are very short and fast. So up to 3 beeps are played slowly and preceeding triples are faster. For every 10 minutes a sweep sound is preceeding. A new top left button switches modes between [no sound] - [vibration + sound] - [only sound]

Some examples to show the sequence: Minute 1: C5 Minute 2: C5-E5 Minute 3: C5-E5-G5 Minute 4: triple - C5 Minute 5: triple - C5-E5 ... Minute 9: triple - triple - C5-E5-G5 Minute 10: sweep ... Minute 18: sweep - triple - triple - C5-E5 and so on...

As you can see this works well for short times up to 10 minutes then it gets weird... The idea came up when I was flying model helicopters where I had to control the flight time due to small batteries and must not loose visual contact to my heli model. So I made a small Arduino based timer called HeliTimer. But this function fits perfect to the T-watch :-)

Regards Frank

You can view, comment on, or merge this pull request online at:

https://github.com/wfdudley/T-watch-2020/pull/28 Commit Summary

  • Added Sound option to appStopWatch

File Changes

Patch Links:

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/wfdudley/T-watch-2020/pull/28, or unsubscribe https://github.com/notifications/unsubscribe-auth/AI4VYU27YIVHCNNOVO56CFDSZBOU3ANCNFSM4V3TN3WA .

Fra4prg commented 3 years ago

Oops, sorry. Let me check that tomorrow.

Frank

wfdudley commented 3 years ago

You don't need to do a pull request if my version has the sounds in the same order that yours does.

For that matter, you could just email me the diffs if I do have the sounds out of order.

Bill Dudley

This email is free of malware because I run Linux.

On Wed, Jan 13, 2021 at 4:05 PM Fra4prg notifications@github.com wrote:

Oops, sorry. Let me check that tomorrow.

Frank

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/wfdudley/T-watch-2020/pull/28#issuecomment-759739221, or unsubscribe https://github.com/notifications/unsubscribe-auth/AI4VYU6SZZTJMYHJJEJIRU3SZYDKVANCNFSM4V3TN3WA .

Fra4prg commented 3 years ago

Hi Bill, you just need to swap TRIPLE_mp3 and SWEEP_mp3 in the array and sizeofs. The content of my mp3files.h is:

// mp3's of beeps of various frequencies // W.F.Dudley Jr.

include "sounds/beep__182.h" // 182 Hz 100 msec

include "sounds/beep__220.h" // 220 Hz 100 msec

include "sounds/beep__279.h" // etc.

include "sounds/beep__303.h"

include "sounds/beep__473.h"

include "sounds/beep__576.h"

include "sounds/beep_1050.h" // 1050 Hz 100 msec

include "sounds/beep_1050L.h" // 1050 Hz 200 msec

include "sounds/beep-chirp1.h"

include "sounds/C5_L.h"

include "sounds/E5_L.h"

include "sounds/G5_L.h"

include "sounds/TRIPLE.h"

include "sounds/SWEEP.h"

const unsigned char* const beep_array[] PROGMEM = { beep182_mp3, beep__220_mp3, beep279_mp3, beep303_mp3, beep__473_mp3, beep576_mp3, beep_1050_mp3, beep_1050L_mp3, beep_chirp1_mp3, C5_L_mp3, E5_L_mp3, G5_L_mp3, TRIPLE_mp3, SWEEP_mp3 };

const uint16_t beep_sizes[] = { sizeof(beep182_mp3), sizeof(beep__220_mp3), sizeof(beep279_mp3), sizeof(beep303_mp3), sizeof(beep__473_mp3), sizeof(beep576_mp3), sizeof(beep_1050_mp3), sizeof(beep_1050L_mp3), sizeof(beep_chirp1_mp3), sizeof(C5_L_mp3), sizeof(E5_L_mp3), sizeof(G5_L_mp3), sizeof(TRIPLE_mp3), sizeof(SWEEP_mp3) };

Fra4prg commented 3 years ago

again I forgot to sign:

Regards Frank

wfdudley commented 3 years ago

Frank,

OK, done. Change is in github.

I also added a new routine for writing arbitrary text in a "button", and used it for the "silent", "vib+beep", "beep" legends in the "mode" button

Thanks, Bill Dudley

This email is free of malware because I run Linux.

On Thu, Jan 14, 2021 at 12:37 PM Fra4prg notifications@github.com wrote:

again I forgot to sign:

Regards Frank

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/wfdudley/T-watch-2020/pull/28#issuecomment-760350293, or unsubscribe https://github.com/notifications/unsubscribe-auth/AI4VYUY7JTQACM6MOBBI2L3SZ4TW3ANCNFSM4V3TN3WA .