MESSAGING WITH YOUR ROBOT • MESSAGING WITH YOUR ROBOT • MESSAGING WITH YOUR ROBOT
SCREENSHOT 2. At this point, we're still working on
the TCPIPConfig.h file. We can keep the default MAC
address as the TCP/IP stack will populate the
appropriate address fields with the MRF24WB0MA's
built-in MAC address.
Delivering the Mail
#define MY_DEFAULT_MAC_BYTE3 (0xA3)
// PIC32MX6XX/7XX internal Ethernet
#define MY_DEFAULT_MAC_BYTE4 (0x00)
// controller and wish to use the
#define MY_DEFAULT_MAC_BYTE5 (0x00)
// internal factory programmed MAC
#define MY_DEFAULT_MAC_BYTE6 (0x00)
// address instead.
The Configuration Wizard also supports the wireless
component of the TCP/IP stack, whose parameters are
found within the WF_Config.h file. Screenshot 3 is the
beginning of our wireless network connection. By the time
we work our way through the Wizard, the security method
will be set and the MRF24WB0MA power control options
will be set in place. Clicking on the Wizard’s Finish button
will file the WF_Config.h configuration parameters away.
Here’s a taste of the real thing:
The email delivery process is controlled by the
code contained within the TCP/IP stack’s SMTP.c and
SMTP.h driver files. The email driver files define and
execute a number of state machines. There’s a state
machine for resolving the email server’s address.
MAIL_HOME = 0,
} MailState = MAIL_HOME;
Your application must kick off the email process in the
MAIL_HOME state. Normally, your mechanical
creation would logically start the email process.
We’ll use a physical method in our MAIL_HOME
code. We’ll push a button, which just happens to be
part of the Wi-Fi demo board hardware:
if(SW0_IO == 0u)
// Start sending an email
LED1_IO = 1;
LED2_IO = 0;
The board’s three LEDs provide a visual
SCREENSHOT 3. With this window, we've entered
wireless territory. This series of parameters will be
placed in the WF_Config.h file.
58 SERVO 09.2012