Robotics – Raspberry Pi

We need to be able to login to our Raspberry Pi, to do this we are going to use the Visual Studio Code editor.

We need to install an extension that will help us transfer files and work with the Raspberry Pi.

https://marketplace.visualstudio.com/items?itemName=cweijan.vscode-ssh

The username to the Raspberry Pi is: pi

The password to the Raspberry Pi is: raspberry

Create a new folder and copy the files below to the Raspberry Pi.

To make our robots work, we will need the following files downloaded to our Raspberry Pi.

https://buildingblockstudio.s3.amazonaws.com/MotorDriver.py

https://buildingblockstudio.s3.amazonaws.com/PCA9685.py

We should be able to test our Pi Hat by using the following command:

python MotorDriver.py

Next Upload the following files to the Pi:

https://buildingblockstudio.s3.amazonaws.com/RobotServer.py

https://buildingblockstudio.s3.amazonaws.com/Robot_Client.html

We need to modify RobotServer.py to match your robot.

Next we can try to run the RobotServer.py

python RobotServer.py

The first time you run this, you will get an error, run the following command:

pip install tornado

Open the Robot_Client.html on your local computer.

We can then use the control pad to move our robot.

We also have starter files for:

Mecanum Drive

Tank Drive

We also have a backup that does not use the web server, rather this uses the keyboard via the terminal.

Keyboard Backup