chakib 1 Posted April 24, 2015 Share Posted April 24, 2015 Hello, I'm searching for a simple example to calculate the external temperature with the development kit CC3200 with Energia. Regards Quote Link to post Share on other sites
chakib 1 Posted April 24, 2015 Author Share Posted April 24, 2015 I found the solution : #include <SPI.h> #include <WiFi.h> #include <Wire.h> #include "Adafruit_TMP006.h" // your network name also called SSID char ssid[] = "ssid"; // your network password char password[] = "password"; // Get Temp() Adafruit_TMP006 tmp006(0x41); void setup() { Serial.begin(115200); // attempt to connect to Wifi network: Serial.print("Attempting to connect to Network named: "); // print the network name (SSID); Serial.println(ssid); // Connect to WPA/WPA2 network. Change this line if using open or WEP network: WiFi.begin(ssid, password); while ( WiFi.status() != WL_CONNECTED) { // print dots while we wait to connect Serial.print("."); delay(300); } Serial.println("\nYou're connected to the network"); Serial.println("Waiting for an ip address"); while (WiFi.localIP() == INADDR_NONE) { // print dots while we wait for an ip addresss Serial.print("."); delay(300); } // We are connected and have an IP address. Serial.print("\nIP Address obtained: "); Serial.println(WiFi.localIP()); // Get Temperature Test if (!tmp006.begin()) { Serial.println("No sensor found"); while (1); } } void loop() { Serial.println("Temperature: "); Serial.println( getTemp() ); delay(3000); } // getTemp() function for CC3200 double getTemp() { return (double)tmp006.readObjTempC(); } Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.