Page 75 - Computing Book 8
P. 75

Programming Robots and Single-Board Computers                                        Class 8


               After successfully entering this code and saving your file with the name of SRC.py follow these steps
               to connect your smart car using the android mobile device.

                   1.  Connect and pair the Bluetooth of the mobile device with raspberry pi.
                   2.  Open terminal and type “sudo python SRC.py &”
                   3.  You will notice the blue LED light will be on Pi Shield, this means that Bluetooth Module is
                       ready to connect.
                   4.  Open the TechTree-Bumble pi application on the mobile device which you have
                       already paired with Bluetooth to this Raspberry Pi.
                   5.  Click on the Bumble Pi icon on the right bottom corner.
                   6.  For security purposes, your mobile device will ask for permission to give
                       Bluetooth module access to this application. Select the Allow option to give
                       permission.
                   7.  After that, a list of Bluetooth devices will be available to connect, select
                       the raspberry pi option which will be listed with the physical (MAC)
                       address of the Bluetooth.
                   8.  Car Controlling screen will appear and the Blue LED on your bumble
                       pi shield will turn off it means your Bluetooth connection is
                       successful now you can control your car from your smartphone.
                   9.  If Blue LED doesn’t turn off it means you’re not connected with the
                       Raspberry Pi so reboot your Raspberry Pi by turning off its switch
                       and then repeat from step 2.
               Note: if the android application screen locks itself or you switch to another application this
               connection will be lost.

               Making a Bootloader:
               For mobility purposes, we can also make a bootloader which will automatically start the command
               whenever the Raspbian OS will boot. By doing this we won’t be needing the Keyboard, Mouse and
               LCD to be connected for configuring or executing the command.
               Note: This Step will not exclude the process of pairing the android device.
               Follow these steps to make the bootloader:
                   1.  Open terminal and type the command “sudo nano /etc/rc.local”
                   2.  There will be a lot of text written in that file. Locate the comment stating “# write a path for
                       the code to run here”.
                   3.  And enter this command “sudo python /home/pi/SRC.py &” and press ctrl+x
                   4.  The terminal window will ask to save the file, press Y for yes.
                   5.  After that terminal will ask to save this file on the same location where we have to press
                       Enter key.
                   6.  Unplug the cables and restart the Pi by typing the Reboot keyword within the terminal
                       window.
                   7.  Wait for the Pi to boot completely and you will notice the blue light is lit and the Pi is ready
                       to connect with the paired mobile device using the Tech Tree Bumble Pi app.









               The City School /Academics/Computing Curriculum/Class 8/2020-2021                Page 74 of 75
   70   71   72   73   74   75   76   77   78