Asked — Edited
Resolved Resolved by Rich!

Roomba Drive Speed Using The Slider Control On Android Mobile

While building an Android Mobile app I'm trying to figure out how to use the Slider button to control Roomba drive motor speed. Need some clues.

User-inserted image


ARC Pro

Upgrade to ARC Pro

Discover the limitless potential of robot programming with Synthiam ARC Pro – where innovation and creativity meet seamlessly.

#1  

Rich provided a code example to solve this question. Scroll down to see it.

PRO
Synthiam
#2  

Does the Roomba Movement Panel work on the mobile yet? I honestly don't know - i'll have to check if it's been implemented yet. Try it and see.

As for setting the speed, you can do so by adding a Slider to the mobile interface and having the EZ-Script use the SetSpeed() command.

#3  

Hey Robot-Doc,

You are the absolute expert on the roomba. I just plugged in the cable, put the wires on D0 and selected the roomba Movement and it worked when I hit the arrow keys. Now, on reboot or something like that, I had to play with the button in the top left hand corner. and sometimes the light did not light. It looked like it was off, but Varoom! it controlled the motors. I think that the slider button controlled the speed. I have disassembled the robot so I don't remember.

Hope that this helped. Good Luck, my friend!

#4  

Thanks for the clue DJ, I still don't quite understand how the slider control actually will change the Roomba drive speed if the value is set using the SetSpeed() command. If I insert a value (0 - 255) then that single value is used to set the drive speed no matter what position the slider is at. A single button could be assigned to accomplish that. I don't understand how the slider works in this case.

United Kingdom
#5  

The slider is associated with a variable, i.e. $slider1

Use this with SetSpeed()

i.e.

SetSpeed($slider1)

This is assumption, I have no roomba to try it on (I'm not even on a PC with ARC either...)

#6  

Thanks Rich, your example code was just right so that I could complete the slider button assignment.