Switch-on, switch-off in a time range. Please help...

Former Member
Former Member

Hello.

I try to do a function for my dial that turns off, for example, seconds in a given time range.

I want it to be possible to set it in APP (in xml format). I have everything ready, but the problem is that the function does not work correctly for me yet.

I'm just getting started with MonkeyC programming and I'd appreciate it if someone could help me with my code. All I need is this function and the dial is done.

Here I attach the code


Thank you very much

The error I'm getting in the SIM...

Error: Symbol Not Found Error
Details: Could not find symbol 'today'

Thank you very much

I will give VoteUP for professional help with this feature.

 

  • It doesn't shut off at 6AM for exactly the reason I just outlined. However I've just noticed that ON means the clock is off  and OFF means the clock is on,  which is a little bit mind bending. This means the logic was reversed.

    I'm a liltte unsure why you can't copy and paste the text above into a new file and think it's quicker and easier for me to zip up the file and upload it here. It may be quicker and easier for you, but it takes my time. My polite advice is to be more considerate of others and the value of their time.

    I have corrected the logic and removed a lot of extraneous code for you and uploaded it here. I have also tested it, and it now works for the edge cases. Going forwards I strongly recommend you spend time reading and understanding the example projects before moving forwards. In my opinion you're trying to run before you can walk.  Having said that, good luck!

    Common.zip

  • Former Member
    Former Member in reply to Dresbo

    Thank you for your great help.

    I see that you do what you do well and you are good at it.

    Also, thank you for your time.

    I think I've already moved somewhere and thanks to you, and I can see the logic of the matter.


    SHN is only following this thread, but he has not tried to help me anymore ... he has only provided me with part of the code ...

    It is good that there are still people in the world who want to help selflessly.Tophat

  • Glad it's working for you. I tested it locally and it worked as I expected, so you should be good now.