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: mbed DRV88255 TextLCD Ping mbed-rtos
Diff: main.cpp
- Revision:
- 74:05f2188cfc0b
- Parent:
- 72:f8c4f731f0fe
- Child:
- 75:763f3f0a311c
--- a/main.cpp Tue Jun 21 13:49:11 2016 +0000 +++ b/main.cpp Wed Jun 22 11:16:00 2016 +0000 @@ -8,7 +8,8 @@ #include "SensorAlarmController.h" #include "PIDController.h" #include "settings.h" - +#include "testing.h" +#include "MockSensorController.h" #include "mbed.h" extern int testMain(); @@ -19,6 +20,7 @@ return MAIN(); } +MOCK(salinity_mock, 3.0f); int realMain() { @@ -37,7 +39,8 @@ ProximityController proximity(false, 0); controllers.push_back((void*)&proximity); - SalinityController salt(false, 0); + //SalinityController salt(false, 0); + MockSensorController salt(false,0,salinity_mock); controllers.push_back((void *)&salt); // Add alarms to monitor sensor values @@ -116,8 +119,12 @@ #endif } - if(!prox_alarm.isActive()) + if(!prox_alarm.isActive()) { + printf("Running pidcontroller!\r\n"); pidc.run(); + } else { + printf("Not running pidcontroller, prox alarm is active!\r\n"); + } //Show temperature, salinity and volume of the water tank on the PC if connected through serial