Hi,
I am working to learn FC11 and am stuck on a project that involves a Click Ring from Mikroe with 32x LEDs (of which I am using only 16x LEDs), connected to an Arduino Nano 328 at 115200 baud. The schematic involves the following block components:
I had to do the mapping of the segments via ChatGPT, and I received the following, which I tested, and it works:
Now I am stuck with the Main macro, on which I need to work with variables, the pushbutton(s) PB1 (and eventually PB3), and time counting.
The way I thought the project was straightforward. They are the following times are pre-configured in Macros:
1 minute
2 minutes
3 minutes
4 minutes
5 minutes
6 minutes
7 minutes
8 minutes
9 minutes
10 minutes
15 minutes
20 minutes
25 minutes (Pomodoro cycle)
30 minutes
45 minutes
60 minutes
How should the timer work? I will explain below:
When I press PB1 once, the timer starts for 1 minute, and after 2 seconds, it begins blinking, indicating it will count 1 minute.
For the 1-minute configuration, I have used "solid" via "T_01min_indicator", and "blinking" state via "T_01min_blink".
When I press PB1 once, the timer starts for 2 minutes, and after 2 seconds, it begins blinking, indicating it will count 2 minutes.
For the 2-minute configuration, I have used "solid" via "T_02min_indicator", and "blinking" state via "T_02min_blink".
For the 2-minute indication, it needs to start with "T_02min_indicator", "T_02min_blink" and then "T_01min_blink".
... and so on. The problem with this approach is that if I am making a mistake in one "minutes" loop, the whole program will not work as expected. Shall I use a different approach instead? Below is what I have created:
The kitchen timing in minutes is calculated by looping through the Macros associated with the counted time.
The challenges that I am experiencing are:
- The "Switch" option only has 10x possible states, while I have 16x.
- I do not know if I should use "Switch" or "Decision" while I am pressing the button and toggling through the minutes that I need to have counted.
- Shall I use only the "Buzzer" component, or "PWM", to generate sound on the buzzer with various intensities? (medium or high)
- Shall I use "Keyboard interrupt" for something, given the simplicity of the whole design?
Can someone please help me with this project?
Regards,
Andreas
Kitchen Timer project using 16x LEDs and 2x 74HC595
-
andeug
- Posts: 52
- http://meble-kuchenne.info.pl
- Joined: Thu Jan 07, 2021 1:42 pm
- Location: Stockholm (SE)
- Has thanked: 16 times
- Been thanked: 2 times
Kitchen Timer project using 16x LEDs and 2x 74HC595
FC11 Professional + ARD license
Matrix TSL E-blocks2 boards
Mikroe Click boards
Matrix TSL E-blocks2 boards
Mikroe Click boards
-
andeug
- Posts: 52
- Joined: Thu Jan 07, 2021 1:42 pm
- Location: Stockholm (SE)
- Has thanked: 16 times
- Been thanked: 2 times
Re: Kitchen Timer project using 16x LEDs and 2x 74HC595
The schematic of the LED Ring Click:
The schematic of the 2x2 key Click:
The picture of the whole assembly (I prefer off-the-shelf components to save time, instead of soldering):
The schematic of the 2x2 key Click:
The picture of the whole assembly (I prefer off-the-shelf components to save time, instead of soldering):
FC11 Professional + ARD license
Matrix TSL E-blocks2 boards
Mikroe Click boards
Matrix TSL E-blocks2 boards
Mikroe Click boards
-
mnfisher
- Valued Contributor
- Posts: 1746
- Joined: Wed Dec 09, 2020 9:37 pm
- Has thanked: 147 times
- Been thanked: 815 times
Re: Kitchen Timer project using 16x LEDs and 2x 74HC595
I don't have access to any hardware (or indeed Flowcode) at the present. However, i would try and create a single macro Blink (count, pattern1, pattern2) rather than using individual macros for each time period.
Select the patterns using a lookup table (either the component or an array) with index as minutes.
Then it is a simple matter to step through the lookup table for each time
To clarify a bit. Button increases time...
.time = 0. // Device off
Increase .time on button press. (One press gives one minute).
.count = lut[1][0]
.pat1 = lut[1][1]
.pat2 = lut [1][2]
Blink(.count, .pat1, .pat2)
Where lut is defined as an array[16][3] for example if you have 16 possible time periods...
Martin
Select the patterns using a lookup table (either the component or an array) with index as minutes.
Then it is a simple matter to step through the lookup table for each time
To clarify a bit. Button increases time...
.time = 0. // Device off
Increase .time on button press. (One press gives one minute).
.count = lut[1][0]
.pat1 = lut[1][1]
.pat2 = lut [1][2]
Blink(.count, .pat1, .pat2)
Where lut is defined as an array[16][3] for example if you have 16 possible time periods...
Martin