HELP!!! I need help coding a coffee machine
-
- Posts: 2
- http://meble-kuchenne.info.pl
- Joined: Mon Jan 08, 2024 12:42 pm
HELP!!! I need help coding a coffee machine
It needs to simulate temp change and have 2 buttons to select 2 different sizes.
-
- Valued Contributor
- Posts: 1313
- Joined: Thu Dec 03, 2020 10:57 am
- Has thanked: 317 times
- Been thanked: 458 times
Re: HELP!!! I need help coding a coffee machine
Hi
If you attach what you have so far, then perhaps someone can assist?
Regards
If you attach what you have so far, then perhaps someone can assist?
Regards
-
- Posts: 2
- Joined: Mon Jan 08, 2024 12:42 pm
Re: HELP!!! I need help coding a coffee machine
Apologies I forgot to upload my code.
- Attachments
-
- COFFIE MAHCINE.fcfx
- (18.33 KiB) Downloaded 142 times
-
- Valued Contributor
- Posts: 1313
- Joined: Thu Dec 03, 2020 10:57 am
- Has thanked: 317 times
- Been thanked: 458 times
Re: HELP!!! I need help coding a coffee machine
Hi
First thing is that you have not set up your clock correctly. In the settings you have it set for internal oscillator running at 32MHz, but for this to work in hardware you will need to use a C-code block as your first icon. If you add in the IntOsc Helper component this will help you further in setting the correct code. It won't affect simulation.
In your size select Macro I assume you wish to choose either "normal" or Espresso, and "normal" or Maxi? However if you select Espresso you also set "select" to "1" which will almost immediately exit your loop (32MHz runs fast) as the loop is set to exit if Select is >=1. Unless you have the reflexes of Superman you won't get a chance to then select Maxi You can check this by going to Debug and Stepping through your program. If you do this the Simulation Debugger window will appear where you can select variables to monitor. You can also change their values too. This will help you figure out what you need to do in that Macro to be able to select all options.
Not sure why you are converting Int2Float in your Heater Macro. You are sampling the ADC as an integer so all that will do is add in a ".0"
Regards
First thing is that you have not set up your clock correctly. In the settings you have it set for internal oscillator running at 32MHz, but for this to work in hardware you will need to use a C-code block as your first icon. If you add in the IntOsc Helper component this will help you further in setting the correct code. It won't affect simulation.
In your size select Macro I assume you wish to choose either "normal" or Espresso, and "normal" or Maxi? However if you select Espresso you also set "select" to "1" which will almost immediately exit your loop (32MHz runs fast) as the loop is set to exit if Select is >=1. Unless you have the reflexes of Superman you won't get a chance to then select Maxi You can check this by going to Debug and Stepping through your program. If you do this the Simulation Debugger window will appear where you can select variables to monitor. You can also change their values too. This will help you figure out what you need to do in that Macro to be able to select all options.
Not sure why you are converting Int2Float in your Heater Macro. You are sampling the ADC as an integer so all that will do is add in a ".0"
Regards