ipl-logo

Nt1310 Unit 5 Study Guide Answers

437 Words2 Pages

#include #include #include "utility/debug.h" #include "utility/socket.h" #include #include // These are the interrupt and control pins #define ADAFRUIT_CC3000_IRQ 3 // MUST be an interrupt pin! // These can be any two pins #define ADAFRUIT_CC3000_VBAT 5 #define ADAFRUIT_CC3000_CS 10 // Use hardware SPI for the remaining pins // On an UNO, SCK = 13, MISO = 12, and MOSI = 11 Adafruit_CC3000 cc3000 = Adafruit_CC3000(ADAFRUIT_CC3000_CS, ADAFRUIT_CC3000_IRQ, ADAFRUIT_CC3000_VBAT, SPI_CLOCK_DIVIDER); // you can change this clock speed #define WLAN_SSID "Xperia" // cannot be longer than 32 characters! #define WLAN_PASS "9611848948" // Security can be WLAN_SEC_UNSEC, WLAN_SEC_WEP, …show more content…

The HTTP protocol uses port 80. Adafruit_CC3000_Server HAServer(LISTEN_PORT); int r1 = 6, r2 = 7; String readString; float temp; int tempPin=0; void setup(void) { pinMode(r1, OUTPUT); // Pin Assignment through which relay will be controlled pinMode(r2, OUTPUT); Serial.begin(115200); Serial.println(F("Hello!!! ")); Serial.print("Free RAM: "); Serial.println(getFreeRam(), DEC); /* Initialise the module */ Serial.println(F(" Initializing...")); if (!cc3000.begin()) { Serial.println(F("Couldn 't begin()! Check your wiring?")); while(1); } Serial.println(F(" Deleting old connection profiles")); if (!cc3000.deleteProfiles()) { Serial.println(F("Failed!")); while(1); } Serial.print(F(" Attempting to connect to ")); Serial.println(WLAN_SSID); if (!cc3000.connectToAP(WLAN_SSID, WLAN_PASS, WLAN_SECURITY)) { Serial.println(F("Failed!")); while(1); } Serial.println(F("Connected!")); Serial.println(F("Request DHCP")); while (!cc3000.checkDHCP()) { delay(100); // ToDo: Insert a DHCP timeout! } /* Display the IP address DNS, Gateway, etc. */

More about Nt1310 Unit 5 Study Guide Answers

Open Document