HELP!!! I need help coding a coffee machine

For general Flowcode discussion that does not belong in the other sections.
Post Reply
TreeSpirit101
Posts: 2
http://meble-kuchenne.info.pl
Joined: Mon Jan 08, 2024 12:42 pm

HELP!!! I need help coding a coffee machine

Post by TreeSpirit101 »

It needs to simulate temp change and have 2 buttons to select 2 different sizes. :)

chipfryer27
Valued Contributor
Posts: 1147
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 284 times
Been thanked: 412 times

Re: HELP!!! I need help coding a coffee machine

Post by chipfryer27 »

Hi

If you attach what you have so far, then perhaps someone can assist?

Regards

TreeSpirit101
Posts: 2
Joined: Mon Jan 08, 2024 12:42 pm

Re: HELP!!! I need help coding a coffee machine

Post by TreeSpirit101 »

Apologies I forgot to upload my code.
Attachments
COFFIE MAHCINE.fcfx
(18.33 KiB) Downloaded 48 times

chipfryer27
Valued Contributor
Posts: 1147
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 284 times
Been thanked: 412 times

Re: HELP!!! I need help coding a coffee machine

Post by chipfryer27 »

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

Post Reply