You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
opentrackpadcontroller/include/joystick_mixer.h

33 lines
540 B
C++

#ifndef JOYSTICK_MIXER_H
#define JOYSTICK_MIXER_H
#include <stdint.h>
class JoystickMixer
{
private:
float x, y;
float dx, dy;
uint32_t count;
int32_t usb_x;
int32_t usb_y;
int32_t usb_r;
public:
JoystickMixer() {}
JoystickMixer(int32_t usb_x, int32_t usb_y, int32_t usb_r);
void init(int32_t usb_x, int32_t usb_y, int32_t usb_r);
void mix(float x, float y);
void mix_delta(float dx, float dy);
void getXY(int32_t &x, int32_t &y);
};
#endif