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:
- 22:e567f0d4b05d
- Parent:
- 21:25b85cbbdd82
- Child:
- 23:39cf9f03b076
--- a/main.cpp Tue Jul 15 02:08:48 2014 +0000
+++ b/main.cpp Tue Jul 15 09:56:43 2014 +0000
@@ -29,13 +29,18 @@
#include "MMA7660.h"
#include "LM75B.h"
-#include "C12832_lcd.h"
+#include "C12832.h"
+#if defined(TARGET_LPC1768)
#include "PowerControl/EthernetPowerControl.h"
-
+C12832 lcd(p5, p7, p6, p8, p11);
MMA7660 axl(p28, p27);
LM75B tmp(p28, p27);
-C12832_LCD lcd;
+#elif defined(TARGET_LPC1549)
+C12832 lcd(D11, D13, D12, D7, D10);
+MMA7660 axl(SDA, SCL);
+LM75B tmp(SDA, SCL);
+#endif
#include "logo.h"
@@ -45,15 +50,21 @@
#define DEMO_AP_SECUTIRY_KEY_LEN 8
/** Wi-Fi SNIC UART Interface*/
+#if defined(TARGET_LPC1768)
C_SNIC_WifiInterface mSNICwifi( p9, p10, NC, NC, p30 );
-Serial pc(USBTX, USBRX);
+Serial pc(USBTX, USBRX); /* for DEBUG_PRINT */
+#elif defined(TARGET_LPC1549)
+C_SNIC_WifiInterface mSNICwifi( D0, D1, NC, NC, D3 );
+Serial pc(P2_12, P2_11); /* for DEBUG_PRINT */
+#endif
int main() {
+#if defined(TARGET_LPC1768)
PHY_PowerDown();
-
+#endif
pc.baud( 115200 );
- printf("main\r\n");
+ DEBUG_PRINT("main\r\n");
lcd_print_xively_logo();
// Initialize Wi-Fi interface
muRata
Murata TypeYD