
36
Crowduino UNO-SD/Arduino UNO x1
Crowtail – Base Shield x1
Crowtail – Serial Wifi x1
Crowtail – Cable x1
USB Cable x1
Required Parts
STEP2:
Connect Crowtail-Serial Wifi to Crowtail-Base shield’s U2 port. The
complete connection is as follows:
STEP1:
Plug the Crowtail-Base Shield onto the Arduino or Crowduino Board.
Hardware Connection
Upload the code and open the serial monitor, you
can see some configuration information. Then, use
your pc to connect the wifi of Serial Wifi. Once you
connect the Serial Wifi module, open your browser
and type the IP address you just saw from the serial
monitor to visit the web server of the Serial Wifi.
What will you see
1. Macro defines a variable DEBUG to true.
2. Send the data to ESP8266 to configure access
points and other connection information.
3. Check if the ESP is available, if yes, send the
connection id and webpage information.
4. Create a function to send data.
Code overview
Open the
P17_ESP8266_TCP_Server
with Arduino IDE and upload it.
Switch case statement: switch(variable){case constantExpression1:statement1;break;
case constantExpression2:statement2:break; default:statement2;break;}
The prototype of the macro definition constant is #define [MacroName] [MacroValue]. What is the
difference between a macro definition constant and a variable? Macro-defined constants cannot be
changed while the program is running. We will use this macro definition constant in the function of
sendData().
Macro definition: #define DEBUG true.
This function is to send the data to ESP8266. “command” is the data/command to send. “timeout” is
Send data: String sendData(String command, const int timeout, boolean debug){code
to run; return response;}
Code usage
Summary of Contents for Crowtail
Page 48: ......