LIFsCode / ELOC-3.0

Firmware for ELOC 3.0 Hardware
MIT License
3 stars 3 forks source link

Add LED Status Indicator Support #14

Closed LIFsCode closed 9 months ago

LIFsCode commented 1 year ago
EDsteve commented 10 months ago

@LIFsCode @OOHehir An idea about the indicator system. I am sure it has some flaws in it. So please add or correct if you find improvements. Somehow i think the battery LED should be used for other purposes as well. 90% of the time people will check the battery from the app anyway. I might remove the name "Battery LED" from the PCB as well. And because it kind of fits in here i added the Buzzer also :)

Status LEDs:

Function Status LED Battery LED Description
Booting Alternating Alternating Status LED and Battery LED alternating
BT ready (not connected) ON Off Status LED constantly ON
BT connected ON ON Status LED and Battery LED both ON
Recording Flashes (100ms per second) Flashes for 30 seconds, reactivatable with knock sensor
Detecting Flashes (100ms per second) Flashes for 30 seconds, reactivatable with knock sensor
No SD card flash fife times for 50ms every second flash fife times for 50ms every second Flashing at the sam time
Battery Low * flash three times for 50ms every 5 seconds flash three times for 50ms every 5 seconds Flashing at the sam time
Firmware uploading/flashing fast flashing fast flashing Both LEDs flash in a fast interval
Sleep OFF OFF All LEDs OFF

*NOTE: The ELOC should have a battery threshold where it brings the ELOC to sleep and wakes up again when the battery is full enough. Not implemented yet, but the "Battery Low" is active, when the battery voltage is under that threshold.

Buzzer

Didn't try these frequencies yet. So not sure how they sound. But surely some of these sounds will be too annoying. Maybe implement the bold once first. @LIFsCode I just had a look at the buzzer code again to find out if you need notes or frequencies. And then realized that this is not a copy and past thing. You actually wrote that. Very cool stuff. This Table shows the tones which should be played for each Function. For example "BT ready" should play C4 for 100ms and then C5 for 100ms.

There must be some priority system. For example if the device is recording and i wake it up with the knock sensor. It should play "BT ready" first and then the "Recording" tones.

Function Tone 1 in Hz Tone 2 in Hz Tone 2 in Hz Description
Booting No sound
BT ready (not connected) 261 (C4) 523 (C5) play once, maybe 100ms each tone?
BT turnd off 523 (C5) 261 (C4) play once, maybe 100ms each tone?
BT connected
Recording 261 (C4) play every second for 5 times (fade out possible?)
Detecting 392 (G4) play every second for 5 times (fade out possible?)
Battery Low 261 (C4) 98 (G2) play twice, sweep 0.5 sec, triggered by knock sensor
Intruder alarm* 494 (B4) 1760 (A6) repeated Sweep 0.5s for 15 seconds
Press GPIO0 >5 sec or send "indi" via BT serial EFGC DEF GABF AABCDE EFGC DEF GABF AABCDE EFGC DEF GGED GED GED GFEDC Play Indiana Jones theme

*If the accelerometer goes crazy, that means someone is playing with the device . Maybe good idea to scare animals or humans with it.