diff --git a/src/main.cpp b/src/main.cpp index 08ad746..f182043 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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); } \ No newline at end of file