RP6 ROBOT SYSTEM - 5. Example Programs
Example 11: WLAN remote control 1
Directory: <RP6Examples>\RP6_M256_WIFI_EXAMPLES\Example_11_WIFI_REMOTE_1\
File: RP6M256_11_WIFI_REMOTE_1.c
This program shows the use of the I2C bus master mode. The controller on the
main board of the robot must have loaded the I2C slave example program (RP6-
Base_I2CSlave.hex)!
Moreover the robot is remote-controlled via the WLAN connection (text commands)
CAUTION: The robot moves in this example program!
The WLAN connection is perfectly suitable for controlling the robot remotely. How this
can be implemented is shown in this program.
It is a very simple command interpreter that can react to specific text commands.
However the command interpreter is directly built into the behavior based model from
the other examples so that the program can be easily extended with autonomous be-
haviors at a later stage.
In this example behaviour_wifiControl is the only active behavior.
A little instruction manual of the program is displayed right at the start per WLAN.
First you type in “cmd” in order to activate the interpreter. “Activate” means activa-
tion of the robot control or triggering the activation of the behavior. The interpreter is
always waiting for commands. If it is “active”, the robot can be controlled via the in-
terpreter.
The keys w-a-s-d and q, e are assigned to the direction control. For every command
you have to press the Enter button, for example:
60 + Enter … the robot drives forwards
d + Enter … the robot turns right, the command interpreter automatically
reduces the speed during turns because otherwise it would be extremely
quick compared to the forward movement.
s + Enter … Backwards.
120 + Enter … faster
w + Enter … forward again
q + Enter … left turn
Enter … Stop! (alternative 0 + Enter)
z + Enter … quit Interpreter
While the interpreter is running a lot of sensor values are transmitted via WLAN. In
this case every 100ms. This could be used for a graphical display on the remote con-
trol PC. The text commands could also be bound to a graphical user interface with
buttons or joystick / gamepad control.
- 48 -