Gopigo Board Ultrasonic Sensor Attachment & Python Programming - Business Office Iv

- July 28, 2018
Part four volition consummate the full attain of the GoPiGo Robot Car too that volition hold upwardly attaching the ultrasonic sensor to the servo faceplate that I installed inwards Part 3's Servo Assembly. Attaching the ultrasonic sensor is pretty instantly forwards using 2 of the screws that came amongst the servo kit.
ultrasonic sensor connected to GoPiGo Board's analog port
The GoPiGo Robot machine is at nowadays laid upwardly to hold upwardly programmed to execute commands. To programme the GoPiGo Robot Car I volition hold upwardly using the Python programming language. Here are the steps to source programming the GoPiGo Board:

Step 1) Go to your Internet browser, type in http://dex.local/ too Launch VNC
Step 2) Click on GoPiGo folder, correct click too choose Empty File to attain a file (I called it test.py). You tin give the sack telephone outcry upwardly it anything you lot desire simply hold upwardly certain to add together ".py" at the end.
 
Step 3) Write the next lines of code too hence salve the file:
from gopigo import *
import time

fwd()
time.sleep(2)
bwd()
time.sleep(2)
stop()

Step 4) To execute the lines of code above, we use Terminal command prompt. Then, larn inwards the log inwards details (username: pi/ password: robots1234)
Step 5) Notice the directory place of test.py, which is /home/pi/Desktop/GoPiGoLocal/test.py Therefore, nosotros type inwards cd Desktop/  >cd GoPiGoLocal  >sudo python test.py to execute the command.

Step 6) The wheels volition spin forwards too backwards too hence stop. That's it!

The upcoming Part v volition hold upwardly about remote controlling the GoPiGo Robot Car amongst a desktop keyboard. Stay tuned!
 

Start typing and press Enter to search