Page 3 of 4

Re: ON_OFF DISPLAY TM1637

Posted: Thu Nov 07, 2024 7:15 pm
by ELECTRONICA67
The switch I connected, unfortunately, had an internal short. I cut the cable that was connected to A0 and the segments were effectively turned off and the count was present. :o

Sometimes the simplest solution is usually the best solution.

Thanks Martin
Enrique

Re: ON_OFF DISPLAY TM1637

Posted: Thu Nov 07, 2024 7:43 pm
by medelec35
Is it working for you, or does the project I attached don't work as I have described?

Re: ON_OFF DISPLAY TM1637

Posted: Thu Nov 07, 2024 10:16 pm
by ELECTRONICA67
It worked just as you described, excellent. !!!

All segments remain off and the count continues, when you press the switch the segments are displayed. . .perfect :D

Thank You

Re: ON_OFF DISPLAY TM1637

Posted: Thu Nov 07, 2024 10:53 pm
by ELECTRONICA67
A question, the example is similar to the one Lain sent, was something added to turn off the segments :?:

I see that you added a sequence to turn off the leading zeros 0, but the start of the program is the same, but the segments were not turned off in that example, was there any change :?:

Re: ON_OFF DISPLAY TM1637

Posted: Fri Nov 08, 2024 2:11 am
by ELECTRONICA67
I mean if there is no need to make a change to Flowcode ?

Re: ON_OFF DISPLAY TM1637

Posted: Fri Nov 08, 2024 8:09 am
by medelec35
Iain's version should work as intended and the segments should be all off if the switch was not pressed.
The reason for my version was only to turn off preceding 0's to save a bit more power, otherwise they are very similar indeed.
So if you don't want the preceding 0's off, you can use Iain's version without making any changes.

Re: ON_OFF DISPLAY TM1637

Posted: Fri Nov 08, 2024 11:30 am
by chipfryer27
Hi

Keeping the leading zero's off unless required as per Martin's recommendation will improve your battery life. You may also want to explore putting the chip to sleep (timer1 can still function) and maybe using the button as an interrupt to wake on demand. This will also help improve life as basically all that will run is the timer until you action.

Regards

Re: ON_OFF DISPLAY TM1637

Posted: Sat Nov 09, 2024 12:43 am
by ELECTRONICA67
Hello. . .yes I added a sleep, I think it's not doing what I require I have a problem :(

turning off the segments on the display was a great saving on battery consumption.

When I don't use sleep I have a consumption of 5.4mA and when sleep enters the consumption drops to 0.012mA but everything starts again at zero 0.
The minutes are to scale, they are actually hours and up to 23 hours

Could you take a look at the program :?:

I would really appreciate it if you could help me.

Best Regards and Thanks

Re: ON_OFF DISPLAY TM1637

Posted: Sat Nov 09, 2024 2:59 am
by chipfryer27
Hi

I will try and have a look later but if you are starting again at zero then it may be an issue relating to the WDT. If it is timing out unexpectedly then it would start the program from the beginning, or if you are jumping to connection point"A" unexpectedly that will do the same.

Not really looked yet though.

You do want to get that consumption down, as you would be unlikly to last more than a week or two on batteries if drawing ~5mA.

Regards

Re: ON_OFF DISPLAY TM1637

Posted: Sat Nov 09, 2024 4:00 am
by ELECTRONICA67
Hello Lain

I really appreciate your help,

I've been looking at forum posts, trying to refresh my memory with the basic functions and maybe it's just a missing command, placed in the right place, the sleep function complies with the times, and the program finishes the established sequence, only that when it finishes it initializes as if you were feeding the circuit or you had just turned it on.

I added a 23 hour TMR, I need it to keep the minutes and hours count, I don't require exact times, but I don't need it to be reset, practically until the batteries run out of energy, trying to keep the circuit on for about 1 year, using 4 AA batteries in series.

Saludos