joystick12: Add comments to C++ example

Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
This commit is contained in:
Sarah Knepper 2015-01-15 16:46:36 -08:00
parent 86cd7771cd
commit 83e2b3f800

View File

@ -45,9 +45,11 @@ sig_handler(int signo)
int
main(int argc, char **argv)
{
// Instantiate a joystick on analog pins A0 and A1
sensor = new upm::Joystick12(0,1);
signal(SIGINT, sig_handler);
// Print the X and Y input values every second
while (!is_running) {
float x = sensor->getXInput();
float y = sensor->getYInput();