Portugal
Asked — Edited

Adding Values To Variable

setVar(CLeft,0);
def loop():
  if getVar("$RoombaLightBumperCenterLeft")==1:
     Navigation.SetNavigationStatusToPause();
     print "Bumper Center Left";
     setVar(CLeft)+=1;
     sleep(5);
  if getVar(CLeft)== 2:
       Movement.left(100, 1500);
       setVar(CLeft) == 0;
sleep(2)
 else:
     Navigation.SetNavigationStatusToNavigating();
     time.sleep(1);
  loop();
loop();

I dont get this python. I am trying to add 1 to the variable "CLeft" but my code does not work. Anyone?


Related Hardware Roomba
Related Control EZ-Script Console

ARC Pro

Upgrade to ARC Pro

Unleash your creativity with the power of easy robot programming using Synthiam ARC Pro

PRO
Synthiam
#9  

Yes, the use of getvar for roomba variable is correct. It was cleft that I only mentioned