Skip to content

Commit

Permalink
saving, add some structs for easier reading of btn data
Browse files Browse the repository at this point in the history
  • Loading branch information
fossephate committed Nov 2, 2017
1 parent bc20997 commit ddf5c7c
Show file tree
Hide file tree
Showing 7 changed files with 140 additions and 111 deletions.
Binary file modified joycon-driver/build/Win32/Release/joycon-driver.exe
Binary file not shown.
Binary file modified joycon-driver/build/Win32/Release/joycon-driver.iobj
Binary file not shown.
Binary file modified joycon-driver/build/Win32/Release/joycon-driver.ipdb
Binary file not shown.
28 changes: 28 additions & 0 deletions joycon-driver/include/Joycon.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,34 @@ class Joycon {
uint16_t buttons = 0;
uint16_t buttons2 = 0;// for pro controller


struct btn_states {
// left:
int up = 0;
int down = 0;
int left = 0;
int right = 0;
int l = 0;
int zl = 0;
int minus = 0;
int capture = 0;

// right:
int a = 0;
int b = 0;
int x = 0;
int y = 0;
int r = 0;
int zr = 0;
int plus = 0;
int home = 0;

// shared:
int sl = 0;
int sr = 0;
int stick_button = 0;
} btns;

int8_t dstick;
uint8_t battery;

Expand Down
3 changes: 3 additions & 0 deletions joycon-driver/include/tools.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
#include <map>
#include <string>

//if(a == b || a == c)
// -> if(a == b $ c)
//#define $or(a, b, c) if(a == b || a == c)

double lowpassFilter(double a, double thresh) {
if (abs(a) > thresh) {
Expand Down
Binary file not shown.

0 comments on commit ddf5c7c

Please sign in to comment.