Guides the user to their classes
Dependencies: 4DGL-uLCD-SE Course SDFileSystem mbed PinDetect LSM9DS1_Library_cal MBed_Adafruit-GPS-Library
Diff: main.cpp
- Revision:
- 1:65298ed43a58
- Parent:
- 0:ce60014510e5
- Child:
- 2:c708e2027970
--- a/main.cpp Wed Dec 07 22:37:12 2016 +0000 +++ b/main.cpp Wed Dec 07 22:43:54 2016 +0000 @@ -9,8 +9,6 @@ SDFileSystem sd(p5, p6, p7, p8, "sd"); // the pinout on the mbed Cool Components workshop board Serial pc(USBTX, USBRX); Serial esp(p28, p27); // tx, rx -DigitalOut led1(LED1); - uLCD_4DGL uLCD(p9,p10,p11); // serial tx, serial rx, reset pin; char ssid[32] = ""; // enter WiFi router ssid inside the quotes @@ -21,7 +19,7 @@ volatile int tx_out=0; volatile int rx_in=0; volatile int rx_out=0; -const int buffer_size = 4095; //try making this 2047 +const int buffer_size = 4095; char tx_buffer[buffer_size+1]; char rx_buffer[buffer_size+1]; void Tx_interrupt(); @@ -44,8 +42,7 @@ int main() { - courseVec.clear(); - writeClassFile(courseVec); + readClassFile(courseVec); if (courseVec.size() != 0) { @@ -110,12 +107,6 @@ ip_line = ip_buf; } } - - /*char* startWebData = strstr(rx_buffer, "building="); - if (startWebData != NULL) { - memset(webdata, '\0', sizeof(webdata)); - memcpy(webdata, startWebData, 127); - }*/ memset(webdata, '\0', sizeof(webdata)); strcpy(webdata, rx_buffer); @@ -125,7 +116,6 @@ // check web data for form information if (strstr(webdata, "building=none") == NULL) { - led1 = !led1; char buildingBuf[4]; string building; char* buildingLoc = strstr(webdata, "building="); @@ -421,7 +411,6 @@ // Interupt Routine to read in data from serial port void Rx_interrupt() { DataRX=1; - //led3=1; // Loop just in case more than one character is in UART's receive FIFO buffer // Stop if buffer full while ((esp.readable()) && (((rx_in + 1) % buffer_size) != rx_out)) { @@ -430,20 +419,17 @@ pc.putc(rx_buffer[rx_in]); rx_in = (rx_in + 1) % buffer_size; } - //led3=0; return; } // Interupt Routine to write out data to serial port void Tx_interrupt() { - //led2=1; // Loop to fill more than one character in UART's transmit FIFO buffer // Stop if buffer empty while ((esp.writeable()) && (tx_in != tx_out)) { esp.putc(tx_buffer[tx_out]); tx_out = (tx_out + 1) % buffer_size; } - //led2=0; return; }