attempt to fix posible power issues with the sharp
Dependencies: ADS1115 BME280 CronoDot SDFileSystem mbed
Fork of Outdoor_UPAS_v1_2_Tboard by
Diff: main.cpp
- Revision:
- 35:e0bdd6389a75
- Parent:
- 34:da333abe3476
- Child:
- 36:2e344db70d35
--- a/main.cpp Wed Apr 27 02:57:13 2016 +0000 +++ b/main.cpp Wed Apr 27 06:28:43 2016 +0000 @@ -469,7 +469,7 @@ amps = gasG.getAmps(); bVolt = gasG.getVolts(); bFuel = gasG.getCharge(); - /* + //Check for fully charged battery if(bVolt > 1750 && amps > 8191) { RGB_LED.set_led(0,1,0); @@ -487,7 +487,7 @@ RGB_LED.set_led(0,0,0); } - */ + // Get GPS Data ////////////////////////////// //if(gpsEN ==1){ @@ -525,7 +525,7 @@ //Check for 3.3V rail cut out and turn off pumps in this event if(vInReading > 5950 && amps > 8191) { - //pumps = 0; + pumps = 0; wait(1); //Turn pumps back on once the sampler is plugged in and charging after pumps shutoff and 3.3V rail drops out } else if(pumps == 0 && amps < 8191) { @@ -677,7 +677,7 @@ wait(10); } -*/ + schoolF1.getFault(); homeF2.getFault(); @@ -694,6 +694,23 @@ homeF2.stop(); transitF3.stop(); blankF4.stop(); + */ + + schoolF1.getFault(); + homeF2.getFault(); + transitF3.getFault(); + blankF4.getFault(); + + schoolF1.drive(253); //closed = 253, open = 254 + homeF2.drive(254); //closed = 253, open = 254 + transitF3.drive(253); //closed = 253, open = 254 + blankF4.drive(253); //closed = 253, open = 254 + + wait(1); + schoolF1.stop(); + homeF2.stop(); + transitF3.stop(); + blankF4.stop(); @@ -867,7 +884,7 @@ pumps = 1; //pumpOn = 1; -/* Add this chunk back in once calibrated. + if(volflowSet<=1.0) { gainFlow = 100; } else if(volflowSet>=2.0) { @@ -896,8 +913,8 @@ pc.printf("%d\r\n", digital_pot_setpoint); DigPot.writeRegister(digital_pot_setpoint); wait(1); - blower = 1; - */ + pumps = 1; + @@ -932,7 +949,7 @@ //---------------------------------------------------------------------------------------------// //Sets the flow withen +-1.5% of the desired flow rate based on mass flow -/* + while(abs(deltaMflow)>.025) { omronReading = ads.readADC_SingleEnded(0, 0xC383); // read channel 0 PGA = 2 : Full Scale Range = 2.048V @@ -966,7 +983,7 @@ } -*/ + sampledVol = 0.0; RGB_LED.set_led(0,1,0); @@ -975,25 +992,10 @@ stop.attach(&check_stop, 9); // check if we should shut down every 9 number seconds, starting after the start. logg.attach(&log_data, logInerval); - //flowCtl.attach(&flowControl, 3); - -wait(30); + flowCtl.attach(&flowControl, 3); - schoolF1.getFault(); - homeF2.getFault(); - transitF3.getFault(); - blankF4.getFault(); - - schoolF1.drive(253); //closed = 253, open = 254 - homeF2.drive(253); //closed = 253, open = 254 - transitF3.drive(254); //closed = 253, open = 254 - blankF4.drive(253); //closed = 253, open = 254 - - wait(1); - schoolF1.stop(); - homeF2.stop(); - transitF3.stop(); - blankF4.stop(); + + /* wait(60);