Update stable version 24/05/2025 #2
@ -1,11 +1,11 @@
|
|||||||
class CarSpotCOntroller {
|
class CarSpotController {
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int total_spots;
|
int total_spots;
|
||||||
int occupied_spots;
|
int occupied_spots;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CarSpotCOntroller(int default_total_spots) {
|
CarSpotController(int default_total_spots) {
|
||||||
this->set_total_spots(default_total_spots);
|
this->set_total_spots(default_total_spots);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
#import "Arduino.h"
|
#import "Arduino.h"
|
||||||
|
|
||||||
class JoySitkController {
|
class JoystickController {
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int pin_x;
|
int pin_x;
|
||||||
@ -9,7 +9,7 @@ class JoySitkController {
|
|||||||
int y = 1024 / 2;
|
int y = 1024 / 2;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
JoySitkController(int pin_x, int pin_y) {
|
JoystickController(int pin_x, int pin_y) {
|
||||||
this->set_pin_x(pin_x);
|
this->set_pin_x(pin_x);
|
||||||
this->set_pin_y(pin_y);
|
this->set_pin_y(pin_y);
|
||||||
}
|
}
|
||||||
@ -57,10 +57,12 @@ class JoySitkController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool is_moving_right(){
|
bool is_moving_right(){
|
||||||
|
this->read();
|
||||||
return this->get_x() < 512;
|
return this->get_x() < 512;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool is_moving_left(){
|
bool is_moving_left(){
|
||||||
|
this->read();
|
||||||
return this->get_x() > 512;
|
return this->get_x() > 512;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user