mirror of
https://github.com/eclipse/upm.git
synced 2025-07-01 17:31:13 +03:00
nunchuck: C port; FTI; C++ wraps C
Some API changes were made as well, see docs/apichanges.md. Signed-off-by: Jon Trulson <jtrulson@ics.com>
This commit is contained in:
@ -26,8 +26,8 @@ import time, sys, signal, atexit
|
||||
from upm import pyupm_nunchuck as upmNunchuck
|
||||
|
||||
def main():
|
||||
# Instantiate a nunchuck controller bus 0 on I2C
|
||||
myNunchuck = upmNunchuck.NUNCHUCK(0)
|
||||
# Instantiate a nunchuck controller bus 3 on I2C
|
||||
myNunchuck = upmNunchuck.NUNCHUCK(3)
|
||||
|
||||
## Exit handlers ##
|
||||
# This function stops python from printing a stacktrace when you hit control-C
|
||||
@ -43,12 +43,6 @@ def main():
|
||||
atexit.register(exitHandler)
|
||||
signal.signal(signal.SIGINT, SIGINTHandler)
|
||||
|
||||
# always do this first
|
||||
print("Initializing... ")
|
||||
if (not myNunchuck.init()):
|
||||
print("nunchuck->init() failed.")
|
||||
sys.exit(0);
|
||||
|
||||
def buttonStateStr(buttonState):
|
||||
return "pressed" if buttonState else "not pressed"
|
||||
|
||||
|
Reference in New Issue
Block a user