RP6 ROBOT SYSTEM - 5. Example Programs
Example 1: “Hello World”-Program with LED text output and LED running light
Directory: <RP6Examples>\RP6_M256_WIFI_EXAMPLES\Example_01_LCD\
File: RP6M256_LCD.c
The program generates outputs on the serial interface
AND sends outputs via the WLAN connection!
So you should connect the robot to a PC and watch the outputs on the terminal
of RobotLoader! As an option, you can connect the LCD!
The robot does
NOT
move in this example –
as long as you have loaded only the
I2C bus slave program into the controller on the main board
.
So you can put it
on a table next to the computer.
This example displays a short “Hello World” text via the serial interface and via the
WLAN module / the open network connection. You can see the output on both termin-
als.
Subsequently, a running light is executed. In addition, the LCD (if connected) will dis-
play first a static text and later a moving “Hello World” text – the two words “HELLO”
and “WORLD” move slowly from one side to the other. A short break takes place after
16 seconds and this is displayed via the network connection. It resumes 8 seconds
later.
Example 2: Buttons and LC Display
Directory: <RP6Examples>\RP6_M256_WIFI_EXAMPLES\Example_02_Buttons\
File: RP6M256_Buttons.c
The program generates outputs on the serial interface, the WLAN connection and
on the LCD!
The robot does
NOT
move in this example program!
This example illustrates the use of the 2 buttons on the RP6 CONTROL M256. On
every press of a button, the button number is shown on the display and via the serial
interface and the WLAN connection.
Example 3: Analog to Digital Converter (ADC) and I/O ports
Directory: <RP6Examples>\RP6_M256_WIFI_EXAMPLES\Example_03_ADC_IO1\
File: RP6M256_IO_ADC.c
The program generates outputs on the serial interface, the WLAN connection and
on the LCD!
The robot does NOT move in this example program!
Basically it works exactly as on the robot – but as you may need it very frequently for
this expansion module, the example program shows how the free ADCs and I/Os can
be used. The program shows also how simple it is to send telemetry data to a host
computer.
Every 100ms a very long text message is sent per WLAN. The text length has been
unnecessarily increased on purpose. This should show that it is also possible to send
longer messages. The bandwidth can be used much more efficiently e.g. if a program
on your PC should receive and display all sensor data permanently.
- 43 -