Hardware Reference
In-Depth Information
#define WLAN_SSID "yourSSID"
#define WLAN_PASS "yourPassword"
#define WLAN_SECURITY WLAN_SEC_WPA2
Note that you will also have to change your security settings if you are not using WPA2.
To get a list of all the possible security settings, you can have a look at the example
sketches inside the CC3000 library:
// Security can be WLAN_SEC_UNSEC, WLAN_SEC_WEP,
WLAN_SEC_WPA or WLAN_SEC_WPA2
You also need to define a port on which we are going to listen for incoming connections. I
used 80, which is quite convenient because you can directly type commands in your
browser to access the board:
#define LISTEN_PORT 80
We'll also need to define the server that will run on the Arduino board and accept incom-
ing connections:
Adafruit_CC3000_Server restServer(LISTEN_PORT);
We also need to make an instance of the mDNS service, which will be quite useful to ac-
cess the board without having the IP address of the board:
MDNSResponder mdns;
Finally, you have to make an instance of the aREST library, so we can handle the requests
coming from the outside world:
aREST rest = aREST();
Inside the setup() function, after initializing the board and connecting to the local Wi-
Fi network, you can start the mDNS service. This is where you actually give a name to
your Arduino board. Here, we simply call it arduino , which means it will be accessible
later using the name arduino.local in your browser:
if (!mdns.begin("arduino", cc3000)) {
while(1); }
Search WWH ::




Custom Search