Yes, on the APPs, the variable is local variable.
As for the issue that the robot doesn’t function with sound and movement, we suspect if the battery you use can provide enough power to the robot. May we know what’s kind of battery do you use? Could you please change the battery have a try?
According to our test and research, it is suggested to use rechargeable Li-ion battery or rechargeable nickel-metal hydride, nickel-cadmium which can be bought from amazon or local shop. Or Alkaline battery with good quality like Energizer, DURACELL.
Once there is still issue, please upgrade firmware for mBot Ranger with latest mBlock 3.4.11 have a try refer to this instruction.How to Upgrade Firmware for Ranger with mBlock 3.4.x.docx.zip (358.5 KB)
Besides, here we have tested your program here and the programs works on the Ranger robot:
The robot moves properly when keep pressing the top button or the bottom buttom: