modify

Dependencies:   Adafruit_GFX Adafruit_ST7735 GMMP_mbed NTPClient SDFileSystem WIZnet_Library mbed

Fork of ThingPlug_Ethernet_Example_temp_V2 by irina kim

Revision:
1:468ac9167975
Parent:
0:fdbd2c6947ea
Child:
6:f3e13103ea9d
--- a/main.cpp	Sun Aug 09 14:24:15 2015 +0000
+++ b/main.cpp	Sun Aug 09 15:02:40 2015 +0000
@@ -1,19 +1,6 @@
 #include "mbed.h"
 
-#if defined(TARGET_LPC1768)
-#include "C12832.h" //for LCD
-#include "LM75B.h" //for Temperature Sensor
-#elif defined(TARGET_NUCLEO_F411RE) || defined(TARGET_NUCLEO_F401RE) || defined(TARGET_NUCLEO_F303RE) || defined(TARGET_NUCLEO_F334R8) || defined(TARGET_NUCLEO_L152RE)
-//Sensor N/A for Nucleo
-#endif
-
 DigitalOut myled(LED1);
-
-#if defined(TARGET_LPC1768)
-C12832 lcd(p5, p7, p6, p8, p11);
-LM75B sensor(p28,p27);
-#endif
-
 Serial pc(USBTX, USBRX);
 
 #include "config.h"
@@ -29,7 +16,7 @@
 #define HIGH 0x1
 #define LOW  0x0
 
-byte serverIp[] = THINGPLUG_GMMP_IP_ADDR;
+byte serverIp[4] = THINGPLUG_GMMP_IP_ADDR;
 const int nServerPort = THINGPLUG_GMMP_PORT_NUM;
 const char* pszDomainCode = THINGPLUG_GMMP_SERVICE_NAME;
 const char* pszGWAuthID = THINGPLUG_GMMP_DEVICE_SERIAL_NUM;
@@ -299,16 +286,8 @@
 
 void startSensingTemp()
 {
-#if defined(TARGET_LPC1768)
-    if (sensor.open()) {
         printf("Sensing started!\r\n");
         isSensing = 1;
-    }
-    else
-#endif 
-	{
-        isSensing = 1; //emulate sensor
-    }
 }
 
 #define BUF_SIZE 10
@@ -328,12 +307,6 @@
 
     startSensingTemp(); //lesmin
 
-#if defined(TARGET_LPC1768)
-	char mac_addr[19];
-	mbed_mac_address((char *)mac); //Use mbed mac addres
-	snprintf(mac_addr, 19, "%02x:%02x:%02x:%02x:%02x:%02x", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
-	printf("MAC: %s\n", mac_addr);
-#endif
   if ( Initialize(serverIp, nServerPort, pszDomainCode, pszGWAuthID, g_mac) ) {
       infoln("Initialize failed!");
       return -1; //lesmin
@@ -358,18 +331,7 @@
 }
 
 float getTemperature(void) {
-#if defined(TARGET_LPC1768)
-    float Temp = sensor;
-
-    lcd.cls();
-    lcd.locate(0,3);
-    lcd.printf("Temp = %.3f\n", (float)Temp);
-
-    wait(1.0);
-    return Temp;
-#else
 	return 33.3;
-#endif
 }
 
 void delay(int d) {