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.
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.
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
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 (
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 (
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 £.