Skip to content

Instantly share code, notes, and snippets.

@jazzycamel
Created January 1, 2017 13:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jazzycamel/c9e1f320d8fc709fae89404ea0ce53cd to your computer and use it in GitHub Desktop.
Save jazzycamel/c9e1f320d8fc709fae89404ea0ce53cd to your computer and use it in GitHub Desktop.
Arduino PS/2 Mouse Buttons
#include "ps2.h"
PS2 mouse(6,5);
void setup(){
mouse.mouse_init();
}
void loop(){
char stat,x,y;
mouse.mouse_pos(stat,x,y);
bool leftButton=stat&0x01;
bool rightButton=stat &0x02;
bool middleButton=stat&0x04;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment