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:
- 11:aa21628a9b15
- Parent:
- 10:06fbb1c9e3bd
- Child:
- 12:5b4f3245606a
--- a/main.cpp Wed Mar 02 20:59:40 2016 +0000
+++ b/main.cpp Thu Mar 03 16:06:05 2016 +0000
@@ -11,9 +11,7 @@
#include "EEPROM.h"
#include "Calibration.h"
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(PB_10, PB_11); // tx, rx
//Timer t;
struct tm tt;
@@ -22,7 +20,7 @@
MCP40D17 DigPot(&i2c);
BME280 bmesensor(D14, D15);
STC3100 gasG(D14, D15);
-//DigitalOut blower(D8, 0);
+DigitalOut blower(D8, 0);
DigitalOut pbKill(PC_12, 1);
DigitalOut bleRTS(PB_14, 0);
DigitalOut bleCTS(PB_13, 0);
@@ -103,6 +101,14 @@
SDFileSystem sd(D4, D5, D3, D10, "sd"); // I believe this matches Todd's pinout, let me know if this doesn't work. (MOSI, MISO, SCK, SEL)
void sendData();
+
+
+void pc_recv(){
+ while(pc.readable()){
+ pc.getc();
+ }
+}
+
static uint8_t rx_buf[20];
static uint8_t rx_len=0;
static int haltBLE = 1;
@@ -112,13 +118,6 @@
static int runReady = 0;
static uint8_t startAndEndTime[12] = {0,};
-
-void pc_recv(){
- while(pc.readable()){
- pc.getc();
- }
-}
-
//////////////////////////////////////////////////////////////
//BLE Functions
//////////////////////////////////////////////////////////////
@@ -385,7 +384,7 @@
RGB_LED.set_led(1,1,1);
while(runReady!=1) {
wait(1);
- //pc.printf("Waiting for BLE instruction");
+ pc.printf("Waiting for BLE instruction");
}
