Using Raspberry Pi 3 and Android app (BlueDot remote control) to build a Bluetooth control cart (buggy)

Version ‘alamak’ of the remote control cart (buggy)

There are some limitation using the Python robot library together with this buggy. The right and left function resulted in the buggy doing a spot turn, which in this case is not what I wanted. So in the code you can see that the turn right/left function is use together with forward and sleep function to smoothen the turning.

In Line 39 , the ‘bd.when_moved’ command is commented out because I do not want the Blue Dot remote control to register a long press as a command to sent continuous loops. In this way the RPi will only run one ‘move’ function per one press of the Blue Dot. The next ‘move function will only run when the user finger is lifted and repress the bluedot. This, to me is necessary, so as to have better control on the turning of the buggy.

A video to show the buggy doing donuts around a table leg. ↓

Some modification of the code resulted in more control of the turning of the buggy.
from bluedot import BlueDot
from gpiozero import Robot
from time import sleep

bd = BlueDot()
#Just a message to confirm interface
print("You pressed the blue dot!")

#GPIO pins to motors connection
robot = Robot(left=(7, 8), right=(9, 10))

def move(pos):
    elif pos.bottom:
    elif pos.right:     #the right/left turn fn use together 
        robot.left()    #with forward and sleep function
        sleep(0.05)     #to smoothen the turning
    elif pos.left:
def stop():

bd.when_pressed = move
#below when_moved command removed to prevent bluedot continuous
#sending message to Rpi
#bd.when_moved = move

bd.when_released = stop

So the next step is to add a front (and maybe back) camera to the buggy and make it a surveillance buggy. Good thing the range of the bluetooth can be up to 100m.