random checkin

This commit is contained in:
2024-07-04 19:12:32 +02:00
parent 31f9a27fe7
commit ef9271b3cb
3 changed files with 12 additions and 7 deletions

View File

@@ -3,8 +3,16 @@
XboxSeriesXControllerESP32_asukiaaa::Core xboxController; //"40:8e:2c:41:e4:eb"); //("a4:c1:38:38:e3:c0"); XboxSeriesXControllerESP32_asukiaaa::Core xboxController; //"40:8e:2c:41:e4:eb"); //("a4:c1:38:38:e3:c0");
uint32_t lastcontrollernotify = 0; uint32_t lastcontrollernotify = 0;
int joymin = 0;
int joymax = 0;
direction getdirection(int setpoint)
{
if(setpoint > )
}
void setup_controller() void setup_controller()
{ {
xboxController.begin(); xboxController.begin();
@@ -14,7 +22,6 @@ void setup_controller()
void loop_controller() void loop_controller()
{ {
xboxController.onLoop(); xboxController.onLoop();
if (xboxController.isConnected()) if (xboxController.isConnected())
{ {
@@ -38,11 +45,7 @@ void loop_controller()
log_i("received at %l", receivedAt); log_i("received at %l", receivedAt);
lastcontrollernotify = millis(); lastcontrollernotify = millis();
} }
handle_notify(((float)xboxController.xboxNotif.joyLVert / joystickMax *100), controlMotor("mainboom", direction::stop)
((float)xboxController.xboxNotif.joyRVert / joystickMax *100),
((float)xboxController.xboxNotif.joyLHori / joystickMax *100),
((float)xboxController.xboxNotif.joyRHori / joystickMax *100)
);
} }
} }
else else

View File

@@ -1,8 +1,10 @@
#include "Arduino.h" #include "Arduino.h"
#include "motors.h"
#include <XboxSeriesXControllerESP32_asukiaaa.hpp> #include <XboxSeriesXControllerESP32_asukiaaa.hpp>
#define CONTROLLERNOTIFY 1000 #define CONTROLLERNOTIFY 1000
void setup_controller(); void setup_controller();
void loop_controller(); void loop_controller();
void handle_notify(int motR, int motL, int motArm, int bucket); void handle_notify(int motR, int motL, int motArm, int bucket);

View File

@@ -34,7 +34,7 @@ enum direction
left, left,
right, right,
stop stop
} };
class motor class motor