Skip to content

Commit

Permalink
Bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
feanor-anglin committed Jun 15, 2021
1 parent 33d1eee commit 6f9f9f6
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions GetWired New Firmware/main.ino
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,16 @@ void setup() {

float Vcc = ReadVcc(); // mV

// POWER SENSOR
#if defined(POWER_SENSOR) && !defined(FOUR_RELAY)
PS.SetValues(PS_PIN, MVPERAMP, RECEIVER_VOLTAGE, MAX_CURRENT, POWER_MEASURING_TIME, Vcc);
#elif defined(POWER_SENSOR) && defined(FOUR_RELAY)
PS[RELAY_ID_1].SetValues(PS_PIN_1, MVPERAMP, RECEIVER_VOLTAGE, MAX_CURRENT, POWER_MEASURING_TIME, Vcc);
PS[RELAY_ID_2].SetValues(PS_PIN_2, MVPERAMP, RECEIVER_VOLTAGE, MAX_CURRENT, POWER_MEASURING_TIME, Vcc);
PS[RELAY_ID_3].SetValues(PS_PIN_3, MVPERAMP, RECEIVER_VOLTAGE, MAX_CURRENT, POWER_MEASURING_TIME, Vcc);
PS[RELAY_ID_4].SetValues(PS_PIN_4, MVPERAMP, RECEIVER_VOLTAGE, MAX_CURRENT, POWER_MEASURING_TIME, Vcc);
#endif

// OUTPUT
#ifdef DOUBLE_RELAY
IOD[RELAY_ID_1].SetValues(RELAY_OFF, 4, BUTTON_1, RELAY_1);
Expand Down Expand Up @@ -236,16 +246,6 @@ void setup() {
#endif
#endif

// POWER SENSOR
#if defined(POWER_SENSOR) && !defined(FOUR_RELAY)
PS.SetValues(PS_PIN, MVPERAMP, RECEIVER_VOLTAGE, MAX_CURRENT, POWER_MEASURING_TIME, Vcc);
#elif defined(POWER_SENSOR) && defined(FOUR_RELAY)
PS[RELAY_ID_1].SetValues(PS_PIN_1, MVPERAMP, RECEIVER_VOLTAGE, MAX_CURRENT, POWER_MEASURING_TIME, Vcc);
PS[RELAY_ID_2].SetValues(PS_PIN_2, MVPERAMP, RECEIVER_VOLTAGE, MAX_CURRENT, POWER_MEASURING_TIME, Vcc);
PS[RELAY_ID_3].SetValues(PS_PIN_3, MVPERAMP, RECEIVER_VOLTAGE, MAX_CURRENT, POWER_MEASURING_TIME, Vcc);
PS[RELAY_ID_4].SetValues(PS_PIN_4, MVPERAMP, RECEIVER_VOLTAGE, MAX_CURRENT, POWER_MEASURING_TIME, Vcc);
#endif

// EXTERNAL THERMOMETER
#ifdef EXTERNAL_TEMP
#ifdef DHT22
Expand Down Expand Up @@ -589,6 +589,8 @@ void receive(const MyMessage &message) {
int NewPosition = atoi(message.data);
NewPosition = NewPosition > 100 ? 100 : NewPosition;
NewPosition = NewPosition < 0 ? 0 : NewPosition;
RS.NewState = 2;
RSUpdate();
MovementTime = RS.ReadNewPosition(NewPosition);
}
#endif
Expand Down

0 comments on commit 6f9f9f6

Please sign in to comment.