test

Dependencies:   BH1750 DHT DS1820 W5500Interface MQ135 NTPClient SENSOR WebSocketClient mbed

Revision:
2:31b004b66644
Parent:
0:7b09d7308cf7
--- a/main.cpp	Thu Sep 08 14:14:58 2016 +0000
+++ b/main.cpp	Mon Sep 19 18:53:09 2016 +0000
@@ -18,6 +18,11 @@
 int main() {
     pc.baud(921600);
 
+#if defined(TARGET_NUCLEO_F401RE)
+    SPI spi(PB_15, PB_14, PB_13); // mosi, miso, sclk
+    EthernetInterface eth(&spi, PB_1, PB_2); // spi, cs, reset
+    #warning "setup for F401RE"
+#endif
 
     //Create sensors
 //    pc.printf("Creating sensor 0\n\r");
@@ -58,9 +63,11 @@
     sensorStatus sensor_status;
     sensorType sensor_type;
         
-    wifi.init(); //Reset
-    wifi.connect(); //Use DHCP
-    pc.printf("IP Address is %s\n\r", wifi.getIPAddress());
+    pc.printf("pre init eth\r\n", eth.getMACAddress());
+    eth.init("192.168.1.202", "255.255.255.0", "192.168.1.254"); //Use DHCP
+    pc.printf("Initialized, MAC: %s\r\n", eth.getMACAddress());
+    eth.connect();
+    pc.printf("Connected, IP: %s, MASK: %s, GW: %s\r\n",eth.getIPAddress(), eth.getNetworkMask(), eth.getGateway());
 
 /*
     if (ntp.setTime("0.uk.pool.ntp.org") == 0)