Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class JoystickIn {
- private:
- int x_;
- int y_;
- public:
- int getX() const {
- return x_;
- }
- void setX(int x) {
- if (x != x_) {
- x_ = x;
- Serial.println("Nowy x: ".concat(x_));
- }
- }
- int getY() const {
- return y_;
- }
- void setY(int y) {
- if (y != y_) {
- y_ = y;
- Serial.println("Nowy y: ".concat(y_));
- }
- }
- };
- void setup() {
- Serial.begin(115200);
- }
- void loop() {
- JoystickIn *joystickIn = new JoystickIn();
- joystickIn->setX(2137);
- joystickIn->setY(69);
- delete joystickIn;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement