RP6 ROBOT SYSTEM - 5. Example Programs
Example 12: WLAN remote control 2
Directory: <RP6Examples>\RP6_M256_WIFI_EXAMPLES\Example_12_WIFI_REMOTE_2\
File: RP6M256_12_WIFI_REMOTE_2.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 autonomous behavior of the other programs is added again here and you can ac-
tivate and deactivate the behaviors via WLAN or override the behaviors and control
the robot manually.
The Escape behavior is always active because if the robot collides with an obstacle, it
is always better to drive back and around the obstacle rather than continuing. How-
ever the command mode has a higher priority. This means that we can for example
let the robot push a box on purpose without activating the escape behavior.
Avoid and Cruise can be activated and deactivated. Cruise should be activated as last
step because once this is activated the robot just drives forward without checking for
obstacles. Even if Cruise is deactivated, the robot still reacts on obstacles (just try to
move your hand in front of the robot or press on the bumpers).
As soon as any behavior except the “stop” behavior is active, all sensor values of the
robot are transmitted at 10Hz via WLAN.
Example 13: Very simple web server
Directory: <RP6Examples>\RP6_M256_WIFI_EXAMPLES\Example_13_Simple_Webserver\
File: RP6M256_13_Simple_Webserver.c
The program generates outputs on the serial interface, the WLAN connection and
the LCD!
In this example program the robot
does not
move!
The network data connection can also be used for applications like web servers. This
example illustrates this in an very simple way. It implements an extremely minimalist-
ic web server. The code for the server is just about 25 lines short (without HTML con-
tents and debug outputs).
The web server is only able
to do one single thing which
is sending the web page on
the screen shot to the
querying browser.
The page is dynamic though,
i.e. the program may change
the contents. It simply dis-
plays the value of a stop-
watch (will be reset to 0
after 10 seconds). Upon
every page request a
counter is incremented and
- 49 -