README
¶
Jetson Nano
The Jetson Nano is ARM based single board computer with digital & PWM GPIO, and i2c interfaces built in.
The Gobot adaptor for the Jetson Nano should support Jetno Nano.
For more info about the Jetson Nano platform, click here.
How to Install
Please refer to the main README.md
We recommend updating to the latest jetson-nano OS when using the Jetson Nano, however Gobot should also support older versions of the OS, should your application require this.
How to Use
The pin numbering used by your Gobot program should match the way your board is labeled right on the board itself.
package main
import (
"time"
"gobot.io/x/gobot/v2"
"gobot.io/x/gobot/v2/drivers/gpio"
"gobot.io/x/gobot/v2/platforms/jetson"
)
func main() {
r := jetson.NewAdaptor()
led := gpio.NewLedDriver(r, "40")
work := func() {
gobot.Every(1*time.Second, func() {
led.Toggle()
})
}
robot := gobot.NewRobot("blinkBot",
[]gobot.Connection{r},
[]gobot.Device{led},
work,
)
robot.Start()
}
How to Connect
Compiling
Once you have compiled your code, you can upload your program and execute it on the Jetson Nano from your workstation using
the scp
and ssh
commands like this:
scp jetson-nano_blink jn@192.168.1.xxx:/home/jn/
ssh -t jn@192.168.1.xxx "./jetson-nano_blink"
Documentation
¶
Overview ¶
Package jetson contains the Gobot adaptor for the Jetson Nano.
For further information refer to Jetson README: https://github.com/hybridgroup/gobot/blob/master/platforms/jetson/README.md
Index ¶
- type Adaptor
- func (c *Adaptor) Connect() error
- func (c *Adaptor) Finalize() error
- func (c *Adaptor) Name() string
- func (c *Adaptor) PWMPin(pin string) (gobot.PWMPinner, error)
- func (c *Adaptor) PwmWrite(pin string, val byte) (err error)
- func (c *Adaptor) ServoWrite(pin string, angle byte) (err error)
- func (c *Adaptor) SetName(n string)
- type PWMPin
- func (p *PWMPin) DutyCycle() (uint32, error)
- func (p *PWMPin) Enabled() (bool, error)
- func (p *PWMPin) Export() error
- func (p *PWMPin) Period() (period uint32, err error)
- func (p *PWMPin) Polarity() (bool, error)
- func (p *PWMPin) SetDutyCycle(duty uint32) error
- func (p *PWMPin) SetEnabled(e bool) error
- func (p *PWMPin) SetPeriod(period uint32) error
- func (p *PWMPin) SetPolarity(bool) error
- func (p *PWMPin) Unexport() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adaptor ¶
type Adaptor struct { *adaptors.DigitalPinsAdaptor *adaptors.I2cBusAdaptor *adaptors.SpiBusAdaptor // contains filtered or unexported fields }
Adaptor is the Gobot adaptor for the Jetson Nano
func NewAdaptor ¶
NewAdaptor creates a Jetson Nano adaptor
Optional parameters:
adaptors.WithGpiodAccess(): use character device gpiod driver instead of sysfs adaptors.WithSpiGpioAccess(sclk, nss, mosi, miso): use GPIO's instead of /dev/spidev#.#
func (*Adaptor) PWMPin ¶
PWMPin returns a Jetson Nano. PWMPin which provides the gobot.PWMPinner interface
func (*Adaptor) ServoWrite ¶
ServoWrite writes a servo signal to the specified pin
type PWMPin ¶
type PWMPin struct {
// contains filtered or unexported fields
}
PWMPin is the Jetson Nano implementation of the PWMPinner interface. It uses gpio pwm.
func (*PWMPin) SetDutyCycle ¶
SetDutyCycle writes the duty cycle to the pin
func (*PWMPin) SetEnabled ¶
SetEnabled enables/disables the PWM pin
func (*PWMPin) SetPolarity ¶
SetPolarity does not do anything when using Jetson Nano