Demo application of SNICInterface library for Murata TypeYD, which reports sensor data periodically to Xively cloud server . Hardware platform: mbed application board (https://mbed.org/cookbook/mbed-application-board), mbed LPC1768 (https://mbed.org/platforms/mbed-LPC1768/) and TypeYD.
Dependencies: C12832 LM75B MMA7660 SNICInterface libxively mbed-rtos mbed
Diff: main.cpp
- Revision:
- 16:ed9b9c28f860
- Parent:
- 15:abc12b228291
- Child:
- 17:0bf3c49a83d5
--- a/main.cpp Tue May 27 01:36:56 2014 +0000 +++ b/main.cpp Fri May 30 08:32:20 2014 +0000 @@ -13,28 +13,33 @@ #include "LM75B.h" #include "C12832_lcd.h" +#include "PowerControl/EthernetPowerControl.h" + MMA7660 axl(p28, p27); LM75B tmp(p28, p27); C12832_LCD lcd; #include "logo.h" -#if 0 +#if 1 #define DEMO_AP_SSID "muRata12345" #define DEMO_AP_SECURITY_TYPE e_SEC_WPA2_AES #define DEMO_AP_SECUTIRY_KEY "12345678" -#define DEMO_AP_SECUTIRY_KEY_LEN 8 +#define DEMO_AP_SECUTIRY_KEY_LEN 8 #else #define DEMO_AP_SSID "E2N1-Lab-Buffalo-D302" -#define DEMO_AP_SECURITY_TYPE e_SEC_WPA2_AES -#define DEMO_AP_SECUTIRY_KEY "12345678" -#define DEMO_AP_SECUTIRY_KEY_LEN 8 +#define DEMO_AP_SECURITY_TYPE e_SEC_OPEN +#define DEMO_AP_SECUTIRY_KEY "" +#define DEMO_AP_SECUTIRY_KEY_LEN 0 #endif /** Wi-Fi SNIC UART Interface*/ C_SNIC_WifiInterface mSNICwifi( p9, p10, NC, NC, p30 ); Serial pc(USBTX, USBRX); int main() { + + PHY_PowerDown(); + pc.baud( 115200 ); printf("main\r\n"); lcd_print_xively_logo(); @@ -62,7 +67,7 @@ , DEMO_AP_SECUTIRY_KEY , DEMO_AP_SECUTIRY_KEY_LEN ); lcd_printf("connect();\r\n"); - if( s != 0 ) + if( s != 0 ) { lcd_printf( "Could not connect. Will halt!\n" ); return -1;