Hello. I'm making a robot. I'm trying to find a way to make the robot get "bored" when it has been inactive for too long. In essence, a timeout. I can't use delay() for obvious reasons, and I'm wondering what the best way to do this is. I have an idea/theory that I haven't been able to test yet. It's something like this:
So instead of setting bored back to false in the else, set another if to test for bored being true and in that do your thing and set bored back to false.
Yes. It gets bored, and while it's bored it does something (runs a subroutine kinda thing) then at the end of the subroutine it sets "bored" as false.
Delta_G:
So instead of setting bored back to false in the else, set another if to test for bored being true and in that do your thing and set bored back to false.
No. That will also immediately reset the bored condition. You need to do it after you perform the boredom subroutine (which you haven't shown).
For the sake of this discussion, you could include it as something like boredActivity(). You don't have to specify what it does. But your code examples can't be verified without it. The last line of boredActivity() should reset the bored condition.
aarg:
No. That will also immediately reset the bored condition. You need to do it after you perform the boredom subroutine (which you haven't shown).
For the sake of this discussion, you could include it as something like boredActivity(). You don't have to specify what it does. But your code examples can't be verified without it. The last line of boredActivity() should reset the bored condition.