"If battery is below 20%, do this and that" Doesn't work

I recently programmed a robot at my school when, if the battery capacity is less than 20, it should’ve printed “Consider charging the battery,” and would play an alarm 15 times.
I’ve tested it, and the code doesn’t do what it’s supposed to do. I don’t know what to do with this code. Should I put it under a new “When started” block, delete the code, or do something else with it?

Could you provide a picture of the code?

I’ll provide the link to the image since I am a brand-new user looking for a fix for my code.
And please forgive me for the bad quality. If you can’t understand it, I’ll just post a rough version of my code here.

You can’t use multiple “forever” brackets due to the fact that once the code hits a forever bracket it stays in that bracket forever a way to make it work would be


Then below that you would insert the rest of your code also inside of the forever bracket but not inside the “if then” bracket

5 Likes

I inserted the codes I wanted into the forever bracket, still doesn’t work.
I withdraw my previous statement. Now the code is working as usual.

1 Like