newest version
Diff: sample_hardware.cpp
- Revision:
- 9:ca8090c7868e
- Parent:
- 8:df979097cc71
--- a/sample_hardware.cpp Thu Dec 07 15:28:16 2017 +0000 +++ b/sample_hardware.cpp Fri Dec 07 13:07:08 2018 +0000 @@ -1,10 +1,22 @@ #include "mbed.h" +#include "ntp-client/NTPClient.h" +#include "TCPServer.h" +#include "TCPSocket.h" +#include <iostream> +#include <string> +#include "EthernetInterface.h" #include "sample_hardware.hpp" -#include "Networkbits.hpp" + + #define RED_DONE 1 #define YELLOW_DONE 2 +#define IP "10.0.0.10" +#define NETMASK "255.0.0.0" +#define GATEWAY "10.0.0.1" + + //Digital outputs DigitalOut onBoardLED(LED1); DigitalOut redLED(PE_15); @@ -13,8 +25,8 @@ //Inputs DigitalIn onBoardSwitch(USER_BUTTON); -DigitalIn SW1(PE_12); DigitalIn SW2(PE_14); + //Serial pc(USBTX, USBRX); AnalogIn adcIn(PA_0); @@ -31,9 +43,13 @@ //D7,6,4,2 are the 4 bit for d4-7 TextLCD lcd(D9, D8, D7, D6, D4, D2); // rs, e, d4-d7 + //SD Card SDBlockDevice sd(PB_5, D12, D13, D10); // mosi, miso, sclk, cs + + + //POWER ON SELF TEST void post() { @@ -54,7 +70,7 @@ } //Output the switch states (hold them down to test) - printf("SW1: %d\tSW2: %d\n\r", SW1.read(), SW2.read()); + printf("SW2: %d\n\r", SW2.read()); printf("USER: %d\n\r", onBoardSwitch.read()); //Output the ADC @@ -82,7 +98,7 @@ redLED = 0; //Network test (if BOTH switches are held down) - networktest(); + // networktest(); puts("**********POST END**********");