README ¶
Edison
The Intel Joule is a WiFi and Bluetooth enabled development platform for the Internet of Things.
For more info about the Intel Joule platform go to:
How to Install
You would normally install Go and Gobot on your workstation. Once installed, cross compile your program on your workstation, transfer the final executable to your Intel Joule, and run the program on the Intel Joule itself as documented here.
go get -d -u gobot.io/x/gobot/...
Setting up your Intel Joule
Everything you need to get started with the Joule is in the Intel Getting Started Guide located at:
https://intel.com/joule/getstarted
Don't forget to configure your Joule's wifi connection and update your Joule to the latest firmware image!
How To Use
package main
import (
"time"
"gobot.io/x/gobot"
"gobot.io/x/gobot/drivers/gpio"
"gobot.io/x/gobot/platforms/intel-iot/joule"
)
func main() {
e := joule.NewAdaptor()
led := gpio.NewLedDriver(e, "103")
work := func() {
gobot.Every(1*time.Second, func() {
led.Toggle()
})
}
robot := gobot.NewRobot("blinkBot",
[]gobot.Connection{e},
[]gobot.Device{led},
work,
)
robot.Start()
}
You can read the full API documentation online.
How to Connect
Compiling
Compile your Gobot program on your workstation like this:
$ GOARCH=386 GOOS=linux go build joule_blink.go
Once you have compiled your code, you can you can upload your program and execute it on the Intel Joule from your workstation using the scp
and ssh
commands like this:
$ scp joule_blink root@<IP of your device>:/home/root/
$ ssh -t root@<IP of your device> "./joule_blink"
At this point you should see one of the onboard LEDs blinking. Press control + c to exit.
To update the program after you made a change, you will need to scp it over once again and start it from the command line (via screen).
Pin Mapping
The Gobot pin mapping for the Intel Joule uses the same numbering as the MRAA library does, as documented here:
https://software.intel.com/en-us/pin-mapping-for-carrier-board-joule
Of special note are the pins that control the build-in LEDs, which are pins 100 thru 103, as used in the example above.
The i2c interfaces on the Intel Joule developer kit board require that you terminate the SDA & SCL lines using 2 10K resistors pulled up to the voltage used for the i2c device, for example 5V.
License
Copyright (c) 2014-2017 The Hybrid Group. Licensed under the Apache 2.0 license.
Documentation ¶
Overview ¶
Package joule contains the Gobot adaptor for the Intel Joule.
For further information refer to intel-iot README: https://github.com/hybridgroup/gobot/blob/master/platforms/intel-iot/joule/README.md
Package joule pwm implementation
Index ¶
- type Adaptor
- func (e *Adaptor) Connect() (err error)
- func (e *Adaptor) DigitalRead(pin string) (i int, err error)
- func (e *Adaptor) DigitalWrite(pin string, val byte) (err error)
- func (e *Adaptor) Finalize() (err error)
- func (e *Adaptor) GetConnection(address int, bus int) (connection i2c.Connection, err error)
- func (e *Adaptor) GetDefaultBus() int
- func (e *Adaptor) Name() string
- func (e *Adaptor) PwmWrite(pin string, val byte) (err error)
- func (e *Adaptor) SetName(n string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adaptor ¶ added in v1.0.0
type Adaptor struct {
// contains filtered or unexported fields
}
Adaptor represents an Intel Joule
func (*Adaptor) Connect ¶ added in v1.0.0
Connect initializes the Joule for use with the Arduino beakout board
func (*Adaptor) DigitalRead ¶ added in v1.0.0
DigitalRead reads digital value from pin
func (*Adaptor) DigitalWrite ¶ added in v1.0.0
DigitalWrite writes a value to the pin. Acceptable values are 1 or 0.
func (*Adaptor) Finalize ¶ added in v1.0.0
Finalize releases all i2c devices and exported digital and pwm pins.
func (*Adaptor) GetConnection ¶ added in v1.2.0
GetConnection returns an i2c connection to a device on a specified bus. Valid bus number is [0..2] which corresponds to /dev/i2c-0 through /dev/i2c-2.
func (*Adaptor) GetDefaultBus ¶ added in v1.2.0
GetDefaultBus returns the default i2c bus for this platform