Skip to content

Commit

Permalink
Merge pull request #23 from feanor-anglin/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
feanor-anglin authored Jun 15, 2021
2 parents c5bbd89 + 6f9f9f6 commit aff0a6b
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 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 Expand Up @@ -903,6 +905,7 @@ void RSUpdate() {
RS.NewState = 2;
RS.Movement();
send(msgRS3);
StartTime = 0;
StopTime = MovementTime;
}
}
Expand Down

0 comments on commit aff0a6b

Please sign in to comment.