ON_OFF DISPLAY TM1637

For general Flowcode discussion that does not belong in the other sections.
ELECTRONICA67
Posts: 143
http://meble-kuchenne.info.pl
Joined: Wed Dec 02, 2020 3:59 pm
Has thanked: 26 times
Been thanked: 9 times

Flowcode v10 Re: ON_OFF DISPLAY TM1637

Post 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
Attachments
corto.jpeg
corto.jpeg (33.4 KiB) Viewed 2092 times

medelec35
Matrix Staff
Posts: 1993
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 630 times
Been thanked: 665 times

Re: ON_OFF DISPLAY TM1637

Post by medelec35 »

Is it working for you, or does the project I attached don't work as I have described?
Martin

ELECTRONICA67
Posts: 143
Joined: Wed Dec 02, 2020 3:59 pm
Has thanked: 26 times
Been thanked: 9 times

Flowcode v10 Re: ON_OFF DISPLAY TM1637

Post 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

ELECTRONICA67
Posts: 143
Joined: Wed Dec 02, 2020 3:59 pm
Has thanked: 26 times
Been thanked: 9 times

Flowcode v10 Re: ON_OFF DISPLAY TM1637

Post 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 :?:

ELECTRONICA67
Posts: 143
Joined: Wed Dec 02, 2020 3:59 pm
Has thanked: 26 times
Been thanked: 9 times

Re: ON_OFF DISPLAY TM1637

Post by ELECTRONICA67 »

I mean if there is no need to make a change to Flowcode ?

medelec35
Matrix Staff
Posts: 1993
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 630 times
Been thanked: 665 times

Re: ON_OFF DISPLAY TM1637

Post 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.
Martin

chipfryer27
Valued Contributor
Posts: 1607
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 357 times
Been thanked: 565 times

Re: ON_OFF DISPLAY TM1637

Post 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

ELECTRONICA67
Posts: 143
Joined: Wed Dec 02, 2020 3:59 pm
Has thanked: 26 times
Been thanked: 9 times

Flowcode v10 Re: ON_OFF DISPLAY TM1637

Post 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
Attachments
mA.jpeg
mA.jpeg (56.5 KiB) Viewed 2036 times
IOC_1840.fcfx
(21.21 KiB) Downloaded 89 times

chipfryer27
Valued Contributor
Posts: 1607
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 357 times
Been thanked: 565 times

Re: ON_OFF DISPLAY TM1637

Post 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

ELECTRONICA67
Posts: 143
Joined: Wed Dec 02, 2020 3:59 pm
Has thanked: 26 times
Been thanked: 9 times

Flowcode v10 Re: ON_OFF DISPLAY TM1637

Post 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

Post Reply