To control the robot with the remote control you need to write a program and run it on the robot.
Write an algorithm to use the controller in TRIK Studio.
Connect your smartphone to the controller by selecting the controller's network.
Open the TRIK Gamepad app on your smartphone.
Execute the algorithm on the controller.
1. Enter variables for gamepad touch coordinates -
y - and initialize them by assigning zero values to them in the "Expression" block:
2. Add the "Wait for Gamepad Connect" block:
4. In case there is no touch, it is necessary to stop the motors. To do this, add a block "Stop motors":
6. After getting the coordinates, add a simple controller with the "Motor Forward" blocks. The Y coordinate offset is responsible for the speed of the robot and the X coordinate offset is responsible for the rotation.
7. To close the condition, add a "Timer" block with a value of
100 ms (in the program this is the time for a new call to the remote control).
8. Close the loop on the "Condition" block with a link from the "Timer" block.
9. If you have a video camera, add the "Enable Video Streaming" block to the beginning of the program: