From 170acfa84b8556f2f007d196e1b66ee6b7e703e2 Mon Sep 17 00:00:00 2001 From: rafa Date: Sat, 24 May 2025 02:52:11 +0100 Subject: [PATCH] minor fixes --- code/CarSpotController.cpp | 4 ++-- code/JoyStickController.cpp | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/code/CarSpotController.cpp b/code/CarSpotController.cpp index 300cab5..44bf859 100644 --- a/code/CarSpotController.cpp +++ b/code/CarSpotController.cpp @@ -1,11 +1,11 @@ -class CarSpotCOntroller { +class CarSpotController { private: int total_spots; int occupied_spots; public: - CarSpotCOntroller(int default_total_spots) { + CarSpotController(int default_total_spots) { this->set_total_spots(default_total_spots); } diff --git a/code/JoyStickController.cpp b/code/JoyStickController.cpp index 44428be..5ece73c 100644 --- a/code/JoyStickController.cpp +++ b/code/JoyStickController.cpp @@ -1,6 +1,6 @@ #import "Arduino.h" -class JoySitkController { +class JoystickController { private: int pin_x; @@ -9,7 +9,7 @@ class JoySitkController { int y = 1024 / 2; public: - JoySitkController(int pin_x, int pin_y) { + JoystickController(int pin_x, int pin_y) { this->set_pin_x(pin_x); this->set_pin_y(pin_y); } @@ -57,10 +57,12 @@ class JoySitkController { } bool is_moving_right(){ + this->read(); return this->get_x() < 512; } bool is_moving_left(){ + this->read(); return this->get_x() > 512; }