RP6 ROBOT SYSTEM - 5. Example Programs
a corresponding number of * are displayed. Only one connection at a time is possible.
Therefore the page shouldn't be updated too quickly nor should 2 browsers access it
simultaneously. The web server always reacts with the same reply to the GET query.
It is unable to deliver other files such as pictures. It would be possible but would need
some more effort. Moreover with bigger files such as pictures, the limited transmission
speed must be taken into account.
Basically, the example can also be extended with forms for input possibilities which
would allow to control the robot per web browser.
Example 14: Data logging to SD card + web server
Directory: <RP6Examples>\RP6_M256_WIFI_EXAMPLES\Example_14_SDCARD_logging\
File: RP6M256_14_SDCARD_logging.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 SD card will now be used to store data. 1x per second all sensor values are quer-
ied from the robot and their values are written into a text file on the card. Among oth-
ers, a few standard C functions for the processing of the strings will be used.
Additionally, the small web server from the previous example has been integrated in
the program to enable retrieving the stored data via a web browser.
Please observe the previously mentioned safety precautions for the microSD card!
Every writing access must be terminated by pressing the SW1 button (running light
stops and a message is displayed on the LCD) before the robot is turned off or a reset
(also via WLAN connection) is triggered.
Another option to handle that has been integrated in the web page: it can either start
or stop the logging via two links. The query of the browser is checked for the page re-
quests start_log or stop_log. The web page is displayed normally and dynamically
whether the logging runs or not.
We have come to the end of this additional manual. The provided example programs
are only a basis / starting point. Now you can give free rein to your own creativity,
write new programs and install new sensors on the RP6 that you can control via the
RP6-M256. Or do something completely different with it. The module is quite universal
and can also be used to control other devices, not only robots.
- 50 -