Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: ADS1115 BME280 CronoDot SDFileSystem mbed
Fork of Outdoor_UPAS_v1_2_powerfunction by
Diff: main.cpp
- Revision:
- 10:06fbb1c9e3bd
- Parent:
- 9:8646fd501832
- Child:
- 11:aa21628a9b15
--- a/main.cpp Wed Mar 02 17:16:43 2016 +0000 +++ b/main.cpp Wed Mar 02 20:59:40 2016 +0000 @@ -10,10 +10,10 @@ #include "CronoDot.h" #include "EEPROM.h" #include "Calibration.h" -//Serial pc(USBTX, USBRX); -//Serial microChannel(USBTX, USBRX); // tx, rx Appears there is a conflict in the mbed code (possibly already assigned to SERIAL_TX, SERIAL_RX, USBTX, USBRX need to reassign these values) +Serial pc(USBTX, USBRX); +Serial microChannel(D1, D0); // tx, rx Appears there is a conflict in the mbed code (possibly already assigned to SERIAL_TX, SERIAL_RX, USBTX, USBRX need to reassign these values) // However still an issue with the BLE not reading the EEPROM with the old pin assignments Jake had. -Serial microChannel(D8, D2); // tx, rx +//Serial microChannel(D8, D2); // tx, rx //Timer t; struct tm tt; @@ -112,6 +112,13 @@ static int runReady = 0; static uint8_t startAndEndTime[12] = {0,}; + +void pc_recv(){ + while(pc.readable()){ + pc.getc(); + } +} + ////////////////////////////////////////////////////////////// //BLE Functions ////////////////////////////////////////////////////////////// @@ -158,7 +165,7 @@ if((transmissionValue!=100) && (dataLength!= 0)) writeData[dataLength-1] = rx_buf[0]; if(transmissionValue ==100){ - //pc.putc(rx_buf[0]); + pc.putc(rx_buf[0]); }else if(transmissionValue ==1){ //process and store RTC values @@ -339,8 +346,8 @@ //wait(10); //RGB_LED.set_led(0,0,1); - //pc.baud(115200); // set what you want here depending on your terminal program speed - //pc.printf("\f\n\r-------------Startup-------------\n\r"); + pc.baud(115200); // set what you want here depending on your terminal program speed + pc.printf("\f\n\r-------------Startup-------------\n\r"); wait(0.5); uint8_t serialNumberAndType[6] = {0x50,0x53}; @@ -358,7 +365,7 @@ serialNumberAndType[4] = serialNumDigits[2]+48; serialNumberAndType[5] = serialNumDigits[3]+48; RGB_LED.set_led(0,1,0); - //pc.attach(pc_recv); + pc.attach(pc_recv); microChannel.attach(uartMicro,microChannel.RxIrq); microChannel.baud(115200); microChannel.printf("$$$");