Hi,
I am slowly learning Flowcode and working on a project that lets me count from 0 to 99 and backward.
The project has four physical buttons on the Mikroe 2x2 Key Click, but I am only using number 1 (UP) and 3 (DOWN).
The display shall be blank at start.
Then, if you press the UP button, it will display 1, and not 01... and the same until 9.
When the counter reaches 100, it will continue with 00, 01, 02, 03... 09, 10, 11...
If you press the DOWN button, it will decrement by 1, of course.
The Mikroe 7seg Click has a different segment routing, as you can see in the enclosed schematic, so I have to use a look-up table to remap the segments.
Enclosed is a part of my initial sketch.
Regards,
Andreas
UP/DOWN Counter (0-99) project using Mikroe 7seg Click (2x 74HC595) and Mikroe 2x2 Key Click
-
andeug
- Posts: 101
- http://meble-kuchenne.info.pl
- Joined: Thu Jan 07, 2021 1:42 pm
- Location: Stockholm (SE)
- Has thanked: 34 times
- Been thanked: 5 times
UP/DOWN Counter (0-99) project using Mikroe 7seg Click (2x 74HC595) and Mikroe 2x2 Key Click
FC11 Professional + ARD + AVR + ARM license + Matrix TSL E-blocks2 boards
Mikroe Click boards + Arduino Nano/Uno Click Shield
Mikroe Click boards + Arduino Nano/Uno Click Shield
Re: UP/DOWN Counter (0-99) project using Mikroe 7seg Click (2x 74HC595) and Mikroe 2x2 Key Click
Hi Andreas,
I am also a learner like you, I didn't quite catch your exact requirements, but I attached a program for an up/down counter using push buttons.
It can count up to 99 and reset to zero (and vice versa). i hope it will help for your needs.
Before testing, please make sure your connections match your hardware.
Best Regards,
I am also a learner like you, I didn't quite catch your exact requirements, but I attached a program for an up/down counter using push buttons.
It can count up to 99 and reset to zero (and vice versa). i hope it will help for your needs.
Before testing, please make sure your connections match your hardware.
Best Regards,
- Attachments
-
- Up Down Counter.fcfx
- (18.69 KiB) Downloaded 4 times
-
andeug
- Posts: 101
- Joined: Thu Jan 07, 2021 1:42 pm
- Location: Stockholm (SE)
- Has thanked: 34 times
- Been thanked: 5 times
Re: UP/DOWN Counter (0-99) project using Mikroe 7seg Click (2x 74HC595) and Mikroe 2x2 Key Click
Hi Bijumon,
You can't imagine how much I've been struggling all day trying to make this work, and I haven't managed to yet. Thank you!
One thing that does not work as expected is that you have to press the buttons slowly, and the counter does not respond to quick presses (not sure why - maybe some delays must be added somewhere?).
I have loaded your code on my hardware, and it has worked from the first try:
I wanted to know the logic behind the code, as I will need it later for a more complex project.
In my case, the beauty of using Mikroe's Click boards is that they are just plug&play, and I don't get the same annoyance as when I would have to use patch wires. I also use SimpleMind mind-mapping software to visually map what I am building so I remember the right positions of the Click boards on the carrier board. See enclosed an example:
Andreas
You can't imagine how much I've been struggling all day trying to make this work, and I haven't managed to yet. Thank you!
One thing that does not work as expected is that you have to press the buttons slowly, and the counter does not respond to quick presses (not sure why - maybe some delays must be added somewhere?).
I have loaded your code on my hardware, and it has worked from the first try:
I wanted to know the logic behind the code, as I will need it later for a more complex project.
In my case, the beauty of using Mikroe's Click boards is that they are just plug&play, and I don't get the same annoyance as when I would have to use patch wires. I also use SimpleMind mind-mapping software to visually map what I am building so I remember the right positions of the Click boards on the carrier board. See enclosed an example:
Andreas
FC11 Professional + ARD + AVR + ARM license + Matrix TSL E-blocks2 boards
Mikroe Click boards + Arduino Nano/Uno Click Shield
Mikroe Click boards + Arduino Nano/Uno Click Shield
Re: UP/DOWN Counter (0-99) project using Mikroe 7seg Click (2x 74HC595) and Mikroe 2x2 Key Click
Hi,
I am happy to hear that my example worked for you.......
Regarding the slow button response: according to the datasheet of the 2x2 Key Click board, it has a hardware debouncing circuit. Additionally, the software (ReadState Macro) has a default debouncing delay of 5ms.
I suspect this combination might be causing the slow response. You can try setting the software debouncing delay to 0 and testing it again, though since it is only 5ms, you may ultimately need to reduce the hardware debouncing capacitor value instead.
I am happy to hear that my example worked for you.......
Regarding the slow button response: according to the datasheet of the 2x2 Key Click board, it has a hardware debouncing circuit. Additionally, the software (ReadState Macro) has a default debouncing delay of 5ms.
I suspect this combination might be causing the slow response. You can try setting the software debouncing delay to 0 and testing it again, though since it is only 5ms, you may ultimately need to reduce the hardware debouncing capacitor value instead.