mirror of
https://github.com/eclipse/upm.git
synced 2025-03-24 01:10:22 +03:00
joystick12: Add comments to C++ example
Signed-off-by: Sarah Knepper <sarah.knepper@intel.com>
This commit is contained in:
parent
86cd7771cd
commit
83e2b3f800
@ -45,9 +45,11 @@ sig_handler(int signo)
|
|||||||
int
|
int
|
||||||
main(int argc, char **argv)
|
main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
// Instantiate a joystick on analog pins A0 and A1
|
||||||
sensor = new upm::Joystick12(0,1);
|
sensor = new upm::Joystick12(0,1);
|
||||||
signal(SIGINT, sig_handler);
|
signal(SIGINT, sig_handler);
|
||||||
|
|
||||||
|
// Print the X and Y input values every second
|
||||||
while (!is_running) {
|
while (!is_running) {
|
||||||
float x = sensor->getXInput();
|
float x = sensor->getXInput();
|
||||||
float y = sensor->getYInput();
|
float y = sensor->getYInput();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user