Skip to content
Prev Previous commit
Next Next commit
scope fix
  • Loading branch information
jahnavithota2011 committed Mar 28, 2022
commit bd38049c7a2b327d4b8584324e3053df6c9fdb7b
2 changes: 1 addition & 1 deletion libs/sensors/include/PollingSensors.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
namespace Sensor {
class PollingSensors final : Sensor {
public:
PollingSensors();
PollingSensors(PinName moisture_in, PinName co2_in);

// float read() override;
//
Expand Down
5 changes: 4 additions & 1 deletion libs/sensors/src/PollingSensors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@

using namespace Sensor;

PollingSensors::PollingSensors() : moisture_in_adc(MOISTURE_IN), CO2_in_adc(CO2_IN) {}
PollingSensors::PollingSensors(PinName moisture_in, PinName co2_in) {
moisture_in_adc = MOISTURE_IN;
CO2_in_adc = CO2_IN;
}

// The function currently logs a status message. Can be changed to return just a float indicating the sensor value
float moisture_monitoring() {
Expand Down
7 changes: 1 addition & 6 deletions targets/TARGET_SCIENCE_REV2_2021/include/PinNames.h
Original file line number Diff line number Diff line change
Expand Up @@ -216,12 +216,7 @@ typedef enum {
SYS_JTCK_SWCLK = PA_14,
SYS_JTDI = PA_15,
SYS_JTDO_SWO = PB_3,
SYS_JTMS_SWDIO = PA_13,

/**** POLLING SENSOR pins ****/
/* TODO: CHANGE THE PIN NUMBERS ONCE SCHEMATIC IS READY*/
MOISTURE_IN = PC_7,
CO2_IN = PC_8,
SYS_JTMS_SWDIO = PA_13
} PinName;

#ifdef __cplusplus
Expand Down