PTHAT Xbox Gamepad Mecanum Bot Example using Instant Commands
With this example, we show how to use the PTHAT and wireless Xbox controller to control a Mecanum Bot.
We called it the Mecanum Bot because it uses the Mecanum wheels that allows for some mad moves.
It works great with all communications sent over WiFi and it can be used with a Xbox controller for free style.
The PC acts as a middle man where the wireless Xbox controller communicates to a Universal Windows Application (UWA) written in C# for Windows 10 IOT.
It then creates a Network Socket connection over to the another UWA running on the Raspberry Pi that listens on the network and receives commands and then relays those commands to the Pulse Train Hat, which controls the motors.

First we deployed the UWA to the Raspberry Pi and then used the IOT Remote Control to set things up.
Within the application you first connect to your Raspberry Pi serial port by choosing it from the drop down list and then clicking the Connect button.
Now you can test the Jog buttons within the application to make sure the Bot moves and then move onto testing with the Xbox Controller using the UWA that runs on the PC.
The UWA running on the Raspberry Pi also creates a Network Socket and listens on Port 9000 for incoming packets from the PC where the Xbox controller is connected.
As you can see there are not a lot of components and it is pretty big at over 500mm square and using 152mm wheels.
You can get smaller, cheaper wheels and also use smaller low cost motors.
Instant Commands used in this example are:
Set Axis CommandStart Axis Command
Stop Axis Command
Change Axis Speed on the fly Command
Enable/Disable Limit Switches Command
Toggle Motor Enable Line
Request Firmware Version
Reset PTHAT

The end developer has easily modify this example to build their own application.
The example application was developed in Visual Studio 2015 that can be used with Windows 10 IOT on the Raspberry Pi or compiled to x86/x64 for use on a PC.
The example has been written in C# as a Universal Windows Platform (UWP).
Please use the following link to download the full source code.
Select another example below









Closer look at the PCB's
PTHAT Mainboard
- Single Channel Main Board.
- JTAG Programmer.
- Set of Mounting Spacers and Bolts.
PTHAT Add on Board
- Expansion Add on Board.
- Increases the PTHAT to 4 channels.
- Extra I/O Functionality.
- Set of Mounting Spacers.
PTHAT Full Package
- Single Channel Main Board.
- Expansion Add on Board.
- Increases the PTHAT to 4 channels.
- Extra I/O Functionality.
- JTAG Programmer.
- Set of Mounting Spacers and Bolts.
- Save £10 with this Package