adjusting code so i can add a delay for a bool

Hi all.

i have an open source project thats not mine, but i require it to do something slightly different to how its meant to work, in the sense of added feature.

im used to basic arduino code, but this is pretty in depth (to me). this is using bool.

there is a fan on a controller, which in the menu can be set to on or off after a given program has ended.
now what i need to do is if the fan is set to on, i need a setting in the menus to:

1: adjust first on time in millis
2: delay in millis before coming back on untill the program has completely finished.

as it works at the moment, the fan comes on when the program has finished it flow, then once the program has completely finished it will turn back off.

so i need it to:

  1. come on for a set time once flow is finished,
  2. pause for a set time
  3. turn back on until program is completly finished.

any help or guidence would be awesome

attactched below is the code

thanks

steve

Reflow_Master.ino (48.7 KB)

ReflowMasterProfile.h (2.96 KB)

can you provide some hint where in the 1700+ lines of code you think the change is needed

hi. thanks for the reply.

yea sorry my bad.

lines that i can see with anything to do with using the fan is as follows:

lines
100
150
306
649
671
685
687
780
809
854
1268
1308
1338
1393
1417

from what i can tell this is it. but like i said im a bit of a noob when it comes to arduino land.so please forgive my lack of basic understanding.

steve

Why not ask the author? They are probably more willing to do the work.

Also, that code has quite of few examples of how NOT to use millis() and tracking elapsed time.

If you are going to do it, I'd start by simply trying to get your new menu items implemented. Getting that behavior rolled into the code will be more of a challenge. One possible approach would be to implement it using more states.

blh64:
Why not ask the author? They are probably more willing to do the work.

No, they specifically do not offer technical support, explained in code comments.

i have been speaking with the guy who wrote it, unfortunatly like most hes to busy doing new stuff. i have tried inserting delays after it states;

if ( set.useFan && millis() < keepFanOnTime )
StartFan( true )
else
StartFan( false );

i have tried inserting delays after the StartFan but it will not compile. been trying diff things just to get it working but im not great with coding and not worked with states and bool before. so my limited knoledge isnt helping my situation.
steve

You'll need curly brackets if you want to turn the if and else code into multi line operations.

thanks jimmer. would this be why it kept coming back with compile errors?

im getting to the point now where i would hapily pay someone to adjust the code for me.

steve

(deleted)

capposteve:
thanks jimmer. would this be why it kept coming back with compile errors?

im getting to the point now where i would hapily pay someone to adjust the code for me.

steve

Assuming it compiled before you tried your changes. Then you need to read the compile errors and work out whats wrong. When the compiler finds something 'unexpected' that often means your previous line has bad syntax eg in your little clip you posted there is a missing line termination (:wink:

If you post your modifications someone might spot the error. If you post the error messages as well it's likely someone will explain them.

If you provide all the info you can, it makes it easy to help. I am just guessing about the brackets, I didn't know that the if .. else construction could leave them out for single liners.

spycatcher2k:
Why not ask Seon (Unexpected maker - the author) to add this as a feature?

hi, i have been speaking to seon, but like most of us hes busy with other projects, and i will require someone who's very knowledgeable with coding to complete this task, way over my head unfortunately.

jimmer:
Assuming it compiled before you tried your changes. Then you need to read the compile errors and work out whats wrong. When the compiler finds something 'unexpected' that often means your previous line has bad syntax eg in your little clip you posted there is a missing line termination (:wink:

If you post your modifications someone might spot the error. If you post the error messages as well it's likely someone will explain them.

If you provide all the info you can, it makes it easy to help. I am just guessing about the brackets, I didn't know that the if .. else construction could leave them out for single liners.

i have tried a few thing, but being pretty novice at coding not alot of it makes sence, and most of what i would do is guess work,

i have since designed a pcb running an attiny85 and a couple of pots to do the job of the additional code thats needed in the code provided above.
this was within my skill set and i managed to achieve my design, code and design and make a pcb, BUT in the long term i would rather just adjust the code or find someone willing to do it for me for x amount of £.