Small edits
This commit is contained in:
parent
80f7eb25bf
commit
13a9539efe
|
|
@ -22,6 +22,7 @@ void initWiFi() {
|
|||
|
||||
void setup() {
|
||||
Serial.begin(115200);
|
||||
Serial.println("Begin!");
|
||||
initWiFi();
|
||||
motor.init();
|
||||
}
|
||||
|
|
@ -64,11 +65,14 @@ void get_control_inputs(float &throttle, int8_t &direction) {
|
|||
if (httpResponseCode == 200) {
|
||||
String payload = http.getString();
|
||||
parse_json(payload, throttle, direction);
|
||||
Serial.println("200");
|
||||
} else {
|
||||
Serial.println("Error communicating with webserver. Got HTTP status code:");
|
||||
Serial.println(httpResponseCode);
|
||||
}
|
||||
http.end();
|
||||
} else {
|
||||
Serial.println("WiFi not connected!");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -76,5 +80,5 @@ void loop() {
|
|||
get_control_inputs(throttle, direction);
|
||||
inertia(throttle, direction, motor_throttle, motor_direction);
|
||||
motor.move(motor_direction, (uint8_t) (motor_throttle * 127.0));
|
||||
delay(1);
|
||||
delay(25);
|
||||
}
|
||||
Loading…
Reference in New Issue