Skip to content

Install the Adafruit ServoKit Circuit Python library on the NVIDIA Jetson Nano Developer Kit

License

Notifications You must be signed in to change notification settings

Drone-FYP2021-PolyU-EIE/ServoKit

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ServoKit

Install the Adafruit ServoKit Circuit Python library on the NVIDIA Jetson Nano Developer Kit

Here are some convenience scripts to get servo motors working with the NVIDIA Jetson Nano Developer Kit using a PCA9685 breakout board over I2C.

installServoKit.sh

installServoKit.sh first sets the permissions for i2c and gpio so that they can be accessed in user space by the current user. Next, pip is installed. Finally, the adafruit-circuitpython-servokit library (along with its supporting libaries) are installed. To run the script:
$ ./installServoKit.sh

installGamePad.sh

Installs the approxeng.input gamepad input library using pip. This provides support for a variety of gamepad controllers. In particular, the Sony Dual Shock PS4 game controller. The script also installs a fix to the dual shock controller for the mapping of the right joystick.
$ ./installGamePad.sh

servoPlay.py

A simple example of controlling two servos with a game controller. For testing, two servos are connected to an Adafruit PCA9685 breakout board in positions 0 and 1. For testing, a Sony PS4 game controller was used.
$ python3 servoPlay.py

For the servo attached to port 0, the left gamepad joystick X direction controls the position of the servo. For the other servo, the right joystick in the Y direction controls the position.

Wiring

On the Jetson Nano, pins 27 (SDA) and 28 (SCL) on the J41 GPIO header are connected to I2C Bus 0. Pins 3 (SDA) and 4 (SCL) are connected to I2C Bus 1. The demo servoPlay.py uses pins 27 and 28.

Here's the wiring diagram:

Wiring Diagram

For user on python 3.6

If you get "Error:future feature annotations is not defined",you may specify the Adafruit-PlatformDetect version to 3.19.6.
Frist, remove the current version(anything > 3.19.6)
$sudo -H pip3 uninstall Adafruit-PlatformDetect
Then install the version(3.19.6)
$sudo -H pip3 install Adafruit-PlatformDetect==3.19.6
Now you install the adafruit-circuitpython-servokit :)
If you get "NameError: name 'I2C' is not defined"
$sudo -H pip3 install adafruit-circuitpython-typing

Releases

Current Work in Progress

About

Install the Adafruit ServoKit Circuit Python library on the NVIDIA Jetson Nano Developer Kit

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 83.6%
  • Shell 16.4%