Skip to content

Commit c0322a4

Browse files
Update RoboHeartPIDFittingExample.ino
1 parent 2d685ea commit c0322a4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

examples/RoboHeartPIDFittingExample/RoboHeartPIDFittingExample.ino

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ void setup()
134134
if (request->hasParam(PARAM_INPUT_1)) {
135135
inputMessage = request->getParam(PARAM_INPUT_1)->value();
136136
inputParam = PARAM_INPUT_1;
137+
Kp = atoi(inputMessage.c_str());
137138
}
138139
else {
139140
inputMessage = "No message sent";
@@ -152,6 +153,7 @@ void setup()
152153
// GET Kp value on <ESP_IP>/setKi?param_Ki=<inputMessage>
153154
if (request->hasParam(PARAM_INPUT_2)) {
154155
inputMessage = request->getParam(PARAM_INPUT_2)->value();
156+
Ki = atoi(inputMessage.c_str());
155157
inputParam = PARAM_INPUT_2;
156158
}
157159
else {
@@ -165,13 +167,14 @@ void setup()
165167
});
166168

167169
// Send a GET request to <ESP_IP>/setKd?param_Kd=<inputMessage>
168-
server.on("/setKi", HTTP_GET, [] (AsyncWebServerRequest *request) {
170+
server.on("/setKd", HTTP_GET, [] (AsyncWebServerRequest *request) {
169171
String inputMessage;
170172
String inputParam;
171173
// GET Kp value on <ESP_IP>/setKd?param_Kd=<inputMessage>
172174
if (request->hasParam(PARAM_INPUT_3)) {
173175
inputMessage = request->getParam(PARAM_INPUT_3)->value();
174176
inputParam = PARAM_INPUT_3;
177+
Kd = atoi(inputMessage.c_str());
175178
}
176179
else {
177180
inputMessage = "No message sent";

0 commit comments

Comments
 (0)