Skip to content

Instantly share code, notes, and snippets.

#include "Mouse.h"
// Joystick variables
const int xAxis = A0; // joystick X axis
const int yAxis = A1; // joystick Y axis
// parameters for reading the joystick:
int range = 12; // output range of X or Y movement
int responseDelay = 5; // response delay of the mouse, in ms
int threshold = range / 4; // resting threshold
/*********************************************
* Control panel for driving device.
* Objectives of this controller are:
* * Swap between two wheel drive and four wheel drive
* * Smooth driving
* * Speed control from separate input
* * Display the speed on the 4 digit output
* * Lights and light sequence when you press joystick button
* * Button that moves a servo - will be used for firing later
*/