feat: Adjust control command output mapping range
This commit is contained in:
@@ -14,7 +14,7 @@ ESP8266WebServer server(80);
|
|||||||
String deviceName;
|
String deviceName;
|
||||||
String topic;
|
String topic;
|
||||||
#define QOS_2 2
|
#define QOS_2 2
|
||||||
#define OUTPUT_PIN 4
|
#define OUTPUT_PIN D1
|
||||||
|
|
||||||
void (* resetFunc) (void) = 0;
|
void (* resetFunc) (void) = 0;
|
||||||
|
|
||||||
@@ -182,8 +182,8 @@ void onMqttMessage(int messageSize) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void processControlCommand(int64_t num) {
|
void processControlCommand(int64_t num) {
|
||||||
// Map the input value (0-100) to the output range (70-140)
|
// Map the input value (0-100) to the output range (60-140)
|
||||||
long mappedValue = map(num, 0, 100, 70, 140);
|
long mappedValue = map(num, 0, 100, 60, 140);
|
||||||
|
|
||||||
Serial.print("[MEGA] Received power: ");
|
Serial.print("[MEGA] Received power: ");
|
||||||
Serial.print(num);
|
Serial.print(num);
|
||||||
|
Reference in New Issue
Block a user