From 44bb943b76b10b9e9ce5d753ca6f148bf5b283d4 Mon Sep 17 00:00:00 2001 From: Thomas Kohler Date: Mon, 15 May 2023 18:31:44 +0200 Subject: [PATCH 1/8] all: prepare for release v2.0.0 --- .chglog/CHANGELOG.gobot.md | 21 ++++++++++ .chglog/README.md | 42 ++++++++++++++++++++ .chglog/config.yml | 28 +++++++++++++ CHANGELOG.md | 80 ++++++++++++++++++++++++++++++++++++++ version.go | 2 +- 5 files changed, 172 insertions(+), 1 deletion(-) create mode 100755 .chglog/CHANGELOG.gobot.md create mode 100644 .chglog/README.md create mode 100755 .chglog/config.yml diff --git a/.chglog/CHANGELOG.gobot.md b/.chglog/CHANGELOG.gobot.md new file mode 100755 index 00000000..d227b809 --- /dev/null +++ b/.chglog/CHANGELOG.gobot.md @@ -0,0 +1,21 @@ +{{ range .Versions }} +{{ if .Tag.Previous }}{{ .Tag.Name }}{{ else }}{{ .Tag.Name }}{{ end }} +--- +{{ range .CommitGroups -}} +* **{{ .Title }}** + + {{ range .Commits -}} +* {{ if .Scope }}**>{{ .Scope }}:<** {{ end }}{{ .Subject }} + {{ end }} +{{ end -}} + +{{- if .NoteGroups -}} +{{ range .NoteGroups -}} +### {{ .Title }} + +{{ range .Notes }} +{{ .Body }} +{{ end }} +{{ end -}} +{{ end -}} +{{ end -}} \ No newline at end of file diff --git a/.chglog/README.md b/.chglog/README.md new file mode 100644 index 00000000..e5049008 --- /dev/null +++ b/.chglog/README.md @@ -0,0 +1,42 @@ +# Creating a changelog automatically + +## Install and configure tool + +We using , so refer to this side for installation instructions. + +## Usage + +Example for a new release "v2.0.0": + +```sh +git fetch --tags +git-chglog --no-case --next-tag 2.0.0 v1.16.0.. > .chglog/chglog_tmp.md +``` + +## Compare + +If unsure about any result of running git-chglog, just use: +`git log --since=2022-05-02 --pretty="- %s` + +## Manual adjustment + +Because there is no commit style guide yet, some manual work is needed to bring the items in the correct position. +Please refer to the current CHANGELOG.md to find the correct way. In general we try to use this style: + +* titles will be converted to lower case +* titles are lexical ordered +* each platform has its own title (e.g. **raspi**) +* fixes has the title **bugfix** +* title **api**, **drivers** or **example** is used for changes below related folder +* title **core** is used for changes of common code, e.g. utilities, system +* further special titles **build**, **docs** and **test** can be used + +## Finalization + +After all work is done in the temporary changelog file, the content can be moved to the real one and the "chglog_tmp.md" +file can be removed. + +## TODO's + +* introduce a commit style guide +* convert the changelog format to a more common style, see diff --git a/.chglog/config.yml b/.chglog/config.yml new file mode 100755 index 00000000..c08f4325 --- /dev/null +++ b/.chglog/config.yml @@ -0,0 +1,28 @@ +style: github +template: CHANGELOG.gobot.md +info: + title: CHANGELOG + repository_url: https://github.com/hybridgroup/gobot +options: + commits: + # filters: + # Type: + # - feat + # - fix + # - perf + # - refactor + commit_groups: + # title_maps: + # feat: Features + # fix: Bug Fixes + # perf: Performance Improvements + # refactor: Code Refactoring + header: + pattern: "^(\\w*)(?:\\(([\\w\\$\\.\\-\\*\\s]*)\\))?\\:?\\s(.*)$" + pattern_maps: + - Type + - Scope + - Subject + notes: + keywords: + - BREAKING CHANGE \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index a3efcdfa..9e11ec0a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,83 @@ +2.0.0 +--- +* **bugfix** + * I2C connection-bus caching and multiple device usage + * raspi pwm cache + * new pwm behaviour of tinkerboard + * jetson nano pwm feature + * examples and gopigo3 driver + * i2c.ReadBlockData(), Read_Data() in digispark and some small other fixes + * L3GD20H full scale range usage + * TH02 wrong register usage for read heater + * MPU6050 wrong initialize and reduced temperature resolution + * I2C driver typo: change HMC8553L to HMC5883L + * HMC5883L driver returns wrong values + * ads1x15 driver not working stable when reading multiple inputs + * Adafruit1109 driver shows bad characters after Halt() + * spi.SpiConnection is not gobot.Connection: missing method Connect + * Stopping and Starting Robot with Raspberry Pi Adapter and LED Driver - LED does not toggle on restart +* **ble** + * update to TinyGo Bluetooth package v0.6.0 release +* **build** + * update appveyor for go 1.19 + * switch to new cimg with golang 1.17 + * new home path for cimg + * check examples in CI ([#884](https://github.com/hybridgroup/gobot/issues/884)) + * add tests of more platforms to CI + * add configuration file for dependabot ([#907](https://github.com/hybridgroup/gobot/issues/907)) + * add PR template +* **core** + * use base driver for all I2C devices + * rename package "sysfs" to "system" + * go.mod to 1.17 and all modules incl. code upgrades +* **dji tello** + * Halt does not terminate all the related goroutines and may wait forever when it is called multiple times +* **docs** + * README for gpio, pwm, i2c and add example + * document fields for flight data +* **drivers** + * ADXL345 use ReadBlockData() + * CCS811 use ReadBlockData() + * bmxy8z use ReadBlockData + * CCS811 use ReadBlockData() + * BMP180, BMP280 BMP388 BME280 use ReadBlockData() + * MPL115A2 use ReadBlockData(), WriteByteData() + * add generic i2c driver + * add PCF8583 i2c driver + * add PCA9501 i2c driver + * add PCA953x i2c driver + * introduce I2cBusAdaptor for composition in platforms + * introduce generic i2c.Driver with example for digispark fix missing/wrong entries in README stabilize test + * add advanced digital pin options (pull, bias, drive, debounce, event) + * add support for new character device Kernel ABI for GPIO + * analog sensor driver to prevent ReadValue() to get float64 + * add read firmware version and DHT sensors for grovepi + * SPI using GPIO's plus driver for MFRC522 +* **jetson nano** + * add Jetson Nano adpator +* **joystick** + * add Xbox-One controller + * add configuration for Nintendo Switch controllers ([#903](https://github.com/hybridgroup/gobot/issues/903)) + * add Dualsense joystick (PlayStation 5) ([#880](https://github.com/hybridgroup/gobot/issues/880)) +* **nanopi neo** + * add platform +* **piblaster** + * add unused but missing interface implementation +* **radxa rock pi 4(c+)** + * add platform ([#902](https://github.com/hybridgroup/gobot/issues/902)) +* **test** + * increase some timings to make tests a little less fragile + * skip test TestNatsAdaptorFailedConnect when flaky + * stabilize "every"-test + * stabilize flaky utils_test + * stabilize firmata tests + * fix tests with sysfs mocks, ReadBlockData, WriteBlockData + * fix keyboard tests and exclude opencv + * fix PWM related read/write tests + * add check for examples in Makefile +* **BREAKING CANGES** + * some interfaces moved, see folder system and adaptor.go + 1.16.0 --- * **bugfix** diff --git a/version.go b/version.go index 4e84dd69..c238b944 100644 --- a/version.go +++ b/version.go @@ -1,6 +1,6 @@ package gobot -const version = "1.16.0" +const version = "2.0.0" // Version returns the current Gobot version func Version() string { From 4520e14aa670ac5c14a01778f424e8d2ae18bfc4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 16 May 2023 17:48:20 +0200 Subject: [PATCH 2/8] Bump golang.org/x/net from 0.1.0 to 0.10.0 (#915) --- go.mod | 4 ++-- go.sum | 14 ++++++++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 366c338c..09de1c9c 100644 --- a/go.mod +++ b/go.mod @@ -19,7 +19,7 @@ require ( github.com/warthog618/gpiod v0.8.0 go.bug.st/serial v1.4.0 gocv.io/x/gocv v0.31.0 - golang.org/x/net v0.1.0 + golang.org/x/net v0.10.0 periph.io/x/conn/v3 v3.6.10 periph.io/x/host/v3 v3.7.2 tinygo.org/x/bluetooth v0.6.0 @@ -46,7 +46,7 @@ require ( github.com/tinygo-org/cbgo v0.0.4 // indirect golang.org/x/crypto v0.1.0 // indirect golang.org/x/sync v0.1.0 // indirect - golang.org/x/sys v0.1.0 // indirect + golang.org/x/sys v0.8.0 // indirect google.golang.org/protobuf v1.28.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index b5ad1e54..7680be8b 100644 --- a/go.sum +++ b/go.sum @@ -245,6 +245,7 @@ golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvx golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -260,8 +261,10 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.1.0 h1:hZ/3BUoy5aId7sCpA/Tc5lt8DkFgdVS2onTpJsZ/fl0= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -297,16 +300,22 @@ golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/time v0.0.0-20190921001708-c4c64cad1fd0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -320,6 +329,7 @@ golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20200925191224-5d1fdd8fa346/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= golang.org/x/tools v0.1.11/go.mod h1:SgwaegtQh8clINPpECJMqnxLv9I09HLqnW3RMqW0CA4= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= From e3b00e6d3db2e65a5818338c24854ae6faf38906 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 16 May 2023 17:52:19 +0200 Subject: [PATCH 3/8] Bump github.com/gofrs/uuid from 4.3.0+incompatible to 4.4.0+incompatible (#914) --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 09de1c9c..f574d0c1 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/bmizerany/pat v0.0.0-20210406213842-e4b6760bdd6f github.com/donovanhide/eventsource v0.0.0-20210830082556-c59027999da0 github.com/eclipse/paho.mqtt.golang v1.4.1 - github.com/gofrs/uuid v4.3.0+incompatible + github.com/gofrs/uuid v4.4.0+incompatible github.com/hashicorp/go-multierror v1.1.1 github.com/hybridgroup/go-ardrone v0.0.0-20140402002621-b9750d8d7b78 github.com/hybridgroup/mjpeg v0.0.0-20140228234708-4680f319790e diff --git a/go.sum b/go.sum index 7680be8b..2e6cdd6e 100644 --- a/go.sum +++ b/go.sum @@ -51,8 +51,8 @@ github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/me github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/godbus/dbus/v5 v5.1.0 h1:4KLkAxT3aOY8Li4FRJe/KvhoNFFxo0m6fNuFUO8QJUk= github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gofrs/uuid v4.3.0+incompatible h1:CaSVZxm5B+7o45rtab4jC2G37WGYX1zQfuU2i6DSvnc= -github.com/gofrs/uuid v4.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= +github.com/gofrs/uuid v4.4.0+incompatible h1:3qXRTX8/NbyulANqlc0lchS1gqAVxRgsuW1YrTJupqA= +github.com/gofrs/uuid v4.4.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/gogo/protobuf v1.3.0/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= From 0d53d37f407fca808f727b57ec84a007f045be0c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 16 May 2023 17:55:05 +0200 Subject: [PATCH 4/8] Bump periph.io/x/conn/v3 from 3.6.10 to 3.7.0 (#913) --- go.mod | 2 +- go.sum | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index f574d0c1..dfc1db2c 100644 --- a/go.mod +++ b/go.mod @@ -20,7 +20,7 @@ require ( go.bug.st/serial v1.4.0 gocv.io/x/gocv v0.31.0 golang.org/x/net v0.10.0 - periph.io/x/conn/v3 v3.6.10 + periph.io/x/conn/v3 v3.7.0 periph.io/x/host/v3 v3.7.2 tinygo.org/x/bluetooth v0.6.0 ) diff --git a/go.sum b/go.sum index 2e6cdd6e..861159c3 100644 --- a/go.sum +++ b/go.sum @@ -93,6 +93,7 @@ github.com/hybridgroup/mjpeg v0.0.0-20140228234708-4680f319790e/go.mod h1:eagM80 github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/jonboulle/clockwork v0.2.2/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8= +github.com/jonboulle/clockwork v0.3.0/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= @@ -361,8 +362,9 @@ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -periph.io/x/conn/v3 v3.6.10 h1:gwU4ssmZkq1D/uz8hU91i/COo2c9DrRaS4PJZBbCd+c= periph.io/x/conn/v3 v3.6.10/go.mod h1:UqWNaPMosWmNCwtufoTSTTYhB2wXWsMRAJyo1PlxO4Q= +periph.io/x/conn/v3 v3.7.0 h1:f1EXLn4pkf7AEWwkol2gilCNZ0ElY+bxS4WE2PQXfrA= +periph.io/x/conn/v3 v3.7.0/go.mod h1:ypY7UVxgDbP9PJGwFSVelRRagxyXYfttVh7hJZUHEhg= periph.io/x/d2xx v0.0.4/go.mod h1:38Euaaj+s6l0faIRHh32a+PrjXvxFTFkPBEQI0TKg34= periph.io/x/host/v3 v3.7.2 h1:rCAUxkzy2xrzh18HP2AoVwTL/fEKqmcJ1icsZQGM58Q= periph.io/x/host/v3 v3.7.2/go.mod h1:nHMlzkPwmnHyP9Tn0I8FV+e0N3K7TjFXLZkIWzAicog= From 059905dfabe947766836122eb7ab858c82da6afd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 16 May 2023 18:00:24 +0200 Subject: [PATCH 5/8] build(deps): bump github.com/nats-io/nats-server/v2 from 2.1.0 to 2.7.4 (#906) --- go.mod | 2 +- go.sum | 38 +++++++++++++++++++++++++++++--------- 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/go.mod b/go.mod index dfc1db2c..b1cc2d36 100644 --- a/go.mod +++ b/go.mod @@ -36,7 +36,7 @@ require ( github.com/gorilla/websocket v1.5.0 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/muka/go-bluetooth v0.0.0-20220830075246-0746e3a1ea53 // indirect - github.com/nats-io/nats-server/v2 v2.1.0 // indirect + github.com/nats-io/nats-server/v2 v2.7.4 // indirect github.com/nats-io/nkeys v0.3.0 // indirect github.com/nats-io/nuid v1.0.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect diff --git a/go.sum b/go.sum index 861159c3..31a8f94e 100644 --- a/go.sum +++ b/go.sum @@ -62,11 +62,19 @@ github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfb github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.0 h1:LUVKkCeviFUMKqHa4tXIIij/lbhnMbP7Fn5wKdKkRh4= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -101,6 +109,8 @@ github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7V github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/compress v1.14.4 h1:eijASRJcobkVtSt81Olfh7JX43osYLwy5krOJo6YEu4= +github.com/klauspost/compress v1.14.4/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= @@ -112,6 +122,8 @@ github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/minio/highwayhash v1.0.2 h1:Aak5U0nElisjDCfPSG79Tgzkn2gl66NxOMspRrKnA/g= +github.com/minio/highwayhash v1.0.2/go.mod h1:BQskDq+xkJ12lmlUUi7U0M5Swg3EWR+dLTk+kldvVxY= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -121,15 +133,13 @@ github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3Rllmb github.com/muka/go-bluetooth v0.0.0-20220830075246-0746e3a1ea53 h1:zfLHhuGzmSbthZ00FfbEjgAHUOOj7NGiITojMTCFy6U= github.com/muka/go-bluetooth v0.0.0-20220830075246-0746e3a1ea53/go.mod h1:dMCjicU6vRBk34dqOmIZm0aod6gUwZXOXzBROqGous0= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/nats-io/jwt v0.3.0 h1:xdnzwFETV++jNc4W1mw//qFyJGb2ABOombmZJQS4+Qo= -github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= -github.com/nats-io/nats-server/v2 v2.1.0 h1:Yi0+ZhRPtPAGeIxFn5erIeJIV9wXA+JznfSxK621Fbk= -github.com/nats-io/nats-server/v2 v2.1.0/go.mod h1:r5y0WgCag0dTj/qiHkHrXAcKQ/f5GMOZaEGdoxxnJ4I= -github.com/nats-io/nats.go v1.8.1/go.mod h1:BrFz9vVn0fU3AcH9Vn4Kd7W0NpJ651tD5omQ3M8LwxM= +github.com/nats-io/jwt/v2 v2.2.1-0.20220113022732-58e87895b296 h1:vU9tpM3apjYlLLeY23zRWJ9Zktr5jp+mloR942LEOpY= +github.com/nats-io/jwt/v2 v2.2.1-0.20220113022732-58e87895b296/go.mod h1:0tqz9Hlu6bCBFLWAASKhE5vUA4c24L9KPUUgvwumE/k= +github.com/nats-io/nats-server/v2 v2.7.4 h1:c+BZJ3rGzUKCBIM4IXO8uNT2u1vajGbD1kPA6wqCEaM= +github.com/nats-io/nats-server/v2 v2.7.4/go.mod h1:1vZ2Nijh8tcyNe8BDVyTviCd9NYzRbubQYiEHsvOQWc= +github.com/nats-io/nats.go v1.13.1-0.20220308171302-2f2f6968e98d/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w= github.com/nats-io/nats.go v1.18.0 h1:o480Ao6kuSSFyJO75rGTXCEPj7LGkY84C1Ye+Uhm4c0= github.com/nats-io/nats.go v1.18.0/go.mod h1:BPko4oXsySz4aSWeFgOHLZs3G4Jq4ZAyE6/zMCxRT6w= -github.com/nats-io/nkeys v0.0.2/go.mod h1:dab7URMsZm6Z/jp9Z5UGa87Uutgc2mVpXLC4B7TDb/4= -github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= github.com/nats-io/nkeys v0.3.0 h1:cgM5tL53EvYRU+2YLXIK0G2mJtK12Ft9oeooSZMA2G8= github.com/nats-io/nkeys v0.3.0/go.mod h1:gvUNGjVcM2IPr5rCsRsC6Wb3Hr2CQAm08dsxtV6A5y4= github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw= @@ -232,11 +242,11 @@ gocv.io/x/gocv v0.31.0/go.mod h1:oc6FvfYqfBp99p+yOEzs9tbYF9gOrAQSeL/dyIPefJU= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210314154223-e6e6c4f2bb5b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20220112180741-5e0467b6c7ce/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.1.0 h1:MDRAIl0xIo9Io2xV565hzXHw3zVseKrJKodhohM5CjU= golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -261,6 +271,7 @@ golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= @@ -281,10 +292,10 @@ golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190130150945-aca44879d564/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190927073244-c990c680b611/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -296,6 +307,7 @@ golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220111092808-5a964db01320/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -318,6 +330,8 @@ golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/time v0.0.0-20190921001708-c4c64cad1fd0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11 h1:GZokNIeuVkl3aZHJchRrr13WCsols02MLUcz1U9is6M= +golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -342,6 +356,12 @@ google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98 google.golang.org/genproto v0.0.0-20190927181202-20e1ac93f88c/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.24.0/go.mod h1:XDChyiUovWa60DnaeDeZmSW86xtLtjtZbwvSiRnRtcA= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= From 6f8cff58ccf27e17dcbad55659e5c2ad6cab32fa Mon Sep 17 00:00:00 2001 From: Thomas Kohler Date: Thu, 18 May 2023 15:47:14 +0200 Subject: [PATCH 6/8] Add(build): golangci-lint workflow configuration (#916) in addition add local linter settings, and adjust docs --- .github/pull_request_template.md | 8 +++-- .github/workflows/golangci-lint.yml | 46 ++++++++++++++++++++++++ .golangci.yml | 43 ++++++++++++++++++++++ CONTRIBUTING.md | 55 +++++++++++++++++------------ Makefile | 8 +++-- 5 files changed, 132 insertions(+), 28 deletions(-) create mode 100644 .github/workflows/golangci-lint.yml create mode 100644 .golangci.yml diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index f41e2da5..d75ababe 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -4,18 +4,20 @@ ## Manual test -* OS and Version (Win/Mac/Linux): -* Adaptor(s) and/or driver(s): +- OS and Version (Win/Mac/Linux): +- Adaptor(s) and/or driver(s): ... ## Checklist - [ ] The PR's target branch is 'hybridgroup:dev' -- [ ] I have performed a self-review of my own code - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes (e.g. by run `make test`) +- [ ] No linter errors exist locally (e.g. by run `make fmt_check`) +- [ ] I have performed a self-review of my own code If this is a new driver or adaptor: + - [ ] I have added the name to the corresponding README.md - [ ] I have added an example to see how to setup and use it - [ ] I have checked or build at least my new example (e.g. by run `make examples_check`) diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml new file mode 100644 index 00000000..9c94c93a --- /dev/null +++ b/.github/workflows/golangci-lint.yml @@ -0,0 +1,46 @@ +name: golangci-lint +on: + push: + tags: + - v* + branches: + - dev + pull_request: +permissions: + contents: read + # Optional: allow read access to pull request. Use with `only-new-issues` option. + # pull-requests: read +jobs: + golangci: + name: lint + runs-on: ubuntu-latest + steps: + - uses: actions/setup-go@v4 + with: + go-version: '1.17' + cache: false + - uses: actions/checkout@v3 + - name: golangci-lint + uses: golangci/golangci-lint-action@v3 + with: + # Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version + version: v1.52.2 + + # Optional: working directory, useful for monorepos + # working-directory: somedir + + # Optional: golangci-lint command line arguments. + # args: --issues-exit-code=0 + + # Optional: show only new issues if it's a pull request. The default value is `false`. + # only-new-issues: true + + # Optional: if set to true then the all caching functionality will be complete disabled, + # takes precedence over all other caching options. + # skip-cache: true + + # Optional: if set to true then the action don't cache or restore ~/go/pkg. + # skip-pkg-cache: true + + # Optional: if set to true then the action don't cache or restore ~/.cache/go-build. + # skip-build-cache: true diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 00000000..d10702b8 --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,43 @@ +run: + # Timeout for analysis, e.g. 30s, 5m. + # gobot is very expensive, on a machine with heavy load it takes some minutes + # for first run or after empty the cache by 'golangci-lint cache clean' + # Default: 1m + timeout: 5m + + # If set we pass it to "go list -mod={option}". From "go help modules": + # If invoked with -mod=readonly, the go command is disallowed from the implicit + # automatic updating of go.mod described above. Instead, it fails when any changes + # to go.mod are needed. This setting is most useful to check that go.mod does + # not need updates, such as in a continuous integration and testing system. + # If invoked with -mod=vendor, the go command assumes that the vendor + # directory holds the correct copies of dependencies and ignores + # the dependency descriptions in go.mod. + # + # Allowed values: readonly|vendor|mod + # By default, it isn't set. + modules-download-mode: readonly + + # Enables skipping of directories: + # - vendor$, third_party$, testdata$, examples$, Godeps$, builtin$ + # Default: true + skip-dirs-use-default: false + + # note: examples will be currently omitted by the build tag + skip-dirs: + - platforms/opencv + +linters: + # Enable specific linter + # https://golangci-lint.run/usage/linters/#enabled-by-default + # note: typecheck can not be disabled, it is used to check code compilation + # + # TODO: this default linters needs to be disabled to run successfully, we have to fix + # all issues step by step to enable at least the default linters + disable: + - errcheck + - gosimple + #- govet + - ineffassign + - staticcheck + - unused diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d2e72c50..69fa1256 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,7 @@ # Contributing to Gobot ## Target Branch + **Please open all non-hotfix PRs against the `dev` branch!** Gobot follows a ["git flow"](http://nvie.com/posts/a-successful-git-branching-model/)-style model for managing development. @@ -19,23 +20,27 @@ This document will guide you through the contribution process. What do you want to contribute? -- I want to otherwise correct or improve the docs or examples -- I want to report a bug -- I want to add some feature or functionality to an existing hardware platform -- I want to add support for a new hardware platform +* I want to otherwise correct or improve the docs or examples +* I want to report a bug +* I want to add some feature or functionality to an existing hardware platform +* I want to add support for a new hardware platform Descriptions for each of these will eventually be provided below. ## General Guidelines -* All active development is in the `dev` branch. New or updated features must be added to the `dev` branch. Hotfixes will be considered on the `master` branch in situations where it does not alter behaviour or features, only fixes a bug. +* All active development is in the `dev` branch. New or updated features must be added to the `dev` branch. Hotfixes + will be considered on the `master` branch in situations where it does not alter behavior or features, only fixes a bug. * All patches must be provided under the Apache 2.0 License -* Please use the -S option in git to "sign off" that the commit is your work and you are providing it under the Apache 2.0 License +* Please use the -S option in git to "sign off" that the commit is your work and you are providing it under the + Apache 2.0 License * Submit a Github Pull Request to the appropriate branch and ideally discuss the changes with us in IRC. * We will look at the patch, test it out, and give you feedback. -* Avoid doing minor whitespace changes, renamings, etc. along with merged content. These will be done by the maintainers from time to time but they can complicate merges and should be done seperately. +* Avoid doing minor whitespace changes, renamings, etc. along with merged content. These will be done by the maintainers + from time to time but they can complicate merges and should be done separately. * Take care to maintain the existing coding style. -* `golint` and `go fmt` your code. +* `golangci-lint` your code, see [instruction for local installation](https://golangci-lint.run/usage/install/#local-installation) +* `go fmt` your code (with the go version of go.mod) * Add unit tests for any new or changed functionality. * All pull requests should be "fast forward" * If there are commits after yours use “git rebase -i ” @@ -43,6 +48,7 @@ Descriptions for each of these will eventually be provided below. * For git help see [progit](http://git-scm.com/book) which is an awesome (and free) book on git ## Creating Pull Requests + Because Gobot makes use of self-referencing import paths, you will want to implement the local copy of your fork as a remote on your copy of the original Gobot repo. Katrina Owen has [an excellent post on this workflow](https://splice.com/blog/contributing-open-source-git-repositories-go/). @@ -53,34 +59,38 @@ The basics are as follows: 2. `go get` the upstream repo and set it up as the `upstream` remote and your own repo as the `origin` remote: -`go get gobot.io/x/gobot` -`cd $GOPATH/src/gobot.io/x/gobot` -`git remote rename origin upstream` -`git remote add origin git@github.com/YOUR_GITHUB_NAME/gobot` + `go get gobot.io/x/gobot` + `cd $GOPATH/src/gobot.io/x/gobot` + `git remote rename origin upstream` + `git remote add origin git@github.com/YOUR_GITHUB_NAME/gobot` -All import paths should now work fine assuming that you've got the -proper branch checked out. + All import paths should now work fine assuming that you've got the + proper branch checked out. -3. Get all the needed gobot's dependencies each of them at their needed version. Gobot uses [dep (Dependency management for Go)](https://golang.github.io/dep/) to manage the project's dependencies. To get all the correct dependencies: +3. Get all the needed gobot's dependencies each of them at their needed version. Gobot uses + [dep (Dependency management for Go)](https://golang.github.io/dep/) to manage the project's dependencies. To get all + the correct dependencies: -* Install dep tool. Follow the dep [installation](https://golang.github.io/dep/docs/installation.html) instructions in case you don't have it already installed. -* `cd $GOPATH/src/gobot.io/x/gobot` -* `dep ensure` will fetch all the dependencies at their needed version. + * Install dep tool. Follow the dep [installation](https://golang.github.io/dep/docs/installation.html) instructions in + case you don't have it already installed. + * `cd $GOPATH/src/gobot.io/x/gobot` + * `dep ensure` will fetch all the dependencies at their needed version. ## Landing Pull Requests + (This is for committers only. If you are unsure whether you are a committer, you are not.) 1. Set the contributor's fork as an upstream on your checkout -`git remote add contrib1 https://github.com/contrib1/gobot` + `git remote add contrib1 https://github.com/contrib1/gobot` 2. Fetch the contributor's repo -`git fetch contrib1` + `git fetch contrib1` 3. Checkout a copy of the PR branch -`git checkout pr-1234 --track contrib1/branch-for-pr-1234` + `git checkout pr-1234 --track contrib1/branch-for-pr-1234` 4. Review the PR as normal @@ -104,7 +114,8 @@ By making a contribution to this project, I certify that: ## Code of Conduct -Gobot is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms. [You can read about it here](CODE_OF_CONDUCT.md). +Gobot is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms. +[You can read about it here](CODE_OF_CONDUCT.md). ## Origins diff --git a/Makefile b/Makefile index 7dba1b05..5ba96901 100644 --- a/Makefile +++ b/Makefile @@ -2,10 +2,12 @@ ALL_EXAMPLES := $(shell grep -l -r --include "*.go" 'build example' ./) # prevent examples with gocv (opencv) dependencies EXAMPLES_NO_GOCV := $(shell grep -L 'gocv' $(ALL_EXAMPLES)) +# prevent examples with joystick (sdl2) dependencies +EXAMPLES_NO_JOYSTICK := $(shell grep -L 'joystick' $(ALL_EXAMPLES)) # prevent examples with joystick (sdl2) and gocv (opencv) dependencies EXAMPLES_NO_GOCV_JOYSTICK := $(shell grep -L 'joystick' $$(grep -L 'gocv' $(EXAMPLES_NO_GOCV))) # used examples -EXAMPLES := $(EXAMPLES_NO_GOCV) +EXAMPLES := $(EXAMPLES_NO_GOCV_JOYSTICK) .PHONY: test test_race test_cover robeaux version_check fmt_check fmt_fix examples examples_check $(EXAMPLES) @@ -54,8 +56,8 @@ version_check: # Check for bad code style and other issues fmt_check: - gofmt -l ./ - go vet ./... + gofmt -l ./ + golangci-lint run -v # Fix bad code style (will only be executed, on version match) fmt_fix: version_check From fcdf286f1d9120681796e5084aaa5dd2659a07da Mon Sep 17 00:00:00 2001 From: Thomas Kohler Date: Fri, 19 May 2023 14:16:22 +0200 Subject: [PATCH 7/8] Fix(build): linter findings of "gosimple", "govet" and "staticcheck" (#917) Fix also encoder and dps overflow in gopigo3 "GetMotorStatus()". Problem found by "staticcheck". --- .github/workflows/golangci-lint.yml | 3 +- .golangci.yml | 24 ++++++++++-- api/api.go | 6 +-- api/api_test.go | 2 +- cli/generate.go | 10 ++--- commander.go | 7 ++-- drivers/common/mfrc522/mfrc522_pcd.go | 3 ++ drivers/gpio/button_driver_test.go | 4 +- drivers/gpio/pir_motion_driver_test.go | 2 +- drivers/gpio/servo_driver.go | 2 +- drivers/gpio/stepper_driver.go | 6 +-- drivers/gpio/stepper_driver_test.go | 2 +- drivers/i2c/ads1x15_driver.go | 4 -- drivers/i2c/ads1x15_driver_1015_test.go | 2 +- drivers/i2c/ads1x15_driver_1115_test.go | 2 +- drivers/i2c/ads1x15_driver_test.go | 4 +- drivers/i2c/blinkm_driver_test.go | 4 +- drivers/i2c/ccs811_driver.go | 8 ++-- drivers/i2c/drv2605l_driver.go | 14 +++---- drivers/i2c/grovepi_driver.go | 2 +- drivers/i2c/i2c_connection.go | 2 +- drivers/i2c/mcp23017_driver_test.go | 6 +-- drivers/i2c/sht2x_driver.go | 20 +++++----- drivers/i2c/sht3x_driver.go | 6 ++- drivers/i2c/sht3x_driver_test.go | 4 +- drivers/i2c/tsl2561_driver.go | 11 ++---- drivers/spi/helpers_test.go | 2 +- drivers/spi/ssd1306_driver.go | 3 -- eventer.go | 20 ++++------ platforms/adaptors/digitalpinsadaptor_test.go | 2 +- platforms/adaptors/pwmpinsadaptor_test.go | 10 ++--- platforms/audio/audio_driver.go | 2 +- platforms/beaglebone/beaglebone_adaptor.go | 13 ++++--- .../beaglebone/beaglebone_adaptor_test.go | 8 ++-- platforms/ble/ble_client_adaptor.go | 10 ++--- platforms/dexter/gopigo3/driver.go | 22 ++++------- platforms/digispark/digispark_i2c_test.go | 38 +++++++++---------- platforms/firmata/firmata_adaptor.go | 6 +-- platforms/intel-iot/curie/imu_driver_test.go | 28 +++++++------- platforms/intel-iot/edison/edison_adaptor.go | 4 +- .../intel-iot/edison/edison_adaptor_test.go | 28 +++++++------- .../intel-iot/joule/joule_adaptor_test.go | 4 +- platforms/jetson/pwm_pin.go | 2 +- platforms/jetson/pwm_pin_test.go | 4 +- platforms/joystick/joystick_driver.go | 2 +- platforms/mavlink/mavlink_driver_test.go | 6 +-- .../microbit/accelerometer_driver_test.go | 2 +- platforms/microbit/button_driver_test.go | 2 +- platforms/microbit/helpers_test.go | 5 +-- .../microbit/magnetometer_driver_test.go | 2 +- platforms/microbit/temperature_driver_test.go | 2 +- platforms/mqtt/mqtt_adaptor.go | 11 +----- platforms/nanopi/nanopi_adaptor.go | 2 +- platforms/neurosky/neurosky_driver_test.go | 2 +- platforms/particle/adaptor.go | 17 ++++----- platforms/particle/adaptor_test.go | 4 +- platforms/raspi/pwm_pin.go | 2 +- platforms/raspi/pwm_pin_test.go | 4 +- platforms/raspi/raspi_adaptor_test.go | 2 +- platforms/tinkerboard/adaptor.go | 2 +- platforms/upboard/up2/adaptor.go | 7 ++-- robot_work_test.go | 2 +- system/digitalpin_gpiod.go | 4 +- system/digitalpin_mock.go | 1 - system/digitalpin_sysfs.go | 3 +- system/digitalpin_sysfs_test.go | 2 +- system/fs_mock.go | 14 +++---- system/fs_mock_test.go | 4 +- system/fs_test.go | 2 +- system/i2c_device_test.go | 2 +- system/pwmpin_sysfs.go | 6 +-- utils.go | 6 +-- 72 files changed, 233 insertions(+), 253 deletions(-) diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 9c94c93a..1d1e2eec 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -30,7 +30,8 @@ jobs: # working-directory: somedir # Optional: golangci-lint command line arguments. - # args: --issues-exit-code=0 + # mostly there is no problem locally, but on server: "could not import C (cgo preprocessing failed) (typecheck)" + args: --skip-files platforms/digispark/littleWire.go # Optional: show only new issues if it's a pull request. The default value is `false`. # only-new-issues: true diff --git a/.golangci.yml b/.golangci.yml index d10702b8..6ab449cb 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -36,8 +36,26 @@ linters: # all issues step by step to enable at least the default linters disable: - errcheck - - gosimple - #- govet - ineffassign - - staticcheck + #- staticcheck - unused + + enable: + - nolintlint + +linters-settings: + nolintlint: + # Enable to require an explanation of nonzero length after each nolint directive. + # Default: false + require-explanation: true + # Enable to require nolint directives to mention the specific linter being suppressed. + # Default: false + require-specific: true + + revive: + rules: + # https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unexported-return + # disable this rule, because sometimes it has its justification + - name: unexported-return + severity: warning + disabled: true diff --git a/api/api.go b/api/api.go index 281dd088..26b14a16 100644 --- a/api/api.go +++ b/api/api.go @@ -109,7 +109,6 @@ func (a *API) Start() { // StartWithoutDefaults initializes the api without setting up the default routes. // Good for custom web interfaces. -// func (a *API) StartWithoutDefaults() { a.start(a) } @@ -117,7 +116,6 @@ func (a *API) StartWithoutDefaults() { // AddC3PIORoutes adds all of the standard C3PIO routes to the API. // For more information, please see: // http://cppp.io/ -// func (a *API) AddC3PIORoutes() { mcpCommandRoute := "/api/commands/:command" robotDeviceCommandRoute := "/api/robots/:robot/devices/:device/commands/:command" @@ -250,10 +248,8 @@ func (a *API) robotDevice(res http.ResponseWriter, req *http.Request) { func (a *API) robotDeviceEvent(res http.ResponseWriter, req *http.Request) { f, _ := res.(http.Flusher) - c, _ := res.(http.CloseNotifier) dataChan := make(chan string) - closer := c.CloseNotify() res.Header().Set("Content-Type", "text/event-stream") res.Header().Set("Cache-Control", "no-cache") @@ -275,7 +271,7 @@ func (a *API) robotDeviceEvent(res http.ResponseWriter, req *http.Request) { case data := <-dataChan: fmt.Fprintf(res, "data: %v\n\n", data) f.Flush() - case <-closer: + case <-req.Context().Done(): log.Println("Closing connection") return } diff --git a/api/api_test.go b/api/api_test.go index 77e51aa6..d08b40fa 100644 --- a/api/api_test.go +++ b/api/api_test.go @@ -81,7 +81,7 @@ func TestIndex(t *testing.T) { a.ServeHTTP(response, request) gobottest.Assert(t, http.StatusMovedPermanently, response.Code) - gobottest.Assert(t, "/index.html", response.HeaderMap["Location"][0]) + gobottest.Assert(t, "/index.html", response.Header()["Location"][0]) } func TestMcp(t *testing.T) { diff --git a/cli/generate.go b/cli/generate.go index 073a79da..82a2928c 100644 --- a/cli/generate.go +++ b/cli/generate.go @@ -30,7 +30,7 @@ func Generate() cli.Command { valid = true } } - if valid == false { + if !valid { fmt.Println("Invalid/no subcommand supplied.") fmt.Println("Usage:") fmt.Println(" gobot generate adaptor [package] # generate a new Gobot adaptor") @@ -102,7 +102,7 @@ func generate(c config, file string, tmpl string) error { fmt.Println("Creating", fileLocation) f, err := os.Create(fileLocation) - defer f.Close() + defer f.Close() //nolint:staticcheck // for historical reasons if err != nil { return err } @@ -149,11 +149,11 @@ func generatePlatform(c config) error { c.dir = dir - if exp, err := ioutil.ReadFile(exampleDir + "/main.go"); err != nil { + exp, err := ioutil.ReadFile(exampleDir + "/main.go") + if err != nil { return err - } else { - c.Example = string(exp) } + c.Example = string(exp) return generate(c, "README.md", readme()) } diff --git a/commander.go b/commander.go index 926c55b6..4b1f4a57 100644 --- a/commander.go +++ b/commander.go @@ -22,10 +22,9 @@ func NewCommander() Commander { } } -// Command returns the command interface whene passed a valid command name -func (c *commander) Command(name string) (command func(map[string]interface{}) interface{}) { - command, _ = c.commands[name] - return +// Command returns the command interface when passed a valid command name +func (c *commander) Command(name string) func(map[string]interface{}) interface{} { + return c.commands[name] } // Commands returns the entire map of valid commands diff --git a/drivers/common/mfrc522/mfrc522_pcd.go b/drivers/common/mfrc522/mfrc522_pcd.go index 46df052e..5f874639 100644 --- a/drivers/common/mfrc522/mfrc522_pcd.go +++ b/drivers/common/mfrc522/mfrc522_pcd.go @@ -328,6 +328,9 @@ func (d *MFRC522Common) writeFifo(fifoData []byte) error { func (d *MFRC522Common) readFifo(backData []byte) (uint8, error) { n, err := d.readByteData(regFIFOLevel) // Number of bytes in the FIFO + if err != nil { + return 0, err + } if n > uint8(len(backData)) { return 0, fmt.Errorf("more data in FIFO (%d) than expected (%d)", n, len(backData)) } diff --git a/drivers/gpio/button_driver_test.go b/drivers/gpio/button_driver_test.go index 2a56ac93..fa3685e6 100644 --- a/drivers/gpio/button_driver_test.go +++ b/drivers/gpio/button_driver_test.go @@ -35,7 +35,7 @@ func TestButtonDriver(t *testing.T) { } func TestButtonDriverStart(t *testing.T) { - sem := make(chan bool, 0) + sem := make(chan bool) a := newGpioTestAdaptor() d := NewButtonDriver(a, "1") @@ -107,7 +107,7 @@ func TestButtonDriverStart(t *testing.T) { } func TestButtonDriverDefaultState(t *testing.T) { - sem := make(chan bool, 0) + sem := make(chan bool) a := newGpioTestAdaptor() d := NewButtonDriver(a, "1") d.DefaultState = 1 diff --git a/drivers/gpio/pir_motion_driver_test.go b/drivers/gpio/pir_motion_driver_test.go index c11caf4b..5aa33c8f 100644 --- a/drivers/gpio/pir_motion_driver_test.go +++ b/drivers/gpio/pir_motion_driver_test.go @@ -35,7 +35,7 @@ func TestPIRMotionDriver(t *testing.T) { } func TestPIRMotionDriverStart(t *testing.T) { - sem := make(chan bool, 0) + sem := make(chan bool) a := newGpioTestAdaptor() d := NewPIRMotionDriver(a, "1") diff --git a/drivers/gpio/servo_driver.go b/drivers/gpio/servo_driver.go index 0ab4fa13..08ed82a5 100644 --- a/drivers/gpio/servo_driver.go +++ b/drivers/gpio/servo_driver.go @@ -65,7 +65,7 @@ func (s *ServoDriver) Halt() (err error) { return } // Move sets the servo to the specified angle. Acceptable angles are 0-180 func (s *ServoDriver) Move(angle uint8) (err error) { - if !(angle >= 0 && angle <= 180) { + if angle > 180 { return ErrServoOutOfRange } s.CurrentAngle = angle diff --git a/drivers/gpio/stepper_driver.go b/drivers/gpio/stepper_driver.go index 6a6b0ef4..8810b024 100644 --- a/drivers/gpio/stepper_driver.go +++ b/drivers/gpio/stepper_driver.go @@ -111,7 +111,7 @@ func (s *StepperDriver) Start() (err error) { return } // Run continuously runs the stepper func (s *StepperDriver) Run() (err error) { //halt if already moving - if s.moving == true { + if s.moving { s.Halt() } @@ -123,7 +123,7 @@ func (s *StepperDriver) Run() (err error) { go func() { for { - if s.moving == false { + if !s.moving { break } s.step() @@ -191,7 +191,7 @@ func (s *StepperDriver) Move(stepsToMove int) error { return s.Halt() } - if s.moving == true { + if s.moving { //stop previous motion s.Halt() } diff --git a/drivers/gpio/stepper_driver_test.go b/drivers/gpio/stepper_driver_test.go index a894a2c6..44d2d17a 100644 --- a/drivers/gpio/stepper_driver_test.go +++ b/drivers/gpio/stepper_driver_test.go @@ -58,7 +58,7 @@ func TestStepperDriverDefaultDirection(t *testing.T) { func TestStepperDriverInvalidDirection(t *testing.T) { d := initStepperMotorDriver() err := d.SetDirection("reverse") - gobottest.Assert(t, err.(error), errors.New("Invalid direction. Value should be forward or backward")) + gobottest.Assert(t, err, errors.New("Invalid direction. Value should be forward or backward")) } func TestStepperDriverMoveForward(t *testing.T) { diff --git a/drivers/i2c/ads1x15_driver.go b/drivers/i2c/ads1x15_driver.go index 674cff46..55d5ba55 100644 --- a/drivers/i2c/ads1x15_driver.go +++ b/drivers/i2c/ads1x15_driver.go @@ -348,16 +348,12 @@ func (d *ADS1x15Driver) AnalogRead(pin string) (value int, err error) { switch pin { case "0-1": channel = 0 - break case "0-3": channel = 1 - break case "1-3": channel = 2 - break case "2-3": channel = 3 - break default: // read the voltage at a specific pin, compared to the ground channel, err = strconv.Atoi(pin) diff --git a/drivers/i2c/ads1x15_driver_1015_test.go b/drivers/i2c/ads1x15_driver_1015_test.go index eb26d67f..69432d47 100644 --- a/drivers/i2c/ads1x15_driver_1015_test.go +++ b/drivers/i2c/ads1x15_driver_1015_test.go @@ -103,7 +103,7 @@ func TestADS1015AnalogRead(t *testing.T) { gobottest.Assert(t, val, 32767) gobottest.Assert(t, err, nil) - val, err = d.AnalogRead("3-2") + _, err = d.AnalogRead("3-2") gobottest.Refute(t, err.Error(), nil) } diff --git a/drivers/i2c/ads1x15_driver_1115_test.go b/drivers/i2c/ads1x15_driver_1115_test.go index dcc1f528..2730985d 100644 --- a/drivers/i2c/ads1x15_driver_1115_test.go +++ b/drivers/i2c/ads1x15_driver_1115_test.go @@ -103,7 +103,7 @@ func TestADS1115AnalogRead(t *testing.T) { gobottest.Assert(t, val, 32767) gobottest.Assert(t, err, nil) - val, err = d.AnalogRead("3-2") + _, err = d.AnalogRead("3-2") gobottest.Refute(t, err.Error(), nil) } diff --git a/drivers/i2c/ads1x15_driver_test.go b/drivers/i2c/ads1x15_driver_test.go index 15e282d0..8575ce49 100644 --- a/drivers/i2c/ads1x15_driver_test.go +++ b/drivers/i2c/ads1x15_driver_test.go @@ -96,9 +96,9 @@ func TestADS1x15CommandsAnalogRead(t *testing.T) { } func TestADS1x15_ads1x15BestGainForVoltage(t *testing.T) { - g, err := ads1x15BestGainForVoltage(1.5) + g, _ := ads1x15BestGainForVoltage(1.5) gobottest.Assert(t, g, 2) - g, err = ads1x15BestGainForVoltage(20.0) + _, err := ads1x15BestGainForVoltage(20.0) gobottest.Assert(t, err, errors.New("The maximum voltage which can be read is 6.144000")) } diff --git a/drivers/i2c/blinkm_driver_test.go b/drivers/i2c/blinkm_driver_test.go index b7cd9ac1..e7779c8f 100644 --- a/drivers/i2c/blinkm_driver_test.go +++ b/drivers/i2c/blinkm_driver_test.go @@ -124,7 +124,7 @@ func TestBlinkMFirmwareVersion(t *testing.T) { return 0, errors.New("write error") } - version, err := d.FirmwareVersion() + _, err := d.FirmwareVersion() gobottest.Assert(t, err, errors.New("write error")) } @@ -152,7 +152,7 @@ func TestBlinkMColor(t *testing.T) { return 0, errors.New("write error") } - color, err := d.Color() + _, err := d.Color() gobottest.Assert(t, err, errors.New("write error")) } diff --git a/drivers/i2c/ccs811_driver.go b/drivers/i2c/ccs811_driver.go index ba501808..1d48f58f 100644 --- a/drivers/i2c/ccs811_driver.go +++ b/drivers/i2c/ccs811_driver.go @@ -12,10 +12,10 @@ type CCS811DriveMode uint8 // Operating modes which dictate how often measurements are being made. If 0x00 is used as an operating mode, measurements will be disabled const ( CCS811DriveModeIdle CCS811DriveMode = 0x00 - CCS811DriveMode1Sec = 0x01 - CCS811DriveMode10Sec = 0x02 - CCS811DriveMode60Sec = 0x03 - CCS811DriveMode250MS = 0x04 + CCS811DriveMode1Sec CCS811DriveMode = 0x01 + CCS811DriveMode10Sec CCS811DriveMode = 0x02 + CCS811DriveMode60Sec CCS811DriveMode = 0x03 + CCS811DriveMode250MS CCS811DriveMode = 0x04 ) const ( diff --git a/drivers/i2c/drv2605l_driver.go b/drivers/i2c/drv2605l_driver.go index d737de39..24877a5a 100644 --- a/drivers/i2c/drv2605l_driver.go +++ b/drivers/i2c/drv2605l_driver.go @@ -6,13 +6,13 @@ type DRV2605Mode uint8 // Operating modes, for use in SetMode() const ( DRV2605ModeIntTrig DRV2605Mode = 0x00 - DRV2605ModeExtTrigEdge = 0x01 - DRV2605ModeExtTrigLvl = 0x02 - DRV2605ModePWMAnalog = 0x03 - DRV2605ModeAudioVibe = 0x04 - DRV2605ModeRealtime = 0x05 - DRV2605ModeDiagnose = 0x06 - DRV2605ModeAutocal = 0x07 + DRV2605ModeExtTrigEdge DRV2605Mode = 0x01 + DRV2605ModeExtTrigLvl DRV2605Mode = 0x02 + DRV2605ModePWMAnalog DRV2605Mode = 0x03 + DRV2605ModeAudioVibe DRV2605Mode = 0x04 + DRV2605ModeRealtime DRV2605Mode = 0x05 + DRV2605ModeDiagnose DRV2605Mode = 0x06 + DRV2605ModeAutocal DRV2605Mode = 0x07 ) const ( diff --git a/drivers/i2c/grovepi_driver.go b/drivers/i2c/grovepi_driver.go index b3bb59f3..fea0dcbb 100644 --- a/drivers/i2c/grovepi_driver.go +++ b/drivers/i2c/grovepi_driver.go @@ -267,7 +267,7 @@ func (d *GrovePiDriver) SetPinMode(pin byte, mode string) error { func getPin(pin string) string { if len(pin) > 1 { if strings.ToUpper(pin[0:1]) == "A" || strings.ToUpper(pin[0:1]) == "D" { - return pin[1:len(pin)] + return pin[1:] } } diff --git a/drivers/i2c/i2c_connection.go b/drivers/i2c/i2c_connection.go index be6ae8e3..5bc1bd3b 100644 --- a/drivers/i2c/i2c_connection.go +++ b/drivers/i2c/i2c_connection.go @@ -30,7 +30,7 @@ type bitState uint8 const ( clear bitState = 0x00 - set = 0x01 + set bitState = 0x01 ) // Connection is a connection to an I2C device with a specified address diff --git a/drivers/i2c/mcp23017_driver_test.go b/drivers/i2c/mcp23017_driver_test.go index f4989b3b..638dcb28 100644 --- a/drivers/i2c/mcp23017_driver_test.go +++ b/drivers/i2c/mcp23017_driver_test.go @@ -536,19 +536,19 @@ func TestMCP23017SetGPIOPolarityErr(t *testing.T) { func TestMCP23017_write(t *testing.T) { // clear bit - d, a := initTestMCP23017WithStubbedAdaptor(0) + d, _ := initTestMCP23017WithStubbedAdaptor(0) port := d.getPort("A") err := d.write(port.IODIR, uint8(7), 0) gobottest.Assert(t, err, nil) // set bit - d, a = initTestMCP23017WithStubbedAdaptor(0) + d, _ = initTestMCP23017WithStubbedAdaptor(0) port = d.getPort("B") err = d.write(port.IODIR, uint8(7), 1) gobottest.Assert(t, err, nil) // write error - d, a = initTestMCP23017WithStubbedAdaptor(0) + d, a := initTestMCP23017WithStubbedAdaptor(0) a.i2cWriteImpl = func([]byte) (int, error) { return 0, errors.New("write error") } diff --git a/drivers/i2c/sht2x_driver.go b/drivers/i2c/sht2x_driver.go index 064b5535..fddaa48c 100644 --- a/drivers/i2c/sht2x_driver.go +++ b/drivers/i2c/sht2x_driver.go @@ -211,13 +211,13 @@ func (d *SHT2xDriver) initialize() error { return nil } -func (d *SHT2xDriver) sendAccuracy() (err error) { - if err = d.connection.WriteByte(SHT2xReadUserReg); err != nil { - return +func (d *SHT2xDriver) sendAccuracy() error { + if err := d.connection.WriteByte(SHT2xReadUserReg); err != nil { + return err } userRegister, err := d.connection.ReadByte() if err != nil { - return + return err } userRegister &= 0x7e //Turn off the resolution bits @@ -226,15 +226,13 @@ func (d *SHT2xDriver) sendAccuracy() (err error) { userRegister |= acc //Mask in the requested resolution bits //Request a write to user register - _, err = d.connection.Write([]byte{SHT2xWriteUserReg, userRegister}) - if err != nil { - return + if _, err := d.connection.Write([]byte{SHT2xWriteUserReg, userRegister}); err != nil { + return err } - userRegister, err = d.connection.ReadByte() - if err != nil { - return + if _, err := d.connection.ReadByte(); err != nil { + return err } - return + return nil } diff --git a/drivers/i2c/sht3x_driver.go b/drivers/i2c/sht3x_driver.go index 131e6c98..b906a146 100644 --- a/drivers/i2c/sht3x_driver.go +++ b/drivers/i2c/sht3x_driver.go @@ -44,7 +44,9 @@ const SHT3xAccuracyMedium = 0x0b const SHT3xAccuracyHigh = 0x00 var ( - crc8Params = crc8.Params{0x31, 0xff, false, false, 0x00, 0xf7, "CRC-8/SENSIRON"} + crc8Params = crc8.Params{ + Poly: 0x31, Init: 0xff, RefIn: false, RefOut: false, XorOut: 0x00, Check: 0xf7, Name: "CRC-8/SENSIRON", + } ErrInvalidAccuracy = errors.New("Invalid accuracy") ErrInvalidCrc = errors.New("Invalid crc") ErrInvalidTemp = errors.New("Invalid temperature units") @@ -128,7 +130,7 @@ func (s *SHT3xDriver) Heater() (status bool, err error) { // SetHeater enables or disables the heater on the device func (s *SHT3xDriver) SetHeater(enabled bool) (err error) { out := []byte{0x30, 0x66} - if true == enabled { + if enabled { out[1] = 0x6d } _, err = s.connection.Write(out) diff --git a/drivers/i2c/sht3x_driver_test.go b/drivers/i2c/sht3x_driver_test.go index 4049a17b..eabd1358 100644 --- a/drivers/i2c/sht3x_driver_test.go +++ b/drivers/i2c/sht3x_driver_test.go @@ -174,7 +174,7 @@ func TestSHT3xHeater(t *testing.T) { return 3, nil } - status, err = d.Heater() + _, err = d.Heater() gobottest.Assert(t, err, ErrInvalidCrc) // heater read failed @@ -183,7 +183,7 @@ func TestSHT3xHeater(t *testing.T) { return 2, nil } - status, err = d.Heater() + _, err = d.Heater() gobottest.Refute(t, err, nil) } diff --git a/drivers/i2c/tsl2561_driver.go b/drivers/i2c/tsl2561_driver.go index a4a3960f..7bc4fa8b 100644 --- a/drivers/i2c/tsl2561_driver.go +++ b/drivers/i2c/tsl2561_driver.go @@ -326,11 +326,9 @@ func (d *TSL2561Driver) CalculateLux(broadband uint16, ir uint16) (lux uint32) { ratio := (ratio1 + 1) / 2 b, m := d.getBM(ratio) - temp := (channel0 * b) - (channel1 * m) - - // Negative lux not allowed - if temp < 0 { - temp = 0 + var temp uint32 + if (channel0 * b) > (channel1 * m) { + temp = (channel0 * b) - (channel1 * m) } // Round lsb (2^(LUX_SCALE+1)) @@ -408,7 +406,7 @@ func (d *TSL2561Driver) getClipScaling() (clipThreshold uint16, chScale uint32) func (d *TSL2561Driver) getBM(ratio uint32) (b uint32, m uint32) { switch { - case (ratio >= 0) && (ratio <= tsl2561LuxK1T): + case ratio <= tsl2561LuxK1T: b = tsl2561LuxB1T m = tsl2561LuxM1T case (ratio <= tsl2561LuxK2T): @@ -445,7 +443,6 @@ func (d *TSL2561Driver) waitForADC() { case TSL2561IntegrationTime402MS: time.Sleep(450 * time.Millisecond) } - return } func (d *TSL2561Driver) initialize() error { diff --git a/drivers/spi/helpers_test.go b/drivers/spi/helpers_test.go index 0a522648..192668f4 100644 --- a/drivers/spi/helpers_test.go +++ b/drivers/spi/helpers_test.go @@ -50,4 +50,4 @@ func (a *spiTestAdaptor) SpiDefaultMaxSpeed() int64 { return 0 } func (a *spiTestAdaptor) Connect() error { return nil } func (a *spiTestAdaptor) Finalize() error { return nil } func (a *spiTestAdaptor) Name() string { return "board name" } -func (a *spiTestAdaptor) SetName(string) { return } +func (a *spiTestAdaptor) SetName(string) {} diff --git a/drivers/spi/ssd1306_driver.go b/drivers/spi/ssd1306_driver.go index 412f9ece..8758fef9 100644 --- a/drivers/spi/ssd1306_driver.go +++ b/drivers/spi/ssd1306_driver.go @@ -282,9 +282,6 @@ func (s *SSD1306Driver) SetBufferAndDisplay(buf []byte) error { // SetContrast sets the display contrast (0-255). func (s *SSD1306Driver) SetContrast(contrast byte) error { - if contrast < 0 || contrast > 255 { - return fmt.Errorf("contrast value must be between 0-255") - } if err := s.command(ssd1306SetContrast); err != nil { return err } diff --git a/eventer.go b/eventer.go index b8612c89..dacda7c5 100644 --- a/eventer.go +++ b/eventer.go @@ -63,14 +63,12 @@ func NewEventer() Eventer { // goroutine to cascade "in" events to all "out" event channels go func() { for { - select { - case evt := <-evtr.in: - evtr.eventsMutex.Lock() - for _, out := range evtr.outs { - out <- evt - } - evtr.eventsMutex.Unlock() + evt := <-evtr.in + evtr.eventsMutex.Lock() + for _, out := range evtr.outs { + out <- evt } + evtr.eventsMutex.Unlock() } }() @@ -125,11 +123,9 @@ func (e *eventer) On(n string, f func(s interface{})) (err error) { out := e.Subscribe() go func() { for { - select { - case evt := <-out: - if evt.Name == n { - f(evt.Data) - } + evt := <-out + if evt.Name == n { + f(evt.Data) } } }() diff --git a/platforms/adaptors/digitalpinsadaptor_test.go b/platforms/adaptors/digitalpinsadaptor_test.go index 29533c1b..008c6c8b 100644 --- a/platforms/adaptors/digitalpinsadaptor_test.go +++ b/platforms/adaptors/digitalpinsadaptor_test.go @@ -101,7 +101,7 @@ func TestDigitalPinsFinalize(t *testing.T) { gobottest.Assert(t, a.DigitalWrite("3", 2), nil) delete(fs.Files, "/sys/class/gpio/unexport") err = a.Finalize() - gobottest.Assert(t, strings.Contains(err.Error(), "/sys/class/gpio/unexport: No such file"), true) + gobottest.Assert(t, strings.Contains(err.Error(), "/sys/class/gpio/unexport: no such file"), true) } func TestDigitalPinsReConnect(t *testing.T) { diff --git a/platforms/adaptors/pwmpinsadaptor_test.go b/platforms/adaptors/pwmpinsadaptor_test.go index a7caaa15..0058391d 100644 --- a/platforms/adaptors/pwmpinsadaptor_test.go +++ b/platforms/adaptors/pwmpinsadaptor_test.go @@ -145,7 +145,7 @@ func TestPWMPinsFinalize(t *testing.T) { gobottest.Assert(t, a.PwmWrite("33", 2), nil) delete(fs.Files, pwmUnexportPath) err = a.Finalize() - gobottest.Assert(t, strings.Contains(err.Error(), pwmUnexportPath+": No such file"), true) + gobottest.Assert(t, strings.Contains(err.Error(), pwmUnexportPath+": no such file"), true) // arrange write error gobottest.Assert(t, a.Connect(), nil) gobottest.Assert(t, a.PwmWrite("33", 2), nil) @@ -283,14 +283,14 @@ func Test_PWMPin(t *testing.T) { mockPaths: []string{}, translate: translator, pin: "33", - wantErr: "Export() failed for id 44 with : /sys/devices/platform/ff680020.pwm/pwm/pwmchip3/export: No such file.", + wantErr: "Export() failed for id 44 with : /sys/devices/platform/ff680020.pwm/pwm/pwmchip3/export: no such file", }, "init_setenabled_error": { mockPaths: []string{pwmExportPath, pwmPeriodPath}, period: "1000", translate: translator, pin: "33", - wantErr: "SetEnabled(false) failed for id 44 with : /sys/devices/platform/ff680020.pwm/pwm/pwmchip3/pwm44/enable: No such file.", + wantErr: "SetEnabled(false) failed for id 44 with : /sys/devices/platform/ff680020.pwm/pwm/pwmchip3/pwm44/enable: no such file", }, "init_setperiod_dutycycle_no_error": { mockPaths: []string{pwmExportPath, pwmEnablePath, pwmPeriodPath, pwmPolarityPath}, @@ -301,13 +301,13 @@ func Test_PWMPin(t *testing.T) { mockPaths: []string{pwmExportPath, pwmEnablePath}, translate: translator, pin: "33", - wantErr: "SetPeriod(10000000) failed for id 44 with : /sys/devices/platform/ff680020.pwm/pwm/pwmchip3/pwm44/period: No such file.", + wantErr: "SetPeriod(10000000) failed for id 44 with : /sys/devices/platform/ff680020.pwm/pwm/pwmchip3/pwm44/period: no such file", }, "init_setpolarity_error": { mockPaths: []string{pwmExportPath, pwmEnablePath, pwmPeriodPath, pwmDutyCyclePath}, translate: translator, pin: "33", - wantErr: "SetPolarity(normal) failed for id 44 with : /sys/devices/platform/ff680020.pwm/pwm/pwmchip3/pwm44/polarity: No such file.", + wantErr: "SetPolarity(normal) failed for id 44 with : /sys/devices/platform/ff680020.pwm/pwm/pwmchip3/pwm44/polarity: no such file", }, "translate_error": { translate: func(string) (string, int, error) { return "", -1, fmt.Errorf(translateErr) }, diff --git a/platforms/audio/audio_driver.go b/platforms/audio/audio_driver.go index 0848af8f..45286aa9 100644 --- a/platforms/audio/audio_driver.go +++ b/platforms/audio/audio_driver.go @@ -29,7 +29,7 @@ func NewDriver(a *Adaptor, filename string) *Driver { connection: a, interval: 500 * time.Millisecond, filename: filename, - halt: make(chan bool, 0), + halt: make(chan bool), Eventer: gobot.NewEventer(), Commander: gobot.NewCommander(), } diff --git a/platforms/beaglebone/beaglebone_adaptor.go b/platforms/beaglebone/beaglebone_adaptor.go index 3451461a..a0b6fb69 100644 --- a/platforms/beaglebone/beaglebone_adaptor.go +++ b/platforms/beaglebone/beaglebone_adaptor.go @@ -50,8 +50,9 @@ type Adaptor struct { // NewAdaptor returns a new Beaglebone Black/Green 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#.# +// +// adaptors.WithGpiodAccess(): use character device gpiod driver instead of sysfs +// adaptors.WithSpiGpioAccess(sclk, nss, mosi, miso): use GPIO's instead of /dev/spidev#.# func NewAdaptor(opts ...func(adaptors.Optioner)) *Adaptor { sys := system.NewAccesser() c := &Adaptor{ @@ -127,7 +128,7 @@ func (c *Adaptor) DigitalWrite(id string, val byte) error { if strings.Contains(id, "usr") { fi, e := c.sys.OpenFile(c.usrLed+id+"/brightness", os.O_WRONLY|os.O_APPEND, 0666) - defer fi.Close() + defer fi.Close() //nolint:staticcheck // for historical reasons if e != nil { return e } @@ -145,7 +146,7 @@ func (c *Adaptor) AnalogRead(pin string) (val int, err error) { return } fi, err := c.sys.OpenFile(fmt.Sprintf("%v/%v", c.analogPath, analogPin), os.O_RDONLY, 0644) - defer fi.Close() + defer fi.Close() //nolint:staticcheck // for historical reasons if err != nil { return @@ -219,7 +220,7 @@ func (c *Adaptor) translateAndMuxPWMPin(id string) (string, int, error) { func (p pwmPinData) findPWMDir(sys *system.Accesser) (dir string, err error) { items, _ := sys.Find(p.dir, p.dirRegexp) - if items == nil || len(items) == 0 { + if len(items) == 0 { return "", fmt.Errorf("No path found for PWM directory pattern, '%s' in path '%s'", p.dirRegexp, p.dir) } @@ -238,7 +239,7 @@ func (p pwmPinData) findPWMDir(sys *system.Accesser) (dir string, err error) { func (c *Adaptor) muxPin(pin, cmd string) error { path := fmt.Sprintf("/sys/devices/platform/ocp/ocp:%s_pinmux/state", pin) fi, e := c.sys.OpenFile(path, os.O_WRONLY, 0666) - defer fi.Close() + defer fi.Close() //nolint:staticcheck // for historical reasons if e != nil { return e } diff --git a/platforms/beaglebone/beaglebone_adaptor_test.go b/platforms/beaglebone/beaglebone_adaptor_test.go index ae3977c1..a15ebffa 100644 --- a/platforms/beaglebone/beaglebone_adaptor_test.go +++ b/platforms/beaglebone/beaglebone_adaptor_test.go @@ -135,7 +135,7 @@ func TestDigitalIO(t *testing.T) { // no such LED err := a.DigitalWrite("usr10101", 1) - gobottest.Assert(t, err.Error(), " : /sys/class/leds/beaglebone:green:usr10101/brightness: No such file.") + gobottest.Assert(t, err.Error(), " : /sys/class/leds/beaglebone:green:usr10101/brightness: no such file") a.DigitalWrite("P9_12", 1) gobottest.Assert(t, fs.Files["/sys/class/gpio/gpio60/value"].Contents, "1") @@ -168,7 +168,7 @@ func TestAnalogReadFileError(t *testing.T) { a, _ := initTestAdaptorWithMockedFilesystem(mockPaths) _, err := a.AnalogRead("P9_40") - gobottest.Assert(t, strings.Contains(err.Error(), "/sys/bus/iio/devices/iio:device0/in_voltage1_raw: No such file."), true) + gobottest.Assert(t, strings.Contains(err.Error(), "/sys/bus/iio/devices/iio:device0/in_voltage1_raw: no such file"), true) } func TestDigitalPinDirectionFileError(t *testing.T) { @@ -181,7 +181,7 @@ func TestDigitalPinDirectionFileError(t *testing.T) { a, _ := initTestAdaptorWithMockedFilesystem(mockPaths) err := a.DigitalWrite("P9_12", 1) - gobottest.Assert(t, strings.Contains(err.Error(), "/sys/class/gpio/gpio60/direction: No such file."), true) + gobottest.Assert(t, strings.Contains(err.Error(), "/sys/class/gpio/gpio60/direction: no such file"), true) // no pin added after previous problem, so no pin to unexport in finalize err = a.Finalize() @@ -202,7 +202,7 @@ func TestDigitalPinFinalizeFileError(t *testing.T) { gobottest.Assert(t, err, nil) err = a.Finalize() - gobottest.Assert(t, strings.Contains(err.Error(), "/sys/class/gpio/unexport: No such file."), true) + gobottest.Assert(t, strings.Contains(err.Error(), "/sys/class/gpio/unexport: no such file"), true) } func TestPocketName(t *testing.T) { diff --git a/platforms/ble/ble_client_adaptor.go b/platforms/ble/ble_client_adaptor.go index c7e5a489..b18b01d5 100644 --- a/platforms/ble/ble_client_adaptor.go +++ b/platforms/ble/ble_client_adaptor.go @@ -100,12 +100,10 @@ func (b *ClientAdaptor) Connect() (err error) { } // wait to connect to peripheral device - select { - case result := <-ch: - b.device, err = b.adpt.Connect(result.Address, bluetooth.ConnectionParams{}) - if err != nil { - return err - } + result := <-ch + b.device, err = b.adpt.Connect(result.Address, bluetooth.ConnectionParams{}) + if err != nil { + return err } // get all services/characteristics diff --git a/platforms/dexter/gopigo3/driver.go b/platforms/dexter/gopigo3/driver.go index 280181d4..ca97191b 100644 --- a/platforms/dexter/gopigo3/driver.go +++ b/platforms/dexter/gopigo3/driver.go @@ -138,10 +138,10 @@ type GroveType int const ( CUSTOM GroveType = 1 - IR_DI_REMOTE = 2 - IR_EV3_REMOTE = 3 - US = 4 - I2C = 5 + IR_DI_REMOTE GroveType = 2 + IR_EV3_REMOTE GroveType = 3 + US GroveType = 4 + I2C GroveType = 5 ) // GroveState contains the state of a grove device. @@ -234,7 +234,7 @@ func (g *Driver) GetManufacturerName() (mName string, err error) { } mf := response[4:23] mf = bytes.Trim(mf, "\x00") - return fmt.Sprintf("%s", string(mf)), nil + return string(mf), nil } // GetBoardName returns the board name from the firmware. @@ -249,7 +249,7 @@ func (g *Driver) GetBoardName() (bName string, err error) { } mf := response[4:23] mf = bytes.Trim(mf, "\x00") - return fmt.Sprintf("%s", string(mf)), nil + return string(mf), nil } // GetHardwareVersion returns the hardware version from the firmware. @@ -336,9 +336,6 @@ func (g *Driver) ServoWrite(port string, angle byte) error { if angle > 180 { angle = 180 } - if angle < 0 { - angle = 0 - } pulseWidth := ((1500 - (pulseWidthRange / 2)) + ((pulseWidthRange / 180) * int(angle))) return g.SetServo(srvo, uint16(pulseWidth)) } @@ -419,19 +416,19 @@ func (g *Driver) GetMotorStatus(motor Motor) (flags uint8, power uint16, encoder enc[1] = response[8] enc[0] = response[9] e := binary.LittleEndian.Uint32(enc) + encoder = int(e) if e&0x80000000 == 0x80000000 { encoder = int(uint64(e) - 0x100000000) } - encoder = int(e) //get dps d := make([]byte, 4) d[1] = response[10] d[0] = response[11] ds := binary.LittleEndian.Uint32(d) + dps = int(ds) if ds&0x8000 == 0x8000 { dps = int(ds - 0x10000) } - dps = int(ds) return flags, power, encoder / MOTOR_TICKS_PER_DEGREE, dps / MOTOR_TICKS_PER_DEGREE, nil } @@ -489,9 +486,6 @@ func (g *Driver) SetGroveMode(port Grove, mode GroveMode) error { // SetPWMDuty sets the pwm duty cycle for the given pin/port. func (g *Driver) SetPWMDuty(port Grove, duty uint16) (err error) { - if duty < 0 { - duty = 0 - } if duty > 100 { duty = 100 } diff --git a/platforms/digispark/digispark_i2c_test.go b/platforms/digispark/digispark_i2c_test.go index 8dff68a3..dbaba0e9 100644 --- a/platforms/digispark/digispark_i2c_test.go +++ b/platforms/digispark/digispark_i2c_test.go @@ -63,7 +63,7 @@ func TestDigisparkAdaptorI2cStartFailWithWrongAddress(t *testing.T) { // arrange data := []byte{0, 1, 2, 3, 4} a := initTestAdaptorI2c() - c, err := a.GetI2cConnection(0x39, a.DefaultI2cBus()) + c, _ := a.GetI2cConnection(0x39, a.DefaultI2cBus()) // act count, err := c.Write(data) @@ -79,7 +79,7 @@ func TestDigisparkAdaptorI2cWrite(t *testing.T) { data := []byte{0, 1, 2, 3, 4} dataLen := len(data) a := initTestAdaptorI2c() - c, err := a.GetI2cConnection(availableI2cAddress, a.DefaultI2cBus()) + c, _ := a.GetI2cConnection(availableI2cAddress, a.DefaultI2cBus()) // act count, err := c.Write(data) @@ -99,10 +99,10 @@ func TestDigisparkAdaptorI2cWriteByte(t *testing.T) { // arrange data := byte(0x02) a := initTestAdaptorI2c() - c, err := a.GetI2cConnection(availableI2cAddress, a.DefaultI2cBus()) + c, _ := a.GetI2cConnection(availableI2cAddress, a.DefaultI2cBus()) // act - err = c.WriteByte(data) + err := c.WriteByte(data) // assert gobottest.Assert(t, err, nil) @@ -119,10 +119,10 @@ func TestDigisparkAdaptorI2cWriteByteData(t *testing.T) { reg := uint8(0x03) data := byte(0x09) a := initTestAdaptorI2c() - c, err := a.GetI2cConnection(availableI2cAddress, a.DefaultI2cBus()) + c, _ := a.GetI2cConnection(availableI2cAddress, a.DefaultI2cBus()) // act - err = c.WriteByteData(reg, data) + err := c.WriteByteData(reg, data) // assert gobottest.Assert(t, err, nil) @@ -139,10 +139,10 @@ func TestDigisparkAdaptorI2cWriteWordData(t *testing.T) { reg := uint8(0x04) data := uint16(0x0508) a := initTestAdaptorI2c() - c, err := a.GetI2cConnection(availableI2cAddress, a.DefaultI2cBus()) + c, _ := a.GetI2cConnection(availableI2cAddress, a.DefaultI2cBus()) // act - err = c.WriteWordData(reg, data) + err := c.WriteWordData(reg, data) // assert gobottest.Assert(t, err, nil) @@ -159,10 +159,10 @@ func TestDigisparkAdaptorI2cWriteBlockData(t *testing.T) { reg := uint8(0x05) data := []byte{0x80, 0x81, 0x82} a := initTestAdaptorI2c() - c, err := a.GetI2cConnection(availableI2cAddress, a.DefaultI2cBus()) + c, _ := a.GetI2cConnection(availableI2cAddress, a.DefaultI2cBus()) // act - err = c.WriteBlockData(reg, data) + err := c.WriteBlockData(reg, data) // assert gobottest.Assert(t, err, nil) @@ -179,7 +179,7 @@ func TestDigisparkAdaptorI2cRead(t *testing.T) { data := []byte{0, 1, 2, 3, 4} dataLen := len(data) a := initTestAdaptorI2c() - c, err := a.GetI2cConnection(availableI2cAddress, a.DefaultI2cBus()) + c, _ := a.GetI2cConnection(availableI2cAddress, a.DefaultI2cBus()) // act count, err := c.Read(data) @@ -198,7 +198,7 @@ func TestDigisparkAdaptorI2cRead(t *testing.T) { func TestDigisparkAdaptorI2cReadByte(t *testing.T) { // arrange a := initTestAdaptorI2c() - c, err := a.GetI2cConnection(availableI2cAddress, a.DefaultI2cBus()) + c, _ := a.GetI2cConnection(availableI2cAddress, a.DefaultI2cBus()) // act data, err := c.ReadByte() @@ -217,7 +217,7 @@ func TestDigisparkAdaptorI2cReadByteData(t *testing.T) { // arrange reg := uint8(0x04) a := initTestAdaptorI2c() - c, err := a.GetI2cConnection(availableI2cAddress, a.DefaultI2cBus()) + c, _ := a.GetI2cConnection(availableI2cAddress, a.DefaultI2cBus()) // act data, err := c.ReadByteData(reg) @@ -239,7 +239,7 @@ func TestDigisparkAdaptorI2cReadWordData(t *testing.T) { // 2 bytes of i2cData are used swapped expectedValue := uint16(0x0405) a := initTestAdaptorI2c() - c, err := a.GetI2cConnection(availableI2cAddress, a.DefaultI2cBus()) + c, _ := a.GetI2cConnection(availableI2cAddress, a.DefaultI2cBus()) // act data, err := c.ReadWordData(reg) @@ -261,10 +261,10 @@ func TestDigisparkAdaptorI2cReadBlockData(t *testing.T) { data := []byte{0, 0, 0, 0, 0} dataLen := len(data) a := initTestAdaptorI2c() - c, err := a.GetI2cConnection(availableI2cAddress, a.DefaultI2cBus()) + c, _ := a.GetI2cConnection(availableI2cAddress, a.DefaultI2cBus()) // act - err = c.ReadBlockData(reg, data) + err := c.ReadBlockData(reg, data) // assert gobottest.Assert(t, err, nil) @@ -279,13 +279,11 @@ func TestDigisparkAdaptorI2cReadBlockData(t *testing.T) { func TestDigisparkAdaptorI2cUpdateDelay(t *testing.T) { // arrange - var c i2c.Connection - var err error a := initTestAdaptorI2c() - c, err = a.GetI2cConnection(availableI2cAddress, a.DefaultI2cBus()) + c, _ := a.GetI2cConnection(availableI2cAddress, a.DefaultI2cBus()) // act - err = c.(*digisparkI2cConnection).UpdateDelay(uint(100)) + err := c.(*digisparkI2cConnection).UpdateDelay(uint(100)) // assert gobottest.Assert(t, err, nil) diff --git a/platforms/firmata/firmata_adaptor.go b/platforms/firmata/firmata_adaptor.go index 545807d7..5a074c12 100644 --- a/platforms/firmata/firmata_adaptor.go +++ b/platforms/firmata/firmata_adaptor.go @@ -70,11 +70,11 @@ func NewAdaptor(args ...interface{}) *Adaptor { } for _, arg := range args { - switch arg.(type) { + switch a := arg.(type) { case string: - f.port = arg.(string) + f.port = a case io.ReadWriteCloser: - f.conn = arg.(io.ReadWriteCloser) + f.conn = a } } diff --git a/platforms/intel-iot/curie/imu_driver_test.go b/platforms/intel-iot/curie/imu_driver_test.go index 1e6da407..4b20d2a5 100644 --- a/platforms/intel-iot/curie/imu_driver_test.go +++ b/platforms/intel-iot/curie/imu_driver_test.go @@ -120,10 +120,10 @@ func TestIMUDriverReadAccelerometer(t *testing.T) { } func TestIMUDriverReadAccelerometerData(t *testing.T) { - result, err := parseAccelerometerData([]byte{}) + _, err := parseAccelerometerData([]byte{}) gobottest.Assert(t, err, errors.New("Invalid data")) - result, err = parseAccelerometerData([]byte{0xF0, 0x11, 0x00, 0x00, 0x0f, 0x00, 0x0f, 0x00, 0x0f, 0xf7}) + result, err := parseAccelerometerData([]byte{0xF0, 0x11, 0x00, 0x00, 0x0f, 0x00, 0x0f, 0x00, 0x0f, 0xf7}) gobottest.Assert(t, err, nil) gobottest.Assert(t, result, &AccelerometerData{X: 1920, Y: 1920, Z: 1920}) } @@ -135,10 +135,10 @@ func TestIMUDriverReadGyroscope(t *testing.T) { } func TestIMUDriverReadGyroscopeData(t *testing.T) { - result, err := parseGyroscopeData([]byte{}) + _, err := parseGyroscopeData([]byte{}) gobottest.Assert(t, err, errors.New("Invalid data")) - result, err = parseGyroscopeData([]byte{0xF0, 0x11, 0x01, 0x00, 0x0f, 0x00, 0x0f, 0x00, 0x0f, 0xf7}) + result, err := parseGyroscopeData([]byte{0xF0, 0x11, 0x01, 0x00, 0x0f, 0x00, 0x0f, 0x00, 0x0f, 0xf7}) gobottest.Assert(t, err, nil) gobottest.Assert(t, result, &GyroscopeData{X: 1920, Y: 1920, Z: 1920}) } @@ -150,10 +150,10 @@ func TestIMUDriverReadTemperature(t *testing.T) { } func TestIMUDriverReadTemperatureData(t *testing.T) { - result, err := parseTemperatureData([]byte{}) + _, err := parseTemperatureData([]byte{}) gobottest.Assert(t, err, errors.New("Invalid data")) - result, err = parseTemperatureData([]byte{0xF0, 0x11, 0x02, 0x00, 0x02, 0x03, 0x04, 0xf7}) + result, err := parseTemperatureData([]byte{0xF0, 0x11, 0x02, 0x00, 0x02, 0x03, 0x04, 0xf7}) gobottest.Assert(t, err, nil) gobottest.Assert(t, result, float32(31.546875)) } @@ -165,10 +165,10 @@ func TestIMUDriverEnableShockDetection(t *testing.T) { } func TestIMUDriverShockDetectData(t *testing.T) { - result, err := parseShockData([]byte{}) + _, err := parseShockData([]byte{}) gobottest.Assert(t, err, errors.New("Invalid data")) - result, err = parseShockData([]byte{0xF0, 0x11, 0x03, 0x00, 0x02, 0xf7}) + result, err := parseShockData([]byte{0xF0, 0x11, 0x03, 0x00, 0x02, 0xf7}) gobottest.Assert(t, err, nil) gobottest.Assert(t, result, &ShockData{Axis: 0, Direction: 2}) } @@ -180,10 +180,10 @@ func TestIMUDriverEnableStepCounter(t *testing.T) { } func TestIMUDriverStepCountData(t *testing.T) { - result, err := parseStepData([]byte{}) + _, err := parseStepData([]byte{}) gobottest.Assert(t, err, errors.New("Invalid data")) - result, err = parseStepData([]byte{0xF0, 0x11, 0x04, 0x00, 0x02, 0xf7}) + result, err := parseStepData([]byte{0xF0, 0x11, 0x04, 0x00, 0x02, 0xf7}) gobottest.Assert(t, err, nil) gobottest.Assert(t, result, int16(256)) } @@ -195,10 +195,10 @@ func TestIMUDriverEnableTapDetection(t *testing.T) { } func TestIMUDriverTapDetectData(t *testing.T) { - result, err := parseTapData([]byte{}) + _, err := parseTapData([]byte{}) gobottest.Assert(t, err, errors.New("Invalid data")) - result, err = parseTapData([]byte{0xF0, 0x11, 0x05, 0x00, 0x02, 0xf7}) + result, err := parseTapData([]byte{0xF0, 0x11, 0x05, 0x00, 0x02, 0xf7}) gobottest.Assert(t, err, nil) gobottest.Assert(t, result, &TapData{Axis: 0, Direction: 2}) } @@ -210,10 +210,10 @@ func TestIMUDriverEnableReadMotion(t *testing.T) { } func TestIMUDriverReadMotionData(t *testing.T) { - result, err := parseMotionData([]byte{}) + _, err := parseMotionData([]byte{}) gobottest.Assert(t, err, errors.New("Invalid data")) - result, err = parseMotionData([]byte{0xF0, 0x11, 0x06, 0x00, 0x0f, 0x00, 0x0f, 0x00, 0x0f, 0x00, 0x0f, 0x00, 0x0f, 0x00, 0x0f, 0xf7}) + result, err := parseMotionData([]byte{0xF0, 0x11, 0x06, 0x00, 0x0f, 0x00, 0x0f, 0x00, 0x0f, 0x00, 0x0f, 0x00, 0x0f, 0x00, 0x0f, 0xf7}) gobottest.Assert(t, err, nil) gobottest.Assert(t, result, &MotionData{AX: 1920, AY: 1920, AZ: 1920, GX: 1920, GY: 1920, GZ: 1920}) } diff --git a/platforms/intel-iot/edison/edison_adaptor.go b/platforms/intel-iot/edison/edison_adaptor.go index 99da035b..883d3e0c 100644 --- a/platforms/intel-iot/edison/edison_adaptor.go +++ b/platforms/intel-iot/edison/edison_adaptor.go @@ -263,7 +263,7 @@ func (c *Adaptor) arduinoI2CSetup() error { func (c *Adaptor) readFile(path string) ([]byte, error) { file, err := c.sys.OpenFile(path, os.O_RDONLY, 0644) - defer file.Close() + defer file.Close() //nolint:staticcheck // for historical reasons if err != nil { return make([]byte, 0), err } @@ -379,7 +379,7 @@ func (c *Adaptor) newExportedDigitalPin(pin int, o ...func(gobot.DigitalPinOptio // changePinMode writes pin mode to current_pinmux file func (c *Adaptor) changePinMode(pin, mode string) error { file, err := c.sys.OpenFile("/sys/kernel/debug/gpio_debug/gpio"+pin+"/current_pinmux", os.O_WRONLY, 0644) - defer file.Close() + defer file.Close() //nolint:staticcheck // for historical reasons if err != nil { return err } diff --git a/platforms/intel-iot/edison/edison_adaptor_test.go b/platforms/intel-iot/edison/edison_adaptor_test.go index aa79698d..040425a6 100644 --- a/platforms/intel-iot/edison/edison_adaptor_test.go +++ b/platforms/intel-iot/edison/edison_adaptor_test.go @@ -241,7 +241,7 @@ func TestArduinoSetupFail263(t *testing.T) { delete(fs.Files, "/sys/class/gpio/gpio263/direction") err := a.arduinoSetup() - gobottest.Assert(t, strings.Contains(err.Error(), "/sys/class/gpio/gpio263/direction: No such file"), true) + gobottest.Assert(t, strings.Contains(err.Error(), "/sys/class/gpio/gpio263/direction: no such file"), true) } func TestArduinoSetupFail240(t *testing.T) { @@ -249,7 +249,7 @@ func TestArduinoSetupFail240(t *testing.T) { delete(fs.Files, "/sys/class/gpio/gpio240/direction") err := a.arduinoSetup() - gobottest.Assert(t, strings.Contains(err.Error(), "/sys/class/gpio/gpio240/direction: No such file"), true) + gobottest.Assert(t, strings.Contains(err.Error(), "/sys/class/gpio/gpio240/direction: no such file"), true) } func TestArduinoSetupFail111(t *testing.T) { @@ -257,7 +257,7 @@ func TestArduinoSetupFail111(t *testing.T) { delete(fs.Files, "/sys/kernel/debug/gpio_debug/gpio111/current_pinmux") err := a.arduinoSetup() - gobottest.Assert(t, strings.Contains(err.Error(), "/sys/kernel/debug/gpio_debug/gpio111/current_pinmux: No such file"), true) + gobottest.Assert(t, strings.Contains(err.Error(), "/sys/kernel/debug/gpio_debug/gpio111/current_pinmux: no such file"), true) } func TestArduinoSetupFail131(t *testing.T) { @@ -265,7 +265,7 @@ func TestArduinoSetupFail131(t *testing.T) { delete(fs.Files, "/sys/kernel/debug/gpio_debug/gpio131/current_pinmux") err := a.arduinoSetup() - gobottest.Assert(t, strings.Contains(err.Error(), "/sys/kernel/debug/gpio_debug/gpio131/current_pinmux: No such file"), true) + gobottest.Assert(t, strings.Contains(err.Error(), "/sys/kernel/debug/gpio_debug/gpio131/current_pinmux: no such file"), true) } func TestArduinoI2CSetupFailTristate(t *testing.T) { @@ -284,7 +284,7 @@ func TestArduinoI2CSetupFail14(t *testing.T) { delete(fs.Files, "/sys/class/gpio/gpio14/direction") err := a.arduinoI2CSetup() - gobottest.Assert(t, strings.Contains(err.Error(), "/sys/class/gpio/gpio14/direction: No such file"), true) + gobottest.Assert(t, strings.Contains(err.Error(), "/sys/class/gpio/gpio14/direction: no such file"), true) } func TestArduinoI2CSetupUnexportFail(t *testing.T) { @@ -294,7 +294,7 @@ func TestArduinoI2CSetupUnexportFail(t *testing.T) { delete(fs.Files, "/sys/class/gpio/unexport") err := a.arduinoI2CSetup() - gobottest.Assert(t, strings.Contains(err.Error(), "/sys/class/gpio/unexport: No such file"), true) + gobottest.Assert(t, strings.Contains(err.Error(), "/sys/class/gpio/unexport: no such file"), true) } func TestArduinoI2CSetupFail236(t *testing.T) { @@ -304,7 +304,7 @@ func TestArduinoI2CSetupFail236(t *testing.T) { delete(fs.Files, "/sys/class/gpio/gpio236/direction") err := a.arduinoI2CSetup() - gobottest.Assert(t, strings.Contains(err.Error(), "/sys/class/gpio/gpio236/direction: No such file"), true) + gobottest.Assert(t, strings.Contains(err.Error(), "/sys/class/gpio/gpio236/direction: no such file"), true) } func TestArduinoI2CSetupFail28(t *testing.T) { @@ -314,7 +314,7 @@ func TestArduinoI2CSetupFail28(t *testing.T) { delete(fs.Files, "/sys/kernel/debug/gpio_debug/gpio28/current_pinmux") err := a.arduinoI2CSetup() - gobottest.Assert(t, strings.Contains(err.Error(), "/sys/kernel/debug/gpio_debug/gpio28/current_pinmux: No such file"), true) + gobottest.Assert(t, strings.Contains(err.Error(), "/sys/kernel/debug/gpio_debug/gpio28/current_pinmux: no such file"), true) } func TestConnectArduinoError(t *testing.T) { @@ -410,7 +410,7 @@ func TestDigitalPinInFileError(t *testing.T) { a.Connect() _, err := a.DigitalPin("13") - gobottest.Assert(t, strings.Contains(err.Error(), "No such file"), true) + gobottest.Assert(t, strings.Contains(err.Error(), "no such file"), true) } @@ -422,7 +422,7 @@ func TestDigitalPinInResistorFileError(t *testing.T) { a.Connect() _, err := a.DigitalPin("13") - gobottest.Assert(t, strings.Contains(err.Error(), "No such file"), true) + gobottest.Assert(t, strings.Contains(err.Error(), "no such file"), true) } func TestDigitalPinInLevelShifterFileError(t *testing.T) { @@ -433,7 +433,7 @@ func TestDigitalPinInLevelShifterFileError(t *testing.T) { a.Connect() _, err := a.DigitalPin("13") - gobottest.Assert(t, strings.Contains(err.Error(), "No such file"), true) + gobottest.Assert(t, strings.Contains(err.Error(), "no such file"), true) } func TestDigitalPinInMuxFileError(t *testing.T) { @@ -444,7 +444,7 @@ func TestDigitalPinInMuxFileError(t *testing.T) { a.Connect() _, err := a.DigitalPin("13") - gobottest.Assert(t, strings.Contains(err.Error(), "No such file"), true) + gobottest.Assert(t, strings.Contains(err.Error(), "no such file"), true) } func TestDigitalWriteError(t *testing.T) { @@ -482,7 +482,7 @@ func TestPwmExportError(t *testing.T) { gobottest.Assert(t, err, nil) err = a.PwmWrite("5", 100) - gobottest.Assert(t, strings.Contains(err.Error(), "/sys/class/pwm/pwmchip0/export: No such file"), true) + gobottest.Assert(t, strings.Contains(err.Error(), "/sys/class/pwm/pwmchip0/export: no such file"), true) } func TestPwmEnableError(t *testing.T) { @@ -492,7 +492,7 @@ func TestPwmEnableError(t *testing.T) { a.Connect() err := a.PwmWrite("5", 100) - gobottest.Assert(t, strings.Contains(err.Error(), "/sys/class/pwm/pwmchip0/pwm1/enable: No such file"), true) + gobottest.Assert(t, strings.Contains(err.Error(), "/sys/class/pwm/pwmchip0/pwm1/enable: no such file"), true) } func TestPwmWritePinError(t *testing.T) { diff --git a/platforms/intel-iot/joule/joule_adaptor_test.go b/platforms/intel-iot/joule/joule_adaptor_test.go index 201045e8..c21e79f0 100644 --- a/platforms/intel-iot/joule/joule_adaptor_test.go +++ b/platforms/intel-iot/joule/joule_adaptor_test.go @@ -154,7 +154,7 @@ func TestPwmPinExportError(t *testing.T) { delete(fs.Files, "/sys/class/pwm/pwmchip0/export") err := a.PwmWrite("J12_26", 100) - gobottest.Assert(t, strings.Contains(err.Error(), "/sys/class/pwm/pwmchip0/export: No such file"), true) + gobottest.Assert(t, strings.Contains(err.Error(), "/sys/class/pwm/pwmchip0/export: no such file"), true) } func TestPwmPinEnableError(t *testing.T) { @@ -162,7 +162,7 @@ func TestPwmPinEnableError(t *testing.T) { delete(fs.Files, "/sys/class/pwm/pwmchip0/pwm0/enable") err := a.PwmWrite("J12_26", 100) - gobottest.Assert(t, strings.Contains(err.Error(), "/sys/class/pwm/pwmchip0/pwm0/enable: No such file"), true) + gobottest.Assert(t, strings.Contains(err.Error(), "/sys/class/pwm/pwmchip0/pwm0/enable: no such file"), true) } func TestI2cDefaultBus(t *testing.T) { diff --git a/platforms/jetson/pwm_pin.go b/platforms/jetson/pwm_pin.go index db4dc3d6..1507949f 100644 --- a/platforms/jetson/pwm_pin.go +++ b/platforms/jetson/pwm_pin.go @@ -127,7 +127,7 @@ func (p *PWMPin) SetDutyCycle(duty uint32) error { func (p *PWMPin) writeFile(subpath string, value string) error { sysfspath := path.Join(p.path, subpath) fi, err := p.sys.OpenFile(sysfspath, os.O_WRONLY|os.O_APPEND, 0644) - defer fi.Close() + defer fi.Close() //nolint:staticcheck // for historical reasons if err != nil { return err diff --git a/platforms/jetson/pwm_pin_test.go b/platforms/jetson/pwm_pin_test.go index 2b04eeae..3e832a63 100644 --- a/platforms/jetson/pwm_pin_test.go +++ b/platforms/jetson/pwm_pin_test.go @@ -31,12 +31,12 @@ func TestPwmPin(t *testing.T) { val, _ = pin.Polarity() gobottest.Assert(t, val, true) - period, err := pin.Period() + _, err := pin.Period() gobottest.Assert(t, err, errors.New("Jetson PWM pin period not set")) gobottest.Assert(t, pin.SetDutyCycle(10000), errors.New("Jetson PWM pin period not set")) gobottest.Assert(t, pin.SetPeriod(20000000), nil) - period, _ = pin.Period() + period, _ := pin.Period() gobottest.Assert(t, period, uint32(20000000)) gobottest.Assert(t, pin.SetPeriod(10000000), errors.New("Cannot set the period of individual PWM pins on Jetson")) diff --git a/platforms/joystick/joystick_driver.go b/platforms/joystick/joystick_driver.go index d88dbcf6..ee4df60b 100644 --- a/platforms/joystick/joystick_driver.go +++ b/platforms/joystick/joystick_driver.go @@ -90,7 +90,7 @@ func NewDriver(a *Adaptor, config string, v ...time.Duration) *Driver { return sdl.PollEvent() }, interval: 10 * time.Millisecond, - halt: make(chan bool, 0), + halt: make(chan bool), } if len(v) > 0 { diff --git a/platforms/mavlink/mavlink_driver_test.go b/platforms/mavlink/mavlink_driver_test.go index 72f078cc..54e53ef0 100644 --- a/platforms/mavlink/mavlink_driver_test.go +++ b/platforms/mavlink/mavlink_driver_test.go @@ -42,9 +42,9 @@ func TestMavlinkDriverName(t *testing.T) { func TestMavlinkDriverStart(t *testing.T) { d := initTestMavlinkDriver() - err := make(chan error, 0) - packet := make(chan *common.MAVLinkPacket, 0) - message := make(chan common.MAVLinkMessage, 0) + err := make(chan error) + packet := make(chan *common.MAVLinkPacket) + message := make(chan common.MAVLinkMessage) d.On(PacketEvent, func(data interface{}) { packet <- data.(*common.MAVLinkPacket) diff --git a/platforms/microbit/accelerometer_driver_test.go b/platforms/microbit/accelerometer_driver_test.go index dac77570..f664ec98 100644 --- a/platforms/microbit/accelerometer_driver_test.go +++ b/platforms/microbit/accelerometer_driver_test.go @@ -30,7 +30,7 @@ func TestAccelerometerDriverStartAndHalt(t *testing.T) { } func TestAccelerometerDriverReadData(t *testing.T) { - sem := make(chan bool, 0) + sem := make(chan bool) a := NewBleTestAdaptor() d := NewAccelerometerDriver(a) d.Start() diff --git a/platforms/microbit/button_driver_test.go b/platforms/microbit/button_driver_test.go index 325ef5f4..edadeeed 100644 --- a/platforms/microbit/button_driver_test.go +++ b/platforms/microbit/button_driver_test.go @@ -30,7 +30,7 @@ func TestButtonDriverStartAndHalt(t *testing.T) { } func TestButtonDriverReadData(t *testing.T) { - sem := make(chan bool, 0) + sem := make(chan bool) a := NewBleTestAdaptor() d := NewButtonDriver(a) d.Start() diff --git a/platforms/microbit/helpers_test.go b/platforms/microbit/helpers_test.go index acf730cc..da5bc318 100644 --- a/platforms/microbit/helpers_test.go +++ b/platforms/microbit/helpers_test.go @@ -40,6 +40,7 @@ func (t *bleTestClientAdaptor) WriteCharacteristic(cUUID string, data []byte) (e return t.testWriteCharacteristic(cUUID, data) } +//nolint:revive // in tests it is be helpful to see the meaning of the parameters by name func (t *bleTestClientAdaptor) Subscribe(cUUID string, f func([]byte, error)) (err error) { t.testSubscribe = f return @@ -72,8 +73,6 @@ func NewBleTestAdaptor() *bleTestClientAdaptor { testWriteCharacteristic: func(cUUID string, data []byte) (e error) { return }, - testSubscribe: func([]byte, error) { - return - }, + testSubscribe: func([]byte, error) {}, } } diff --git a/platforms/microbit/magnetometer_driver_test.go b/platforms/microbit/magnetometer_driver_test.go index e16a41d0..a8936056 100644 --- a/platforms/microbit/magnetometer_driver_test.go +++ b/platforms/microbit/magnetometer_driver_test.go @@ -30,7 +30,7 @@ func TestMagnetometerDriverStartAndHalt(t *testing.T) { } func TestMagnetometerDriverReadData(t *testing.T) { - sem := make(chan bool, 0) + sem := make(chan bool) a := NewBleTestAdaptor() d := NewMagnetometerDriver(a) d.Start() diff --git a/platforms/microbit/temperature_driver_test.go b/platforms/microbit/temperature_driver_test.go index 265353c2..f039f9d2 100644 --- a/platforms/microbit/temperature_driver_test.go +++ b/platforms/microbit/temperature_driver_test.go @@ -30,7 +30,7 @@ func TestTemperatureDriverStartAndHalt(t *testing.T) { } func TestTemperatureDriverReadData(t *testing.T) { - sem := make(chan bool, 0) + sem := make(chan bool) a := NewBleTestAdaptor() d := NewTemperatureDriver(a) d.Start() diff --git a/platforms/mqtt/mqtt_adaptor.go b/platforms/mqtt/mqtt_adaptor.go index 64f7ebbc..31c24dff 100644 --- a/platforms/mqtt/mqtt_adaptor.go +++ b/platforms/mqtt/mqtt_adaptor.go @@ -138,11 +138,7 @@ func (a *Adaptor) Finalize() (err error) { // Publish a message under a specific topic func (a *Adaptor) Publish(topic string, message []byte) bool { _, err := a.PublishWithQOS(topic, a.qos, message) - if err != nil { - return false - } - - return true + return err == nil } // PublishAndRetain publishes a message under a specific topic with retain flag @@ -181,10 +177,7 @@ func (a *Adaptor) OnWithQOS(event string, qos int, f func(msg Message)) (paho.To // On subscribes to a topic, and then calls the message handler function when data is received func (a *Adaptor) On(event string, f func(msg Message)) bool { _, err := a.OnWithQOS(event, a.qos, f) - if err != nil { - return false - } - return true + return err == nil } func (a *Adaptor) createClientOptions() *paho.ClientOptions { diff --git a/platforms/nanopi/nanopi_adaptor.go b/platforms/nanopi/nanopi_adaptor.go index ba162fc9..1b119a4f 100644 --- a/platforms/nanopi/nanopi_adaptor.go +++ b/platforms/nanopi/nanopi_adaptor.go @@ -170,7 +170,7 @@ func (c *Adaptor) translatePWMPin(id string) (string, int, error) { func (p pwmPinDefinition) findPWMDir(sys *system.Accesser) (dir string, err error) { items, _ := sys.Find(p.dir, p.dirRegexp) - if items == nil || len(items) == 0 { + if len(items) == 0 { return "", fmt.Errorf("No path found for PWM directory pattern, '%s' in path '%s'. See README.md for activation", p.dirRegexp, p.dir) } diff --git a/platforms/neurosky/neurosky_driver_test.go b/platforms/neurosky/neurosky_driver_test.go index 890ad343..66619375 100644 --- a/platforms/neurosky/neurosky_driver_test.go +++ b/platforms/neurosky/neurosky_driver_test.go @@ -36,7 +36,7 @@ func TestNeuroskyDriverName(t *testing.T) { } func TestNeuroskyDriverStart(t *testing.T) { - sem := make(chan bool, 0) + sem := make(chan bool) rwc := &NullReadWriteCloser{} a := NewAdaptor("/dev/null") diff --git a/platforms/particle/adaptor.go b/platforms/particle/adaptor.go index 8e332cfe..3dbf81a0 100644 --- a/platforms/particle/adaptor.go +++ b/platforms/particle/adaptor.go @@ -175,11 +175,9 @@ func (s *Adaptor) EventStream(source string, name string) (event *gobot.Event, e go func() { for { - select { - case ev := <-events: - if ev.Event() != "" && ev.Data() != "" { - s.Publish(ev.Event(), ev.Data()) - } + ev := <-events + if ev.Event() != "" && ev.Data() != "" { + s.Publish(ev.Event(), ev.Data()) } } }() @@ -195,14 +193,13 @@ func (s *Adaptor) Variable(name string) (result string, err error) { return } - val := resp["result"] - switch val.(type) { + switch val := resp["result"].(type) { case bool: - result = strconv.FormatBool(val.(bool)) + result = strconv.FormatBool(val) case float64: - result = strconv.FormatFloat(val.(float64), 'f', -1, 64) + result = strconv.FormatFloat(val, 'f', -1, 64) case string: - result = val.(string) + result = val } return diff --git a/platforms/particle/adaptor_test.go b/platforms/particle/adaptor_test.go index 088d5e5c..bae692d8 100644 --- a/platforms/particle/adaptor_test.go +++ b/platforms/particle/adaptor_test.go @@ -404,8 +404,8 @@ func TestAdaptorEventStream(t *testing.T) { _, err = a.EventStream("devices", "") gobottest.Assert(t, err.Error(), "error connecting sse") - eventChan := make(chan eventsource.Event, 0) - errorChan := make(chan error, 0) + eventChan := make(chan eventsource.Event) + errorChan := make(chan error) eventSource = func(u string) (chan eventsource.Event, chan error, error) { return eventChan, errorChan, nil diff --git a/platforms/raspi/pwm_pin.go b/platforms/raspi/pwm_pin.go index b9c59e98..bb27d15f 100644 --- a/platforms/raspi/pwm_pin.go +++ b/platforms/raspi/pwm_pin.go @@ -108,7 +108,7 @@ func (p *PWMPin) SetDutyCycle(duty uint32) error { func (p *PWMPin) writeValue(data string) (err error) { fi, err := p.sys.OpenFile(p.path, os.O_WRONLY|os.O_APPEND, 0644) - defer fi.Close() + defer fi.Close() //nolint:staticcheck // for historical reasons if err != nil { return err diff --git a/platforms/raspi/pwm_pin_test.go b/platforms/raspi/pwm_pin_test.go index 340fa6bc..a3c7d686 100644 --- a/platforms/raspi/pwm_pin_test.go +++ b/platforms/raspi/pwm_pin_test.go @@ -29,12 +29,12 @@ func TestPwmPin(t *testing.T) { val, _ = pin.Polarity() gobottest.Assert(t, val, true) - period, err := pin.Period() + _, err := pin.Period() gobottest.Assert(t, err, errors.New("Raspi PWM pin period not set")) gobottest.Assert(t, pin.SetDutyCycle(10000), errors.New("Raspi PWM pin period not set")) gobottest.Assert(t, pin.SetPeriod(20000000), nil) - period, _ = pin.Period() + period, _ := pin.Period() gobottest.Assert(t, period, uint32(20000000)) gobottest.Assert(t, pin.SetPeriod(10000000), errors.New("Cannot set the period of individual PWM pins on Raspi")) diff --git a/platforms/raspi/raspi_adaptor_test.go b/platforms/raspi/raspi_adaptor_test.go index 5b00c4b2..93f1199c 100644 --- a/platforms/raspi/raspi_adaptor_test.go +++ b/platforms/raspi/raspi_adaptor_test.go @@ -230,7 +230,7 @@ func TestPWMPinsReConnect(t *testing.T) { // assert gobottest.Assert(t, err, nil) gobottest.Assert(t, len(a.pwmPins), 0) - _, err = a.PWMPin("35") + _, _ = a.PWMPin("35") _, err = a.PWMPin("36") gobottest.Assert(t, err, nil) gobottest.Assert(t, len(a.pwmPins), 2) diff --git a/platforms/tinkerboard/adaptor.go b/platforms/tinkerboard/adaptor.go index 5b41cf55..f05b6b1c 100644 --- a/platforms/tinkerboard/adaptor.go +++ b/platforms/tinkerboard/adaptor.go @@ -156,7 +156,7 @@ func (c *Adaptor) translatePWMPin(id string) (string, int, error) { func (p pwmPinDefinition) findPWMDir(sys *system.Accesser) (dir string, err error) { items, _ := sys.Find(p.dir, p.dirRegexp) - if items == nil || len(items) == 0 { + if len(items) == 0 { return "", fmt.Errorf("No path found for PWM directory pattern, '%s' in path '%s'. See README.md for activation", p.dirRegexp, p.dir) } diff --git a/platforms/upboard/up2/adaptor.go b/platforms/upboard/up2/adaptor.go index 025a874e..59a00fd6 100644 --- a/platforms/upboard/up2/adaptor.go +++ b/platforms/upboard/up2/adaptor.go @@ -52,8 +52,9 @@ type Adaptor struct { // NewAdaptor creates a UP2 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#.# +// +// adaptors.WithGpiodAccess(): use character device gpiod driver instead of sysfs +// adaptors.WithSpiGpioAccess(sclk, nss, mosi, miso): use GPIO's instead of /dev/spidev#.# func NewAdaptor(opts ...func(adaptors.Optioner)) *Adaptor { sys := system.NewAccesser() c := &Adaptor{ @@ -125,7 +126,7 @@ func (c *Adaptor) DigitalWrite(id string, val byte) error { if id == LEDRed || id == LEDBlue || id == LEDGreen || id == LEDYellow { pinPath := fmt.Sprintf(c.ledPath, id) fi, err := c.sys.OpenFile(pinPath, os.O_WRONLY|os.O_APPEND, 0666) - defer fi.Close() + defer fi.Close() //nolint:staticcheck // for historical reasons if err != nil { return err } diff --git a/robot_work_test.go b/robot_work_test.go index f7ff706a..761dd28c 100644 --- a/robot_work_test.go +++ b/robot_work_test.go @@ -94,7 +94,7 @@ func TestRobotAutomationFunctions(t *testing.T) { func collectStringKeysFromWorkRegistry(rwr *RobotWorkRegistry) []string { keys := make([]string, len(rwr.r)) - for k, _ := range rwr.r { + for k := range rwr.r { keys = append(keys, k) } return keys diff --git a/system/digitalpin_gpiod.go b/system/digitalpin_gpiod.go index 2781be9f..f3cb07ad 100644 --- a/system/digitalpin_gpiod.go +++ b/system/digitalpin_gpiod.go @@ -193,7 +193,7 @@ func digitalPinGpiodReconfigureLine(d *digitalPinGpiod, forceInput bool) error { if d.direction == IN || forceInput { if systemGpiodDebug { log.Printf("input (%s): debounce %s, edge %d, handler %t, inverse %t, bias %d", - id, d.debouncePeriod, d.edge, d.edgeEventHandler != nil, d.activeLow == true, d.bias) + id, d.debouncePeriod, d.edge, d.edgeEventHandler != nil, d.activeLow, d.bias) } opts = append(opts, gpiod.AsInput) if !forceInput && d.drive != digitalPinDrivePushPull && systemGpiodDebug { @@ -219,7 +219,7 @@ func digitalPinGpiodReconfigureLine(d *digitalPinGpiod, forceInput bool) error { } else { if systemGpiodDebug { log.Printf("ouput (%s): ini-state %d, drive %d, inverse %t, bias %d", - id, d.outInitialState, d.drive, d.activeLow == true, d.bias) + id, d.outInitialState, d.drive, d.activeLow, d.bias) } opts = append(opts, gpiod.AsOutput(d.outInitialState)) switch d.drive { diff --git a/system/digitalpin_mock.go b/system/digitalpin_mock.go index e22c5b27..9698721e 100644 --- a/system/digitalpin_mock.go +++ b/system/digitalpin_mock.go @@ -20,7 +20,6 @@ func (h *mockDigitalPinAccess) createPin(chip string, pin int, func (h *mockDigitalPinAccess) setFs(fs filesystem) { // do nothing - return } func (d *digitalPinMock) ApplyOptions(options ...func(gobot.DigitalPinOptioner) bool) error { diff --git a/system/digitalpin_sysfs.go b/system/digitalpin_sysfs.go index da5119ec..82a094c7 100644 --- a/system/digitalpin_sysfs.go +++ b/system/digitalpin_sysfs.go @@ -3,6 +3,7 @@ package system import ( "errors" "fmt" + "io" "log" "os" "strconv" @@ -238,7 +239,7 @@ var readFile = func(f File) ([]byte, error) { // TODO: Examine if seek is needed if full buffer is read from sysfs file. buf := make([]byte, 2) - _, err := f.Seek(0, os.SEEK_SET) + _, err := f.Seek(0, io.SeekStart) if err == nil { _, err = f.Read(buf) } diff --git a/system/digitalpin_sysfs_test.go b/system/digitalpin_sysfs_test.go index 8d88c5a7..9a39adc4 100644 --- a/system/digitalpin_sysfs_test.go +++ b/system/digitalpin_sysfs_test.go @@ -108,7 +108,7 @@ func TestDigitalPinExportError(t *testing.T) { } err := pin.Export() - gobottest.Assert(t, err.Error(), " : /sys/class/gpio/gpio10/direction: No such file.") + gobottest.Assert(t, err.Error(), " : /sys/class/gpio/gpio10/direction: no such file") } func TestDigitalPinUnexportError(t *testing.T) { diff --git a/system/fs_mock.go b/system/fs_mock.go index 9938cd79..5577fb84 100644 --- a/system/fs_mock.go +++ b/system/fs_mock.go @@ -118,7 +118,7 @@ func newMockFilesystem(items []string) *MockFilesystem { } // OpenFile opens file name from fs.Files, if the file does not exist it returns an os.PathError -func (fs *MockFilesystem) openFile(name string, flag int, perm os.FileMode) (file File, err error) { +func (fs *MockFilesystem) openFile(name string, _ int, _ os.FileMode) (file File, err error) { f, ok := fs.Files[name] if ok { f.Opened = true @@ -126,7 +126,7 @@ func (fs *MockFilesystem) openFile(name string, flag int, perm os.FileMode) (fil return f, nil } - return (*MockFile)(nil), &os.PathError{Err: fmt.Errorf("%s: No such file.", name)} + return (*MockFile)(nil), &os.PathError{Err: fmt.Errorf("%s: no such file", name)} } // Stat returns a generic FileInfo for all files in fs.Files. @@ -158,7 +158,7 @@ func (fs *MockFilesystem) stat(name string) (os.FileInfo, error) { } } - return nil, &os.PathError{Err: fmt.Errorf("%s: No such file.", name)} + return nil, &os.PathError{Err: fmt.Errorf("%s: no such file", name)} } // Find returns all items (files or folders) below the given directory matching the given pattern. @@ -173,10 +173,8 @@ func (fs *MockFilesystem) find(baseDir string, pattern string) ([]string, error) if !strings.HasPrefix(name, baseDir) { continue } - item := name[len(baseDir):] - if strings.HasPrefix(item, "/") { - item = item[1:] - } + item := strings.TrimPrefix(name[len(baseDir):], "/") + firstItem := strings.Split(item, "/")[0] if reg.MatchString(firstItem) { found = append(found, path.Join(baseDir, firstItem)) @@ -193,7 +191,7 @@ func (fs *MockFilesystem) readFile(name string) ([]byte, error) { f, ok := fs.Files[name] if !ok { - return nil, &os.PathError{Err: fmt.Errorf("%s: No such file.", name)} + return nil, &os.PathError{Err: fmt.Errorf("%s: no such file", name)} } return []byte(f.Contents), nil } diff --git a/system/fs_mock_test.go b/system/fs_mock_test.go index 0c18b7ac..0f988016 100644 --- a/system/fs_mock_test.go +++ b/system/fs_mock_test.go @@ -20,7 +20,7 @@ func TestMockFilesystemOpen(t *testing.T) { gobottest.Assert(t, err, nil) _, err = fs.openFile("bar", 0, 0666) - gobottest.Assert(t, err.Error(), " : bar: No such file.") + gobottest.Assert(t, err.Error(), " : bar: no such file") fs.Add("bar") f4, _ := fs.openFile("bar", 0, 0666) @@ -39,7 +39,7 @@ func TestMockFilesystemStat(t *testing.T) { gobottest.Assert(t, dirStat.IsDir(), true) _, err = fs.stat("plonk") - gobottest.Assert(t, err.Error(), " : plonk: No such file.") + gobottest.Assert(t, err.Error(), " : plonk: no such file") } func TestMockFilesystemFind(t *testing.T) { diff --git a/system/fs_test.go b/system/fs_test.go index 62ad5ab7..369a1882 100644 --- a/system/fs_test.go +++ b/system/fs_test.go @@ -9,7 +9,7 @@ import ( func TestFilesystemOpen(t *testing.T) { fs := &nativeFilesystem{} - file, err := fs.openFile(os.DevNull, os.O_RDONLY, 666) + file, err := fs.openFile(os.DevNull, os.O_RDONLY, 0666) gobottest.Assert(t, err, nil) var _ File = file } diff --git a/system/i2c_device_test.go b/system/i2c_device_test.go index 3e545b5f..94354080 100644 --- a/system/i2c_device_test.go +++ b/system/i2c_device_test.go @@ -548,7 +548,7 @@ func Test_queryFunctionality(t *testing.T) { "dev_null_error": { dev: os.DevNull, syscallImpl: getSyscallFuncImpl(0x00), - wantErr: " : /dev/null: No such file.", + wantErr: " : /dev/null: no such file", }, "query_funcs_error": { dev: dev, diff --git a/system/pwmpin_sysfs.go b/system/pwmpin_sysfs.go index 57ca264a..1b1cf78e 100644 --- a/system/pwmpin_sysfs.go +++ b/system/pwmpin_sysfs.go @@ -223,7 +223,7 @@ func (p *pwmPinSysFs) pwmPolarityPath() string { func writePwmFile(fs filesystem, path string, data []byte) (int, error) { file, err := fs.openFile(path, os.O_WRONLY, 0644) - defer file.Close() + defer file.Close() //nolint:staticcheck // for historical reasons if err != nil { return 0, err } @@ -233,7 +233,7 @@ func writePwmFile(fs filesystem, path string, data []byte) (int, error) { func readPwmFile(fs filesystem, path string) ([]byte, error) { file, err := fs.openFile(path, os.O_RDONLY, 0644) - defer file.Close() + defer file.Close() //nolint:staticcheck // for historical reasons if err != nil { return make([]byte, 0), err } @@ -260,7 +260,7 @@ func (p *pwmPinSysFs) printState() { fmt.Printf("DutyCycle: %v, ", duty) var powerPercent float64 if enabled { - if polarity == true { + if polarity { powerPercent = float64(duty) / float64(period) * 100 } else { powerPercent = float64(period) / float64(duty) * 100 diff --git a/utils.go b/utils.go index 46d5909b..5223c716 100644 --- a/utils.go +++ b/utils.go @@ -17,10 +17,8 @@ func Every(t time.Duration, f func()) *time.Ticker { go func() { for { - select { - case <-ticker.C: - f() - } + <-ticker.C + f() } }() From 949392d8a73fddd866dafeb01678357799eb5b7c Mon Sep 17 00:00:00 2001 From: Thomas Kohler Date: Sat, 20 May 2023 14:25:21 +0200 Subject: [PATCH 8/8] Fix(core): Semantic Import Versioning for v2 (#921) --- CONTRIBUTING.md | 2 +- README.md | 26 ++-- api/api.go | 4 +- api/api_test.go | 4 +- api/basic_auth_test.go | 2 +- api/cors_test.go | 2 +- api/doc.go | 42 ++--- api/helpers_test.go | 2 +- cli/generate.go | 14 +- cli/main.go | 4 +- commander_test.go | 2 +- doc.go | 146 +++++++++--------- drivers/aio/README.md | 25 +-- drivers/aio/analog_actuator_driver.go | 7 +- drivers/aio/analog_actuator_driver_test.go | 2 +- drivers/aio/analog_sensor_driver.go | 11 +- drivers/aio/analog_sensor_driver_test.go | 4 +- drivers/aio/doc.go | 4 +- drivers/aio/grove_drivers_test.go | 4 +- .../aio/grove_temperature_sensor_driver.go | 10 +- .../grove_temperature_sensor_driver_test.go | 4 +- drivers/aio/temperature_sensor_driver.go | 10 +- drivers/aio/temperature_sensor_driver_test.go | 2 +- drivers/common/mfrc522/mfrc522_pcd_test.go | 2 +- drivers/gpio/README.md | 47 +++--- drivers/gpio/aip1640_driver.go | 2 +- drivers/gpio/aip1640_driver_test.go | 4 +- drivers/gpio/button_driver.go | 8 +- drivers/gpio/button_driver_test.go | 4 +- drivers/gpio/buzzer_driver.go | 2 +- drivers/gpio/buzzer_driver_test.go | 4 +- drivers/gpio/direct_pin_driver.go | 11 +- drivers/gpio/direct_pin_driver_test.go | 4 +- drivers/gpio/doc.go | 4 +- drivers/gpio/easy_driver.go | 2 +- drivers/gpio/easy_driver_test.go | 4 +- drivers/gpio/grove_drivers_test.go | 4 +- drivers/gpio/hd44780_driver.go | 2 +- drivers/gpio/hd44780_driver_test.go | 4 +- drivers/gpio/led_driver.go | 3 +- drivers/gpio/led_driver_test.go | 4 +- drivers/gpio/makey_button_driver.go | 8 +- drivers/gpio/makey_button_driver_test.go | 4 +- drivers/gpio/max7219_driver.go | 2 +- drivers/gpio/max7219_driver_test.go | 4 +- drivers/gpio/motor_driver.go | 2 +- drivers/gpio/motor_driver_test.go | 4 +- drivers/gpio/pir_motion_driver.go | 8 +- drivers/gpio/pir_motion_driver_test.go | 4 +- drivers/gpio/relay_driver.go | 3 +- drivers/gpio/relay_driver_test.go | 4 +- drivers/gpio/rgb_led_driver.go | 7 +- drivers/gpio/rgb_led_driver_test.go | 4 +- drivers/gpio/servo_driver.go | 5 +- drivers/gpio/servo_driver_test.go | 4 +- drivers/gpio/stepper_driver.go | 2 +- drivers/gpio/stepper_driver_test.go | 2 +- drivers/gpio/tm1638_driver.go | 2 +- drivers/gpio/tm1638_driver_test.go | 4 +- drivers/i2c/README.md | 13 +- drivers/i2c/adafruit1109_driver.go | 4 +- drivers/i2c/adafruit1109_driver_test.go | 4 +- drivers/i2c/adafruit_driver.go | 9 +- drivers/i2c/adafruit_driver_test.go | 4 +- drivers/i2c/ads1x15_driver_1015_test.go | 2 +- drivers/i2c/ads1x15_driver_1115_test.go | 2 +- drivers/i2c/ads1x15_driver_test.go | 6 +- drivers/i2c/adxl345_driver_test.go | 4 +- drivers/i2c/bh1750_driver_test.go | 4 +- drivers/i2c/blinkm_driver_test.go | 4 +- drivers/i2c/bme280_driver.go | 9 +- drivers/i2c/bme280_driver_test.go | 4 +- drivers/i2c/bmp180_driver_test.go | 4 +- drivers/i2c/bmp280_driver_test.go | 4 +- drivers/i2c/bmp388_driver_test.go | 4 +- drivers/i2c/ccs811_driver_test.go | 4 +- drivers/i2c/doc.go | 4 +- drivers/i2c/drv2605l_driver_test.go | 4 +- drivers/i2c/generic_driver_test.go | 4 +- drivers/i2c/grove_drivers_test.go | 4 +- drivers/i2c/grovepi_driver_test.go | 30 ++-- drivers/i2c/hmc5883l_driver_test.go | 4 +- drivers/i2c/hmc6352_driver_test.go | 4 +- drivers/i2c/i2c_config_test.go | 2 +- drivers/i2c/i2c_connection.go | 2 +- drivers/i2c/i2c_connection_test.go | 7 +- drivers/i2c/i2c_driver.go | 2 +- drivers/i2c/i2c_driver_test.go | 4 +- drivers/i2c/ina3221_driver_test.go | 4 +- drivers/i2c/jhd1313m1_driver.go | 7 +- drivers/i2c/jhd1313m1_driver_test.go | 4 +- drivers/i2c/l3gd20h_driver_test.go | 4 +- drivers/i2c/lidarlite_driver_test.go | 4 +- drivers/i2c/mcp23017_driver.go | 23 +-- drivers/i2c/mcp23017_driver_test.go | 4 +- drivers/i2c/mfrc522_driver.go | 10 +- drivers/i2c/mma7660_driver_test.go | 4 +- drivers/i2c/mpl115a2_driver.go | 9 +- drivers/i2c/mpl115a2_driver_test.go | 4 +- drivers/i2c/mpu6050_driver_test.go | 4 +- drivers/i2c/pca9501_driver_test.go | 4 +- drivers/i2c/pca953x_driver_test.go | 4 +- drivers/i2c/pca9685_driver.go | 26 ++-- drivers/i2c/pca9685_driver_test.go | 6 +- drivers/i2c/pcf8583_driver_test.go | 4 +- drivers/i2c/pcf8591_driver_test.go | 4 +- drivers/i2c/sht2x_driver_test.go | 4 +- drivers/i2c/sht3x_driver_test.go | 4 +- drivers/i2c/ssd1306_driver_test.go | 4 +- drivers/i2c/th02_driver_test.go | 4 +- drivers/i2c/tsl2561_driver_test.go | 4 +- drivers/i2c/wiichuck_driver.go | 9 +- drivers/i2c/wiichuck_driver_test.go | 4 +- drivers/i2c/yl40_driver.go | 16 +- drivers/i2c/yl40_driver_test.go | 2 +- drivers/spi/README.md | 2 +- drivers/spi/apa102_test.go | 4 +- drivers/spi/doc.go | 6 +- drivers/spi/helpers_test.go | 4 +- drivers/spi/mcp3002_test.go | 6 +- drivers/spi/mcp3004_test.go | 6 +- drivers/spi/mcp3008_test.go | 6 +- drivers/spi/mcp3202.go | 15 +- drivers/spi/mcp3202_test.go | 6 +- drivers/spi/mcp3204.go | 15 +- drivers/spi/mcp3204_test.go | 6 +- drivers/spi/mcp3208.go | 15 +- drivers/spi/mcp3208_test.go | 6 +- drivers/spi/mcp3304.go | 15 +- drivers/spi/mcp3304_test.go | 6 +- drivers/spi/mfrc522_driver.go | 15 +- drivers/spi/mfrc522_driver_test.go | 4 +- drivers/spi/spi_connection.go | 2 +- drivers/spi/spi_connection_test.go | 6 +- drivers/spi/spi_driver.go | 2 +- drivers/spi/spi_driver_test.go | 4 +- drivers/spi/ssd1306_driver.go | 27 ++-- drivers/spi/ssd1306_driver_test.go | 4 +- eventer_test.go | 2 +- examples/ardrone.go | 6 +- examples/ardrone_face_tracking.go | 9 +- examples/ardrone_ps3.go | 8 +- examples/audio.go | 6 +- examples/batty.go | 6 +- examples/bb8-collision.go | 8 +- examples/bb8.go | 8 +- examples/beaglebone_basic_direct_pin.go | 6 +- examples/beaglebone_blink.go | 8 +- examples/beaglebone_blink_usr_led.go | 8 +- examples/beaglebone_blinkm.go | 8 +- examples/beaglebone_button.go | 8 +- examples/beaglebone_direct_pin.go | 8 +- examples/beaglebone_grove_accelerometer.go | 8 +- examples/beaglebone_led_brightness.go | 8 +- ...lebone_led_brightness_with_analog_input.go | 10 +- examples/beaglebone_makey_button.go | 8 +- examples/beaglebone_servo.go | 8 +- examples/bebop.go | 6 +- examples/bebop_ps3.go | 8 +- examples/bebop_ps3_video.go | 34 ++-- examples/bebop_rtp_video.go | 25 +-- examples/ble_battery.go | 6 +- examples/ble_device_info.go | 6 +- examples/ble_firmata_blink.go | 8 +- examples/ble_firmata_curie_imu.go | 10 +- examples/ble_generic_access.go | 6 +- examples/ble_multiple_generic.go | 8 +- examples/ble_multiple_info.go | 8 +- examples/chip_blink.go | 8 +- examples/chip_blinkm.go | 8 +- examples/chip_button.go | 8 +- examples/chip_button_led.go | 8 +- examples/chip_drv2605l.go | 8 +- examples/chip_grove_accelerometer.go | 8 +- examples/chip_grove_lcd.go | 8 +- examples/chip_mpu6050.go | 8 +- examples/chip_tsl2561.go | 8 +- examples/chip_wiichuck.go | 8 +- examples/digispark_api.go | 10 +- examples/digispark_blink.go | 8 +- examples/digispark_blinkm.go | 8 +- examples/digispark_driver.go | 8 +- examples/digispark_led_brightness.go | 8 +- examples/digispark_mpl115a2.go | 8 +- examples/digispark_pca9501.go | 8 +- examples/digispark_servo.go | 8 +- examples/dragonboard_button.go | 8 +- examples/edison_blink.go | 8 +- ...dison_blink_without_all_gobot_framework.go | 6 +- examples/edison_blinkm.go | 8 +- examples/edison_bme280.go | 8 +- examples/edison_button.go | 8 +- examples/edison_button_led.go | 8 +- examples/edison_button_led_api.go | 10 +- examples/edison_grove_accelerometer.go | 8 +- examples/edison_grove_blink.go | 8 +- examples/edison_grove_button.go | 8 +- examples/edison_grove_buzzer.go | 8 +- examples/edison_grove_lcd.go | 8 +- examples/edison_grove_led.go | 8 +- examples/edison_grove_light_sensor.go | 8 +- examples/edison_grove_piezo_vibration.go | 8 +- examples/edison_grove_rotary_sensor.go | 8 +- examples/edison_grove_sound_sensor.go | 8 +- examples/edison_grove_temperature_sensor.go | 8 +- examples/edison_grove_touch.go | 8 +- examples/edison_led_brightness.go | 8 +- ...edison_led_brightness_with_analog_input.go | 10 +- .../edison_miniboard_grove_accelerometer.go | 8 +- examples/edison_rgb_led.go | 8 +- examples/every_done.go | 4 +- examples/firmata_adxl345.go | 8 +- examples/firmata_aip1640.go | 8 +- examples/firmata_blink.go | 8 +- examples/firmata_blink_api.go | 10 +- examples/firmata_blink_metal.go | 6 +- examples/firmata_blink_robot.go | 8 +- examples/firmata_blinkm.go | 8 +- examples/firmata_bme280.go | 8 +- examples/firmata_bmp180.go | 8 +- examples/firmata_bmp280.go | 8 +- examples/firmata_button.go | 8 +- examples/firmata_buzzer.go | 8 +- examples/firmata_cat_toy.go | 10 +- examples/firmata_curie_imu.go | 10 +- examples/firmata_curie_imu_shock_detect.go | 10 +- examples/firmata_curie_imu_step_counter.go | 10 +- examples/firmata_curie_imu_tap_detect.go | 10 +- examples/firmata_direct_pin.go | 8 +- examples/firmata_gpio_max7219.go | 8 +- examples/firmata_grove_lcd.go | 8 +- examples/firmata_grove_sound_sensor.go | 8 +- examples/firmata_hmc6352.go | 8 +- examples/firmata_integration.go | 10 +- examples/firmata_led_brightness.go | 8 +- ...irmata_led_brightness_with_analog_input.go | 10 +- examples/firmata_lidarlite.go | 8 +- examples/firmata_makey_button.go | 8 +- examples/firmata_metal_button.go | 9 +- examples/firmata_mma7660.go | 8 +- examples/firmata_motor.go | 8 +- examples/firmata_mpl115a2.go | 8 +- examples/firmata_mpu6050.go | 8 +- examples/firmata_pca9685.go | 10 +- examples/firmata_pir_motion.go | 8 +- examples/firmata_rgb_led.go | 8 +- examples/firmata_servo.go | 8 +- examples/firmata_ssd1306.go | 8 +- examples/firmata_temp36.go | 6 +- examples/firmata_tm1638.go | 8 +- examples/firmata_travis.go | 8 +- examples/firmata_wiichuck.go | 8 +- examples/gopigo3.go | 8 +- examples/gopigo3_grove_button.go | 10 +- examples/gopigo3_grove_lcd.go | 10 +- examples/gopigo3_grove_light_sensor.go | 10 +- examples/gopigo3_led_brightness.go | 10 +- examples/gopigo3_servo.go | 10 +- examples/hello.go | 4 +- examples/hello_api.go | 6 +- examples/hello_api_auth.go | 6 +- examples/hello_api_custom.go | 6 +- examples/hello_api_video.go | 6 +- examples/holystone_hs200.go | 6 +- examples/jetson-nano_blink.go | 8 +- examples/jetson-nano_servo.go | 8 +- examples/joule_blink.go | 8 +- examples/joule_blinkm.go | 8 +- examples/joule_grove_lcd.go | 8 +- examples/joule_grove_rotary_sensor.go | 10 +- examples/joule_led_brightness.go | 8 +- .../joule_led_brightness_with_analog_input.go | 12 +- examples/joule_leds.go | 8 +- examples/joule_rgb_led.go | 8 +- examples/joystick_ps3.go | 6 +- examples/joystick_ps4.go | 6 +- examples/joystick_ps5.go | 4 +- examples/joystick_xbox360.go | 6 +- examples/joystick_xbox360_rock_band_drums.go | 6 +- examples/joystick_xboxone.go | 6 +- examples/keyboard.go | 6 +- examples/keyboard_mqtt.go | 8 +- examples/leap_motion.go | 6 +- examples/leap_motion_gestures.go | 6 +- examples/leap_motion_hands.go | 6 +- examples/leap_servos.go | 10 +- examples/leap_sphero.go | 8 +- examples/mavlink.go | 8 +- examples/megapi_motor.go | 6 +- examples/metal_button.go | 6 +- examples/microbit_accelerometer.go | 8 +- examples/microbit_blink.go | 10 +- examples/microbit_buttons.go | 8 +- examples/microbit_buttons_leds.go | 8 +- examples/microbit_io_button.go | 10 +- examples/microbit_led.go | 8 +- examples/microbit_magnetometer.go | 8 +- examples/microbit_temperature.go | 8 +- examples/minidrone.go | 8 +- examples/minidrone_events.go | 8 +- examples/minidrone_mambo_ps3.go | 10 +- examples/minidrone_ps3.go | 10 +- examples/mqtt_driver_ping.go | 11 +- examples/mqtt_firmata_blink.go | 10 +- examples/mqtt_ping.go | 6 +- examples/nanopi_direct_pin.go | 10 +- examples/nanopi_direct_pin_event.go | 8 +- examples/nanopi_led_brightness.go | 8 +- examples/nanopi_pca9533.go | 8 +- examples/nats.go | 6 +- examples/nats_driver_ping.go | 11 +- examples/neurosky.go | 6 +- examples/ollie.go | 8 +- examples/ollie_boost.go | 8 +- examples/ollie_crazy.go | 8 +- examples/ollie_mqtt.go | 10 +- examples/ollie_multiple.go | 10 +- examples/ollie_roll.go | 8 +- examples/ollie_spin.go | 8 +- examples/opencv_face_detect.go | 6 +- examples/opencv_window.go | 6 +- examples/particle_api.go | 10 +- examples/particle_blink.go | 8 +- examples/particle_button.go | 8 +- examples/particle_events.go | 6 +- examples/particle_function.go | 6 +- examples/particle_led_brightness.go | 8 +- examples/particle_variable.go | 6 +- examples/pebble.go | 8 +- examples/pebble_accelerometer.go | 8 +- examples/raspi_adafruit_dcmotor.go | 8 +- examples/raspi_adafruit_servo.go | 8 +- examples/raspi_adafruit_stepper.go | 8 +- examples/raspi_ads1015.go | 8 +- examples/raspi_blink.go | 8 +- examples/raspi_blinkm.go | 8 +- examples/raspi_button.go | 8 +- examples/raspi_ccs811.go | 8 +- examples/raspi_direct_pin.go | 10 +- examples/raspi_direct_pin_event.go | 8 +- examples/raspi_generic.go | 8 +- examples/raspi_grove_pi_blink.go | 10 +- examples/raspi_grove_pi_button.go | 10 +- examples/raspi_grove_pi_dht.go | 8 +- examples/raspi_grove_pi_rotary.go | 10 +- examples/raspi_grove_pi_ultrasonic.go | 8 +- examples/raspi_grove_rotary_sensor.go | 10 +- examples/raspi_hmc5883l.go | 8 +- examples/raspi_ina3221.go | 8 +- examples/raspi_led_brightness.go | 8 +- examples/raspi_mcp3008.go | 8 +- examples/raspi_pca9533.go | 8 +- examples/raspi_sht2x.go | 8 +- examples/raspi_sht3x.go | 8 +- examples/raspi_ssd1306.go | 8 +- examples/raspi_ssd1306spi.go | 8 +- examples/raspi_stepper_move.go | 8 +- examples/sphero.go | 6 +- examples/sphero_api.go | 8 +- examples/sphero_conways.go | 6 +- examples/sphero_dpad.go | 8 +- examples/sphero_master.go | 6 +- examples/sphero_multiple.go | 8 +- examples/sprkplus.go | 8 +- examples/sprkplus_collision.go | 8 +- examples/square.go | 10 +- examples/square_fire.go | 10 +- examples/tello.go | 6 +- examples/tello_facetracker.go | 8 +- examples/tello_keyboard.go | 8 +- examples/tello_opencv.go | 6 +- examples/tello_ps3.go | 8 +- examples/tello_video.go | 6 +- examples/tinkerboard_adafruit1109_lcd_keys.go | 8 +- examples/tinkerboard_ads1115.go | 8 +- examples/tinkerboard_adxl345.go | 8 +- examples/tinkerboard_blink.go | 8 +- examples/tinkerboard_bme280.go | 8 +- examples/tinkerboard_bmp280.go | 8 +- examples/tinkerboard_direct_pin.go | 10 +- examples/tinkerboard_generic.go | 8 +- examples/tinkerboard_grove_lcd.go | 8 +- examples/tinkerboard_hmc5883l.go | 8 +- examples/tinkerboard_mfcrc522gpio.go | 10 +- examples/tinkerboard_mfcrc522spi.go | 8 +- examples/tinkerboard_mpl115a2.go | 8 +- examples/tinkerboard_mpu6050.go | 8 +- examples/tinkerboard_pca9533.go | 8 +- examples/tinkerboard_pcf8583_clock.go | 8 +- examples/tinkerboard_pcf8583_counter.go | 8 +- examples/tinkerboard_pcf8591.go | 10 +- examples/tinkerboard_yl40.go | 8 +- examples/up2_lcd.go | 8 +- examples/up2_leds.go | 8 +- examples/wifi_firmata_analog_input.go | 8 +- examples/wifi_firmata_blink.go | 8 +- examples_test.go | 4 +- go.mod | 2 +- master_test.go | 2 +- platforms/adaptors/digitalpinsadaptor.go | 4 +- platforms/adaptors/digitalpinsadaptor_test.go | 8 +- platforms/adaptors/i2cbusadaptor.go | 6 +- platforms/adaptors/i2cbusadaptor_test.go | 6 +- platforms/adaptors/pwmpinsadaptor.go | 6 +- platforms/adaptors/pwmpinsadaptor_test.go | 8 +- platforms/adaptors/spibusadaptor.go | 4 +- platforms/adaptors/spibusadaptor_test.go | 6 +- platforms/audio/audio_adaptor.go | 11 +- platforms/audio/audio_adaptor_test.go | 4 +- platforms/audio/audio_driver.go | 6 +- platforms/audio/audio_driver_test.go | 4 +- platforms/audio/doc.go | 2 +- platforms/beaglebone/README.md | 14 +- platforms/beaglebone/beaglebone_adaptor.go | 6 +- .../beaglebone/beaglebone_adaptor_test.go | 14 +- platforms/beaglebone/doc.go | 10 +- platforms/beaglebone/pocketbeagle_adaptor.go | 6 +- platforms/ble/README.md | 6 +- platforms/ble/battery_driver.go | 2 +- platforms/ble/battery_driver_test.go | 4 +- platforms/ble/ble_client_adaptor.go | 2 +- platforms/ble/ble_client_adaptor_test.go | 4 +- platforms/ble/device_information_driver.go | 2 +- .../ble/device_information_driver_test.go | 4 +- platforms/ble/doc.go | 2 +- platforms/ble/generic_access_driver.go | 2 +- platforms/ble/generic_access_driver_test.go | 4 +- platforms/ble/serial_port_test.go | 2 +- platforms/chip/README.md | 8 +- platforms/chip/chip_adaptor.go | 11 +- platforms/chip/chip_adaptor_test.go | 10 +- platforms/chip/doc.go | 2 +- platforms/dexter/dexter.go | 2 +- platforms/dexter/gopigo3/README.md | 8 +- platforms/dexter/gopigo3/driver.go | 17 +- platforms/dexter/gopigo3/driver_test.go | 6 +- platforms/digispark/README.md | 8 +- platforms/digispark/digispark_adaptor.go | 4 +- platforms/digispark/digispark_adaptor_test.go | 6 +- platforms/digispark/digispark_i2c_test.go | 4 +- platforms/digispark/doc.go | 10 +- platforms/dji/dji.go | 3 +- platforms/dji/tello/README.md | 6 +- platforms/dji/tello/driver.go | 2 +- platforms/dji/tello/driver_test.go | 4 +- platforms/dji/tello/pitch_test.go | 2 +- platforms/dragonboard/README.md | 8 +- platforms/dragonboard/doc.go | 2 +- platforms/dragonboard/dragonboard_adaptor.go | 11 +- .../dragonboard/dragonboard_adaptor_test.go | 8 +- platforms/firmata/README.md | 14 +- platforms/firmata/ble_firmata_adaptor.go | 5 +- platforms/firmata/ble_firmata_adaptor_test.go | 5 +- platforms/firmata/client/client.go | 4 +- platforms/firmata/client/client_test.go | 2 +- platforms/firmata/client/examples/blink.go | 4 +- platforms/firmata/doc.go | 10 +- platforms/firmata/firmata_adaptor.go | 6 +- platforms/firmata/firmata_adaptor_test.go | 10 +- platforms/firmata/firmata_i2c.go | 17 +- platforms/firmata/firmata_i2c_test.go | 8 +- platforms/firmata/tcp_firmata_adaptor.go | 2 +- platforms/firmata/tcp_firmata_adaptor_test.go | 4 +- platforms/holystone/holystone.go | 3 +- platforms/holystone/hs200/README.md | 6 +- platforms/holystone/hs200/doc.go | 2 +- platforms/holystone/hs200/hs200_driver.go | 2 +- .../holystone/hs200/hs200_driver_test.go | 4 +- platforms/intel-iot/curie/README.md | 10 +- platforms/intel-iot/curie/doc.go | 2 +- platforms/intel-iot/curie/imu_driver.go | 4 +- platforms/intel-iot/curie/imu_driver_test.go | 8 +- platforms/intel-iot/edison/README.md | 10 +- platforms/intel-iot/edison/arduino_pinmap.go | 2 +- platforms/intel-iot/edison/doc.go | 2 +- platforms/intel-iot/edison/edison_adaptor.go | 6 +- .../intel-iot/edison/edison_adaptor_test.go | 12 +- platforms/intel-iot/intel-iot.go | 2 +- platforms/intel-iot/joule/README.md | 10 +- platforms/intel-iot/joule/doc.go | 2 +- platforms/intel-iot/joule/joule_adaptor.go | 11 +- .../intel-iot/joule/joule_adaptor_test.go | 10 +- platforms/jetson/README.md | 8 +- platforms/jetson/doc.go | 2 +- platforms/jetson/jetson_adaptor.go | 13 +- platforms/jetson/jetson_adaptor_test.go | 12 +- platforms/jetson/pwm_pin.go | 4 +- platforms/jetson/pwm_pin_test.go | 6 +- platforms/joystick/README.md | 6 +- platforms/joystick/doc.go | 8 +- platforms/joystick/joystick_adaptor.go | 2 +- platforms/joystick/joystick_adaptor_test.go | 4 +- platforms/joystick/joystick_driver.go | 2 +- platforms/joystick/joystick_driver_test.go | 4 +- platforms/keyboard/README.md | 6 +- platforms/keyboard/doc.go | 9 +- platforms/keyboard/keyboard_driver.go | 3 +- platforms/keyboard/keyboard_driver_test.go | 4 +- platforms/keyboard/keyboard_test.go | 2 +- platforms/leap/README.md | 6 +- platforms/leap/doc.go | 8 +- platforms/leap/leap_motion_adaptor.go | 2 +- platforms/leap/leap_motion_adaptor_test.go | 4 +- platforms/leap/leap_motion_driver.go | 20 +-- platforms/leap/leap_motion_driver_test.go | 4 +- platforms/mavlink/README.md | 8 +- platforms/mavlink/doc.go | 10 +- platforms/mavlink/mavlink_adaptor.go | 4 +- platforms/mavlink/mavlink_adaptor_test.go | 4 +- platforms/mavlink/mavlink_driver.go | 5 +- platforms/mavlink/mavlink_driver_test.go | 6 +- platforms/mavlink/mavlink_udp_adaptor.go | 2 +- platforms/mavlink/mavlink_udp_adaptor_test.go | 6 +- platforms/megapi/README.md | 6 +- platforms/megapi/doc.go | 2 +- platforms/megapi/megapi_adaptor.go | 2 +- platforms/megapi/motor_driver.go | 2 +- platforms/microbit/README.md | 16 +- platforms/microbit/accelerometer_driver.go | 4 +- .../microbit/accelerometer_driver_test.go | 4 +- platforms/microbit/button_driver.go | 4 +- platforms/microbit/button_driver_test.go | 4 +- platforms/microbit/doc.go | 2 +- platforms/microbit/helpers_test.go | 2 +- platforms/microbit/io_pin_driver.go | 4 +- platforms/microbit/io_pin_driver_test.go | 8 +- platforms/microbit/led_driver.go | 4 +- platforms/microbit/led_driver_test.go | 4 +- platforms/microbit/magnetometer_driver.go | 4 +- .../microbit/magnetometer_driver_test.go | 4 +- platforms/microbit/temperature_driver.go | 4 +- platforms/microbit/temperature_driver_test.go | 4 +- platforms/mqtt/README.md | 20 ++- platforms/mqtt/doc.go | 4 +- platforms/mqtt/mqtt_adaptor.go | 2 +- platforms/mqtt/mqtt_adaptor_test.go | 4 +- platforms/mqtt/mqtt_driver.go | 2 +- platforms/mqtt/mqtt_driver_test.go | 4 +- platforms/nanopi/README.md | 2 +- platforms/nanopi/doc.go | 2 +- platforms/nanopi/nanopi_adaptor.go | 21 +-- platforms/nanopi/nanopi_adaptor_test.go | 10 +- platforms/nats/README.md | 132 ++++++++-------- platforms/nats/doc.go | 6 +- platforms/nats/nats_adaptor.go | 2 +- platforms/nats/nats_adaptor_test.go | 4 +- platforms/nats/nats_driver.go | 2 +- platforms/nats/nats_driver_test.go | 4 +- platforms/neurosky/README.md | 6 +- platforms/neurosky/doc.go | 8 +- platforms/neurosky/neurosky_adaptor_test.go | 4 +- platforms/neurosky/neurosky_driver.go | 16 +- platforms/neurosky/neurosky_driver_test.go | 4 +- platforms/opencv/README.md | 6 +- platforms/opencv/camera_driver.go | 2 +- platforms/opencv/camera_driver_test.go | 4 +- platforms/opencv/doc.go | 10 +- platforms/opencv/utils_test.go | 2 +- platforms/opencv/window_driver.go | 2 +- platforms/opencv/window_driver_test.go | 4 +- platforms/parrot/ardrone/README.md | 6 +- platforms/parrot/ardrone/ardrone_adaptor.go | 5 +- .../parrot/ardrone/ardrone_adaptor_test.go | 4 +- platforms/parrot/ardrone/ardrone_driver.go | 5 +- .../parrot/ardrone/ardrone_driver_test.go | 4 +- platforms/parrot/ardrone/doc.go | 8 +- platforms/parrot/ardrone/pitch_test.go | 2 +- platforms/parrot/bebop/README.md | 6 +- platforms/parrot/bebop/bebop_adaptor.go | 4 +- platforms/parrot/bebop/bebop_adaptor_test.go | 4 +- platforms/parrot/bebop/bebop_driver.go | 2 +- platforms/parrot/bebop/bebop_driver_test.go | 4 +- .../parrot/bebop/client/examples/takeoff.go | 4 +- .../parrot/bebop/client/examples/video.go | 26 ++-- platforms/parrot/bebop/doc.go | 4 +- platforms/parrot/bebop/pitch_test.go | 2 +- platforms/parrot/minidrone/README.md | 8 +- platforms/parrot/minidrone/doc.go | 2 +- platforms/parrot/minidrone/helpers_test.go | 2 +- .../parrot/minidrone/minidrone_driver.go | 18 +-- .../parrot/minidrone/minidrone_driver_test.go | 4 +- platforms/parrot/minidrone/pitch_test.go | 2 +- platforms/parrot/parrot.go | 2 +- platforms/particle/README.md | 8 +- platforms/particle/adaptor.go | 2 +- platforms/particle/adaptor_test.go | 4 +- platforms/particle/doc.go | 10 +- platforms/pebble/README.md | 8 +- platforms/pebble/doc.go | 10 +- platforms/pebble/pebble_adaptor_test.go | 4 +- platforms/pebble/pebble_driver.go | 17 +- platforms/pebble/pebble_driver_test.go | 4 +- platforms/raspi/README.md | 8 +- platforms/raspi/doc.go | 2 +- platforms/raspi/pwm_pin.go | 4 +- platforms/raspi/pwm_pin_test.go | 6 +- platforms/raspi/raspi_adaptor.go | 21 +-- platforms/raspi/raspi_adaptor_test.go | 12 +- platforms/rockpi/README.md | 6 +- platforms/rockpi/doc.go | 2 +- platforms/rockpi/rockpi_adaptor.go | 6 +- platforms/rockpi/rockpi_adaptor_test.go | 5 +- platforms/sphero/README.md | 6 +- platforms/sphero/bb8/README.md | 8 +- platforms/sphero/bb8/bb8_driver.go | 6 +- platforms/sphero/bb8/bb8_driver_test.go | 4 +- platforms/sphero/bb8/bb8_packets.go | 2 +- platforms/sphero/bb8/doc.go | 2 +- platforms/sphero/bb8/helpers_test.go | 2 +- platforms/sphero/doc.go | 8 +- platforms/sphero/ollie/README.md | 8 +- platforms/sphero/ollie/doc.go | 2 +- platforms/sphero/ollie/helpers_test.go | 2 +- platforms/sphero/ollie/ollie_driver.go | 8 +- platforms/sphero/ollie/ollie_driver_test.go | 6 +- platforms/sphero/ollie/ollie_packets.go | 2 +- platforms/sphero/sphero_adaptor.go | 2 +- platforms/sphero/sphero_adaptor_test.go | 4 +- platforms/sphero/sphero_driver.go | 30 ++-- platforms/sphero/sphero_driver_test.go | 4 +- platforms/sphero/sprkplus/README.md | 8 +- platforms/sphero/sprkplus/doc.go | 2 +- platforms/sphero/sprkplus/helpers_test.go | 2 +- platforms/sphero/sprkplus/sprkplus_driver.go | 6 +- .../sphero/sprkplus/sprkplus_driver_test.go | 4 +- platforms/sphero/sprkplus/sprkplus_packets.go | 2 +- platforms/tinkerboard/README.md | 2 +- platforms/tinkerboard/adaptor.go | 16 +- platforms/tinkerboard/adaptor_test.go | 10 +- platforms/tinkerboard/doc.go | 2 +- platforms/upboard/up2/README.md | 2 +- platforms/upboard/up2/adaptor.go | 6 +- platforms/upboard/up2/adaptor_test.go | 12 +- platforms/upboard/up2/doc.go | 2 +- platforms/upboard/upboard.go | 2 +- robot_test.go | 2 +- snapcraft.yaml | 4 +- system/digitalpin_access.go | 2 +- system/digitalpin_access_test.go | 2 +- system/digitalpin_config.go | 2 +- system/digitalpin_config_test.go | 4 +- system/digitalpin_gpiod.go | 2 +- system/digitalpin_gpiod_test.go | 4 +- system/digitalpin_mock.go | 2 +- system/digitalpin_sysfs.go | 2 +- system/digitalpin_sysfs_test.go | 4 +- system/doc.go | 2 +- system/fs_mock_test.go | 2 +- system/fs_test.go | 2 +- system/i2c_device_test.go | 4 +- system/pwmpin_sysfs_test.go | 4 +- system/spi_access.go | 2 +- system/spi_access_test.go | 2 +- system/spi_gpio.go | 2 +- system/spi_mock.go | 2 +- system/system.go | 2 +- system/system_options.go | 2 +- system/system_test.go | 2 +- utils_test.go | 2 +- 659 files changed, 2659 insertions(+), 2055 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 69fa1256..aa7ca2e4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -59,7 +59,7 @@ The basics are as follows: 2. `go get` the upstream repo and set it up as the `upstream` remote and your own repo as the `origin` remote: - `go get gobot.io/x/gobot` + `go get gobot.io/x/gobot/v2` `cd $GOPATH/src/gobot.io/x/gobot` `git remote rename origin upstream` `git remote add origin git@github.com/YOUR_GITHUB_NAME/gobot` diff --git a/README.md b/README.md index 4a335eee..029d3586 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ [![Gobot](https://raw.githubusercontent.com/hybridgroup/gobot-site/master/source/images/elements/gobot-logo-small.png)](http://gobot.io/) -[![GoDoc](https://godoc.org/gobot.io/x/gobot?status.svg)](https://godoc.org/gobot.io/x/gobot) +[![GoDoc](https://godoc.org/gobot.io/x/gobot/v2?status.svg)](https://godoc.org/gobot.io/x/gobot/v2) [![CircleCI Build status](https://circleci.com/gh/hybridgroup/gobot/tree/dev.svg?style=svg)](https://circleci.com/gh/hybridgroup/gobot/tree/dev) [![Appveyor Build status](https://ci.appveyor.com/api/projects/status/ix29evnbdrhkr7ud/branch/dev?svg=true)](https://ci.appveyor.com/project/deadprogram/gobot/branch/dev) [![codecov](https://codecov.io/gh/hybridgroup/gobot/branch/dev/graph/badge.svg)](https://codecov.io/gh/hybridgroup/gobot) @@ -17,7 +17,7 @@ Want to run Go directly on microcontrollers? Check out our sister project TinyGo ## Getting Started -Get the Gobot package by running this command: `go get -d -u gobot.io/x/gobot` +Get the Gobot package by running this command: `go get -d -u gobot.io/x/gobot/v2` ## Examples @@ -29,9 +29,9 @@ package main import ( "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/firmata" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/firmata" ) func main() { @@ -63,8 +63,8 @@ import ( "fmt" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/sphero" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/sphero" ) func main() { @@ -96,8 +96,8 @@ the various Gobot packages to control hardware with nothing but pure idiomatic G package main import ( - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/intel-iot/edison" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/intel-iot/edison" "time" ) @@ -127,9 +127,9 @@ import ( "fmt" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/api" - "gobot.io/x/gobot/platforms/sphero" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/api" + "gobot.io/x/gobot/v2/platforms/sphero" ) func NewSwarmBot(port string) *gobot.Robot { @@ -329,7 +329,7 @@ More platforms and drivers are coming soon... Gobot includes a RESTful API to query the status of any robot running within a group, including the connection and device status, and execute device commands. -To activate the API, import the `gobot.io/x/gobot/api` package and instantiate the `API` like this: +To activate the API, import the `gobot.io/x/gobot/v2/api` package and instantiate the `API` like this: ```go master := gobot.NewMaster() diff --git a/api/api.go b/api/api.go index 26b14a16..4efeda1b 100644 --- a/api/api.go +++ b/api/api.go @@ -10,8 +10,8 @@ import ( "strings" "github.com/bmizerany/pat" - "gobot.io/x/gobot" - "gobot.io/x/gobot/api/robeaux" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/api/robeaux" ) // API represents an API server diff --git a/api/api_test.go b/api/api_test.go index d08b40fa..2d193947 100644 --- a/api/api_test.go +++ b/api/api_test.go @@ -11,8 +11,8 @@ import ( "testing" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) func initTestAPI() *API { diff --git a/api/basic_auth_test.go b/api/basic_auth_test.go index 9d25782c..acf0aa3c 100644 --- a/api/basic_auth_test.go +++ b/api/basic_auth_test.go @@ -5,7 +5,7 @@ import ( "net/http/httptest" "testing" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2/gobottest" ) func TestBasicAuth(t *testing.T) { diff --git a/api/cors_test.go b/api/cors_test.go index 9720da20..0e63674f 100644 --- a/api/cors_test.go +++ b/api/cors_test.go @@ -5,7 +5,7 @@ import ( "net/http/httptest" "testing" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2/gobottest" ) func TestCORSIsOriginAllowed(t *testing.T) { diff --git a/api/doc.go b/api/doc.go index f548f70d..afc26791 100644 --- a/api/doc.go +++ b/api/doc.go @@ -3,35 +3,35 @@ Package api provides a webserver to interact with your Gobot program over the ne Example: - package main + package main - import ( - "fmt" + import ( + "fmt" - "gobot.io/x/gobot" - "gobot.io/x/gobot/api" - ) + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/api" + ) - func main() { - gbot := gobot.NewMaster() + func main() { + gbot := gobot.NewMaster() - // Starts the API server on default port 3000 - api.NewAPI(gbot).Start() + // Starts the API server on default port 3000 + api.NewAPI(gbot).Start() - // Accessible via http://localhost:3000/api/commands/say_hello - gbot.AddCommand("say_hello", func(params map[string]interface{}) interface{} { - return "Master says hello!" - }) + // Accessible via http://localhost:3000/api/commands/say_hello + gbot.AddCommand("say_hello", func(params map[string]interface{}) interface{} { + return "Master says hello!" + }) - hello := gbot.AddRobot(gobot.NewRobot("Eve")) + hello := gbot.AddRobot(gobot.NewRobot("Eve")) - // Accessible via http://localhost:3000/api/robots/Eve/commands/say_hello - hello.AddCommand("say_hello", func(params map[string]interface{}) interface{} { - return fmt.Sprintf("%v says hello!", hello.Name) - }) + // Accessible via http://localhost:3000/api/robots/Eve/commands/say_hello + hello.AddCommand("say_hello", func(params map[string]interface{}) interface{} { + return fmt.Sprintf("%v says hello!", hello.Name) + }) - gbot.Start() - } + gbot.Start() + } It follows Common Protocol for Programming Physical Input and Output (CPPP-IO) spec: https://gobot.io/x/cppp-io diff --git a/api/helpers_test.go b/api/helpers_test.go index 15fdd754..0a333687 100644 --- a/api/helpers_test.go +++ b/api/helpers_test.go @@ -3,7 +3,7 @@ package api import ( "fmt" - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" ) type NullReadWriteCloser struct{} diff --git a/cli/generate.go b/cli/generate.go index 82a2928c..e70531e9 100644 --- a/cli/generate.go +++ b/cli/generate.go @@ -189,7 +189,7 @@ func driver() string { import ( "time" - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" ) const Hello string = "hello" @@ -274,7 +274,7 @@ import ( "fmt" "time" - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" ) func main() { @@ -313,8 +313,8 @@ import ( "testing" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) var _ gobot.Driver = (*{{.UpperName}}Driver)(nil) @@ -368,8 +368,8 @@ func adaptorTest() string { import ( "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) var _ gobot.Adaptor = (*{{.UpperName}}Adaptor)(nil) @@ -398,7 +398,7 @@ Gobot (http://gobot.io/) is a framework for robotics and physical computing usin This repository contains the Gobot adaptor and driver for {{.Package}}. For more information about Gobot, check out the github repo at -https://gobot.io/x/gobot +https://gobot.io/x/gobot/v2 ## Installing ` + "```bash\ngo get path/to/repo/{{.Package}}\n```" + ` diff --git a/cli/main.go b/cli/main.go index fb888e70..9dffc7f4 100644 --- a/cli/main.go +++ b/cli/main.go @@ -4,14 +4,14 @@ import ( "os" "github.com/urfave/cli" - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" ) func main() { app := cli.NewApp() app.Name = "gobot" app.Author = "The Gobot team" - app.Email = "https://gobot.io/x/gobot" + app.Email = "https://gobot.io/x/gobot/v2" app.Version = gobot.Version() app.Usage = "Command Line Utility for generating new Gobot adaptors, drivers, and platforms" app.Commands = []cli.Command{ diff --git a/commander_test.go b/commander_test.go index ab5e07ff..074581c7 100644 --- a/commander_test.go +++ b/commander_test.go @@ -3,7 +3,7 @@ package gobot import ( "testing" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2/gobottest" ) func TestCommaner(t *testing.T) { diff --git a/doc.go b/doc.go index 636f2b6b..0d3f9267 100644 --- a/doc.go +++ b/doc.go @@ -5,129 +5,129 @@ Package gobot is the primary entrypoint for Gobot (http://gobot.io), a framework It provides a simple, yet powerful way to create solutions that incorporate multiple, different hardware devices at the same time. -Classic Gobot +# Classic Gobot Here is a "Classic Gobot" program that blinks an LED using an Arduino: package main import ( - "time" + "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/firmata" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/firmata" ) func main() { - firmataAdaptor := firmata.NewAdaptor("/dev/ttyACM0") - led := gpio.NewLedDriver(firmataAdaptor, "13") + firmataAdaptor := firmata.NewAdaptor("/dev/ttyACM0") + led := gpio.NewLedDriver(firmataAdaptor, "13") - work := func() { - gobot.Every(1*time.Second, func() { - led.Toggle() - }) - } + work := func() { + gobot.Every(1*time.Second, func() { + led.Toggle() + }) + } - robot := gobot.NewRobot("bot", - []gobot.Connection{firmataAdaptor}, - []gobot.Device{led}, - work, - ) + robot := gobot.NewRobot("bot", + []gobot.Connection{firmataAdaptor}, + []gobot.Device{led}, + work, + ) - robot.Start() + robot.Start() } -Metal Gobot +# Metal Gobot You can also use Metal Gobot and pick and choose from the various Gobot packages to control hardware with nothing but pure idiomatic Golang code. For example: package main import ( - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/intel-iot/edison" - "time" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/intel-iot/edison" + "time" ) func main() { - e := edison.NewAdaptor() - e.Connect() + e := edison.NewAdaptor() + e.Connect() - led := gpio.NewLedDriver(e, "13") - led.Start() + led := gpio.NewLedDriver(e, "13") + led.Start() - for { - led.Toggle() - time.Sleep(1000 * time.Millisecond) - } + for { + led.Toggle() + time.Sleep(1000 * time.Millisecond) + } } -Master Gobot +# Master Gobot Finally, you can use Master Gobot to add the complete Gobot API or control swarms of Robots: package main import ( - "fmt" - "time" + "fmt" + "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/api" - "gobot.io/x/gobot/platforms/sphero" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/api" + "gobot.io/x/gobot/v2/platforms/sphero" ) func NewSwarmBot(port string) *gobot.Robot { - spheroAdaptor := sphero.NewAdaptor(port) - spheroDriver := sphero.NewSpheroDriver(spheroAdaptor) - spheroDriver.SetName("Sphero" + port) + spheroAdaptor := sphero.NewAdaptor(port) + spheroDriver := sphero.NewSpheroDriver(spheroAdaptor) + spheroDriver.SetName("Sphero" + port) - work := func() { - spheroDriver.Stop() + work := func() { + spheroDriver.Stop() - spheroDriver.On(sphero.Collision, func(data interface{}) { - fmt.Println("Collision Detected!") - }) + spheroDriver.On(sphero.Collision, func(data interface{}) { + fmt.Println("Collision Detected!") + }) - gobot.Every(1*time.Second, func() { - spheroDriver.Roll(100, uint16(gobot.Rand(360))) - }) - gobot.Every(3*time.Second, func() { - spheroDriver.SetRGB(uint8(gobot.Rand(255)), - uint8(gobot.Rand(255)), - uint8(gobot.Rand(255)), - ) - }) - } + gobot.Every(1*time.Second, func() { + spheroDriver.Roll(100, uint16(gobot.Rand(360))) + }) + gobot.Every(3*time.Second, func() { + spheroDriver.SetRGB(uint8(gobot.Rand(255)), + uint8(gobot.Rand(255)), + uint8(gobot.Rand(255)), + ) + }) + } - robot := gobot.NewRobot("sphero", - []gobot.Connection{spheroAdaptor}, - []gobot.Device{spheroDriver}, - work, - ) + robot := gobot.NewRobot("sphero", + []gobot.Connection{spheroAdaptor}, + []gobot.Device{spheroDriver}, + work, + ) - return robot + return robot } func main() { - master := gobot.NewMaster() - api.NewAPI(master).Start() + master := gobot.NewMaster() + api.NewAPI(master).Start() - spheros := []string{ - "/dev/rfcomm0", - "/dev/rfcomm1", - "/dev/rfcomm2", - "/dev/rfcomm3", - } + spheros := []string{ + "/dev/rfcomm0", + "/dev/rfcomm1", + "/dev/rfcomm2", + "/dev/rfcomm3", + } - for _, port := range spheros { - master.AddRobot(NewSwarmBot(port)) - } + for _, port := range spheros { + master.AddRobot(NewSwarmBot(port)) + } - master.Start() + master.Start() } Copyright (c) 2013-2018 The Hybrid Group. Licensed under the Apache 2.0 license. */ -package gobot // import "gobot.io/x/gobot" +package gobot // import "gobot.io/x/gobot/v2" diff --git a/drivers/aio/README.md b/drivers/aio/README.md index 3123cfdd..eebf4e10 100644 --- a/drivers/aio/README.md +++ b/drivers/aio/README.md @@ -1,22 +1,27 @@ # AIO -This package provides drivers for [Analog Input/Output (AIO)](https://en.wikipedia.org/wiki/Analog-to-digital_converter) devices. It is normally used by connecting an adaptor such as [firmata](https://gobot.io/x/gobot/platforms/firmata) that supports the needed interfaces for analog devices. +This package provides drivers for [Analog Input/Output (AIO)](https://en.wikipedia.org/wiki/Analog-to-digital_converter) +devices. It is normally used by connecting an adaptor such as [BeagleBone](https://gobot.io/documentation/platforms/beaglebone/) +that supports the needed interfaces for analog devices. ## Getting Started ## Installing -``` -go get -d -u gobot.io/x/gobot/... + +```sh +go get -d -u gobot.io/x/gobot/v2/... ``` ## Hardware Support + Gobot has a extensible system for connecting to hardware devices. The following AIO devices are currently supported: - - Analog Sensor - - Analog Actuator - - Grove Light Sensor - - Grove Rotary Dial - - Grove Sound Sensor - - Grove Temperature Sensor - - Temperature Sensor (supports linear and NTC thermistor in normal and inverse mode) + +- Analog Sensor +- Analog Actuator +- Grove Light Sensor +- Grove Rotary Dial +- Grove Sound Sensor +- Grove Temperature Sensor +- Temperature Sensor (supports linear and NTC thermistor in normal and inverse mode) More drivers are coming soon... diff --git a/drivers/aio/analog_actuator_driver.go b/drivers/aio/analog_actuator_driver.go index 29b8327e..41b666bf 100644 --- a/drivers/aio/analog_actuator_driver.go +++ b/drivers/aio/analog_actuator_driver.go @@ -3,7 +3,7 @@ package aio import ( "strconv" - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" ) // AnalogActuatorDriver represents an analog actuator @@ -23,8 +23,9 @@ type AnalogActuatorDriver struct { // The default scaling is 1:1. An adjustable linear scaler is provided by the driver. // // Adds the following API Commands: -// "Write" - See AnalogActuator.Write -// "RawWrite" - See AnalogActuator.RawWrite +// +// "Write" - See AnalogActuator.Write +// "RawWrite" - See AnalogActuator.RawWrite func NewAnalogActuatorDriver(a AnalogWriter, pin string) *AnalogActuatorDriver { d := &AnalogActuatorDriver{ name: gobot.DefaultName("AnalogActuator"), diff --git a/drivers/aio/analog_actuator_driver_test.go b/drivers/aio/analog_actuator_driver_test.go index 06bfe39c..67c296ea 100644 --- a/drivers/aio/analog_actuator_driver_test.go +++ b/drivers/aio/analog_actuator_driver_test.go @@ -4,7 +4,7 @@ import ( "strings" "testing" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2/gobottest" ) func TestAnalogActuatorDriver(t *testing.T) { diff --git a/drivers/aio/analog_sensor_driver.go b/drivers/aio/analog_sensor_driver.go index d8c47fa4..fb8aaf2a 100644 --- a/drivers/aio/analog_sensor_driver.go +++ b/drivers/aio/analog_sensor_driver.go @@ -3,7 +3,7 @@ package aio import ( "time" - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" ) // AnalogSensorDriver represents an Analog Sensor @@ -26,11 +26,13 @@ type AnalogSensorDriver struct { // The default scaling is 1:1. An adjustable linear scaler is provided by the driver. // // Optionally accepts: -// time.Duration: Interval at which the AnalogSensor is polled for new information +// +// time.Duration: Interval at which the AnalogSensor is polled for new information // // Adds the following API Commands: -// "Read" - See AnalogDriverSensor.Read -// "ReadRaw" - See AnalogDriverSensor.ReadRaw +// +// "Read" - See AnalogDriverSensor.Read +// "ReadRaw" - See AnalogDriverSensor.ReadRaw func NewAnalogSensorDriver(a AnalogReader, pin string, v ...time.Duration) *AnalogSensorDriver { d := &AnalogSensorDriver{ name: gobot.DefaultName("AnalogSensor"), @@ -66,6 +68,7 @@ func NewAnalogSensorDriver(a AnalogReader, pin string, v ...time.Duration) *Anal // Start starts the AnalogSensorDriver and reads the sensor at the given interval. // Emits the Events: +// // Data int - Event is emitted on change and represents the current raw reading from the sensor. // Value float64 - Event is emitted on change and represents the current reading from the sensor. // Error error - Event is emitted on error reading from the sensor. diff --git a/drivers/aio/analog_sensor_driver_test.go b/drivers/aio/analog_sensor_driver_test.go index 097ff59e..f5f747d5 100644 --- a/drivers/aio/analog_sensor_driver_test.go +++ b/drivers/aio/analog_sensor_driver_test.go @@ -6,8 +6,8 @@ import ( "testing" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) var _ gobot.Driver = (*AnalogSensorDriver)(nil) diff --git a/drivers/aio/doc.go b/drivers/aio/doc.go index 4c25bf04..fec23b8d 100644 --- a/drivers/aio/doc.go +++ b/drivers/aio/doc.go @@ -3,9 +3,9 @@ Package aio provides Gobot drivers for Analog Input/Output devices. Installing: - go get -d -u gobot.io/x/gobot + go get -d -u gobot.io/x/gobot/v2 For further information refer to aio README: https://github.com/hybridgroup/gobot/blob/master/platforms/aio/README.md */ -package aio // import "gobot.io/x/gobot/drivers/aio" +package aio // import "gobot.io/x/gobot/v2/drivers/aio" diff --git a/drivers/aio/grove_drivers_test.go b/drivers/aio/grove_drivers_test.go index 18b51f8b..42511652 100644 --- a/drivers/aio/grove_drivers_test.go +++ b/drivers/aio/grove_drivers_test.go @@ -7,8 +7,8 @@ import ( "testing" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) type DriverAndPinner interface { diff --git a/drivers/aio/grove_temperature_sensor_driver.go b/drivers/aio/grove_temperature_sensor_driver.go index d52d8481..2998b981 100644 --- a/drivers/aio/grove_temperature_sensor_driver.go +++ b/drivers/aio/grove_temperature_sensor_driver.go @@ -3,7 +3,7 @@ package aio import ( "time" - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" ) var _ gobot.Driver = (*GroveTemperatureSensorDriver)(nil) @@ -18,11 +18,13 @@ type GroveTemperatureSensorDriver struct { // 10 Milliseconds given an AnalogReader and pin. // // Optionally accepts: -// time.Duration: Interval at which the sensor is polled for new information (given 0 switch the polling off) +// +// time.Duration: Interval at which the sensor is polled for new information (given 0 switch the polling off) // // Adds the following API Commands: -// "Read" - See AnalogDriverSensor.Read -// "ReadValue" - See AnalogDriverSensor.ReadValue +// +// "Read" - See AnalogDriverSensor.Read +// "ReadValue" - See AnalogDriverSensor.ReadValue func NewGroveTemperatureSensorDriver(a AnalogReader, pin string, v ...time.Duration) *GroveTemperatureSensorDriver { t := NewTemperatureSensorDriver(a, pin, v...) ntc := TemperatureSensorNtcConf{TC0: 25, R0: 10000.0, B: 3975} //Ohm, R25=10k diff --git a/drivers/aio/grove_temperature_sensor_driver_test.go b/drivers/aio/grove_temperature_sensor_driver_test.go index ae31f95a..df3585f0 100644 --- a/drivers/aio/grove_temperature_sensor_driver_test.go +++ b/drivers/aio/grove_temperature_sensor_driver_test.go @@ -6,8 +6,8 @@ import ( "testing" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) var _ gobot.Driver = (*GroveTemperatureSensorDriver)(nil) diff --git a/drivers/aio/temperature_sensor_driver.go b/drivers/aio/temperature_sensor_driver.go index cad51c24..f410e5c3 100644 --- a/drivers/aio/temperature_sensor_driver.go +++ b/drivers/aio/temperature_sensor_driver.go @@ -4,7 +4,7 @@ import ( "math" "time" - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" ) const kelvinOffset = 273.15 @@ -31,11 +31,13 @@ type TemperatureSensorDriver struct { // Linear scaling and NTC scaling is supported. // // Optionally accepts: -// time.Duration: Interval at which the sensor is polled for new information (given 0 switch the polling off) +// +// time.Duration: Interval at which the sensor is polled for new information (given 0 switch the polling off) // // Adds the following API Commands: -// "Read" - See AnalogDriverSensor.Read -// "ReadValue" - See AnalogDriverSensor.ReadValue +// +// "Read" - See AnalogDriverSensor.Read +// "ReadValue" - See AnalogDriverSensor.ReadValue func NewTemperatureSensorDriver(a AnalogReader, pin string, v ...time.Duration) *TemperatureSensorDriver { ad := NewAnalogSensorDriver(a, pin, v...) diff --git a/drivers/aio/temperature_sensor_driver_test.go b/drivers/aio/temperature_sensor_driver_test.go index 94f13a25..afc003d4 100644 --- a/drivers/aio/temperature_sensor_driver_test.go +++ b/drivers/aio/temperature_sensor_driver_test.go @@ -7,7 +7,7 @@ import ( "testing" "time" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2/gobottest" ) func TestTemperatureSensorDriver(t *testing.T) { diff --git a/drivers/common/mfrc522/mfrc522_pcd_test.go b/drivers/common/mfrc522/mfrc522_pcd_test.go index 2c0b00f1..b640fe2a 100644 --- a/drivers/common/mfrc522/mfrc522_pcd_test.go +++ b/drivers/common/mfrc522/mfrc522_pcd_test.go @@ -3,7 +3,7 @@ package mfrc522 import ( "testing" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2/gobottest" ) type busConnMock struct { diff --git a/drivers/gpio/README.md b/drivers/gpio/README.md index 802407d5..f2b420b9 100644 --- a/drivers/gpio/README.md +++ b/drivers/gpio/README.md @@ -1,33 +1,38 @@ # GPIO -This package provides drivers for [General Purpose Input/Output (GPIO)](https://en.wikipedia.org/wiki/General_Purpose_Input/Output) devices. It is normally used by connecting an adaptor such as [firmata](https://gobot.io/x/gobot/platforms/firmata) that supports the needed interfaces for GPIO devices. +This package provides drivers for [General Purpose Input/Output (GPIO)](https://en.wikipedia.org/wiki/General_Purpose_Input/Output) +devices. It is normally used by connecting an adaptor such as [Raspberry Pi](https://gobot.io/documentation/platforms/raspi/) +that supports the needed interfaces for GPIO devices. ## Getting Started ## Installing -``` -go get -d -u gobot.io/x/gobot/... + +```sh +go get -d -u gobot.io/x/gobot/v2/... ``` ## Hardware Support + Gobot has a extensible system for connecting to hardware devices. The following GPIO devices are currently supported: - - Button - - Buzzer - - Direct Pin - - Grove Button - - Grove Buzzer - - Grove LED - - Grove Magnetic Switch - - Grove Relay - - Grove Touch Sensor - - LED - - Makey Button - - Motor - - Proximity Infra Red (PIR) Motion Sensor - - Relay - - RGB LED - - Servo - - Stepper Motor - - TM1638 LED Controller + +- Button +- Buzzer +- Direct Pin +- Grove Button +- Grove Buzzer +- Grove LED +- Grove Magnetic Switch +- Grove Relay +- Grove Touch Sensor +- LED +- Makey Button +- Motor +- Proximity Infra Red (PIR) Motion Sensor +- Relay +- RGB LED +- Servo +- Stepper Motor +- TM1638 LED Controller More drivers are coming soon... diff --git a/drivers/gpio/aip1640_driver.go b/drivers/gpio/aip1640_driver.go index b25a2d6b..c8327cfa 100644 --- a/drivers/gpio/aip1640_driver.go +++ b/drivers/gpio/aip1640_driver.go @@ -3,7 +3,7 @@ package gpio import ( "time" - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" ) // Commands of the driver diff --git a/drivers/gpio/aip1640_driver_test.go b/drivers/gpio/aip1640_driver_test.go index cab83a0f..796ba8b4 100644 --- a/drivers/gpio/aip1640_driver_test.go +++ b/drivers/gpio/aip1640_driver_test.go @@ -4,8 +4,8 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) var _ gobot.Driver = (*AIP1640Driver)(nil) diff --git a/drivers/gpio/button_driver.go b/drivers/gpio/button_driver.go index 68e1585a..b5451de0 100644 --- a/drivers/gpio/button_driver.go +++ b/drivers/gpio/button_driver.go @@ -3,7 +3,7 @@ package gpio import ( "time" - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" ) // ButtonDriver Represents a digital Button @@ -22,7 +22,8 @@ type ButtonDriver struct { // 10 Milliseconds given a DigitalReader and pin. // // Optionally accepts: -// time.Duration: Interval at which the ButtonDriver is polled for new information +// +// time.Duration: Interval at which the ButtonDriver is polled for new information func NewButtonDriver(a DigitalReader, pin string, v ...time.Duration) *ButtonDriver { b := &ButtonDriver{ name: gobot.DefaultName("Button"), @@ -49,7 +50,8 @@ func NewButtonDriver(a DigitalReader, pin string, v ...time.Duration) *ButtonDri // Start starts the ButtonDriver and polls the state of the button at the given interval. // // Emits the Events: -// Push int - On button push +// +// Push int - On button push // Release int - On button release // Error error - On button error func (b *ButtonDriver) Start() (err error) { diff --git a/drivers/gpio/button_driver_test.go b/drivers/gpio/button_driver_test.go index fa3685e6..e1a161b1 100644 --- a/drivers/gpio/button_driver_test.go +++ b/drivers/gpio/button_driver_test.go @@ -6,8 +6,8 @@ import ( "testing" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) var _ gobot.Driver = (*ButtonDriver)(nil) diff --git a/drivers/gpio/buzzer_driver.go b/drivers/gpio/buzzer_driver.go index 4ede6bfb..5d1073d4 100644 --- a/drivers/gpio/buzzer_driver.go +++ b/drivers/gpio/buzzer_driver.go @@ -3,7 +3,7 @@ package gpio import ( "time" - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" ) // Some useful divider diff --git a/drivers/gpio/buzzer_driver_test.go b/drivers/gpio/buzzer_driver_test.go index f72798b0..7d1fac14 100644 --- a/drivers/gpio/buzzer_driver_test.go +++ b/drivers/gpio/buzzer_driver_test.go @@ -5,8 +5,8 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) var _ gobot.Driver = (*BuzzerDriver)(nil) diff --git a/drivers/gpio/direct_pin_driver.go b/drivers/gpio/direct_pin_driver.go index 67b25811..ebec0ca2 100644 --- a/drivers/gpio/direct_pin_driver.go +++ b/drivers/gpio/direct_pin_driver.go @@ -3,7 +3,7 @@ package gpio import ( "strconv" - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" ) // DirectPinDriver represents a GPIO pin @@ -17,10 +17,11 @@ type DirectPinDriver struct { // NewDirectPinDriver return a new DirectPinDriver given a Connection and pin. // // Adds the following API Commands: -// "DigitalRead" - See DirectPinDriver.DigitalRead -// "DigitalWrite" - See DirectPinDriver.DigitalWrite -// "PwmWrite" - See DirectPinDriver.PwmWrite -// "ServoWrite" - See DirectPinDriver.ServoWrite +// +// "DigitalRead" - See DirectPinDriver.DigitalRead +// "DigitalWrite" - See DirectPinDriver.DigitalWrite +// "PwmWrite" - See DirectPinDriver.PwmWrite +// "ServoWrite" - See DirectPinDriver.ServoWrite func NewDirectPinDriver(a gobot.Connection, pin string) *DirectPinDriver { d := &DirectPinDriver{ name: gobot.DefaultName("DirectPin"), diff --git a/drivers/gpio/direct_pin_driver_test.go b/drivers/gpio/direct_pin_driver_test.go index 6ecf7816..2a0815a4 100644 --- a/drivers/gpio/direct_pin_driver_test.go +++ b/drivers/gpio/direct_pin_driver_test.go @@ -5,8 +5,8 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) var _ gobot.Driver = (*DirectPinDriver)(nil) diff --git a/drivers/gpio/doc.go b/drivers/gpio/doc.go index 2a2ed36d..854ba6db 100644 --- a/drivers/gpio/doc.go +++ b/drivers/gpio/doc.go @@ -3,9 +3,9 @@ Package gpio provides Gobot drivers for General Purpose Input/Output devices. Installing: - go get -d -u gobot.io/x/gobot + go get -d -u gobot.io/x/gobot/v2 For further information refer to gpio README: https://github.com/hybridgroup/gobot/blob/master/platforms/gpio/README.md */ -package gpio // import "gobot.io/x/gobot/drivers/gpio" +package gpio // import "gobot.io/x/gobot/v2/drivers/gpio" diff --git a/drivers/gpio/easy_driver.go b/drivers/gpio/easy_driver.go index e77ec37a..3196b89e 100644 --- a/drivers/gpio/easy_driver.go +++ b/drivers/gpio/easy_driver.go @@ -5,7 +5,7 @@ import ( "strconv" "time" - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" ) // EasyDriver object diff --git a/drivers/gpio/easy_driver_test.go b/drivers/gpio/easy_driver_test.go index f96358d5..c873009e 100644 --- a/drivers/gpio/easy_driver_test.go +++ b/drivers/gpio/easy_driver_test.go @@ -1,10 +1,11 @@ package gpio import ( - "gobot.io/x/gobot/gobottest" "strings" "testing" "time" + + "gobot.io/x/gobot/v2/gobottest" ) const ( @@ -183,4 +184,3 @@ func TestEasyDriverDisable(t *testing.T) { gobottest.Assert(t, d.IsEnabled(), false) gobottest.Assert(t, d.IsMoving(), false) } - diff --git a/drivers/gpio/grove_drivers_test.go b/drivers/gpio/grove_drivers_test.go index d92ce3e0..3dd3e97b 100644 --- a/drivers/gpio/grove_drivers_test.go +++ b/drivers/gpio/grove_drivers_test.go @@ -7,8 +7,8 @@ import ( "testing" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) type DriverAndPinner interface { diff --git a/drivers/gpio/hd44780_driver.go b/drivers/gpio/hd44780_driver.go index 5fcfb306..1f23d910 100644 --- a/drivers/gpio/hd44780_driver.go +++ b/drivers/gpio/hd44780_driver.go @@ -6,7 +6,7 @@ import ( "sync" "time" - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" ) // Commands for the driver diff --git a/drivers/gpio/hd44780_driver_test.go b/drivers/gpio/hd44780_driver_test.go index 54a4b70d..d13d33a8 100644 --- a/drivers/gpio/hd44780_driver_test.go +++ b/drivers/gpio/hd44780_driver_test.go @@ -5,8 +5,8 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) var _ gobot.Driver = (*HD44780Driver)(nil) diff --git a/drivers/gpio/led_driver.go b/drivers/gpio/led_driver.go index fd2916e3..fd5f4197 100644 --- a/drivers/gpio/led_driver.go +++ b/drivers/gpio/led_driver.go @@ -1,6 +1,6 @@ package gpio -import "gobot.io/x/gobot" +import "gobot.io/x/gobot/v2" // LedDriver represents a digital Led type LedDriver struct { @@ -14,6 +14,7 @@ type LedDriver struct { // NewLedDriver return a new LedDriver given a DigitalWriter and pin. // // Adds the following API Commands: +// // "Brightness" - See LedDriver.Brightness // "Toggle" - See LedDriver.Toggle // "On" - See LedDriver.On diff --git a/drivers/gpio/led_driver_test.go b/drivers/gpio/led_driver_test.go index 59e39e83..b7a3b3cb 100644 --- a/drivers/gpio/led_driver_test.go +++ b/drivers/gpio/led_driver_test.go @@ -5,8 +5,8 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) var _ gobot.Driver = (*LedDriver)(nil) diff --git a/drivers/gpio/makey_button_driver.go b/drivers/gpio/makey_button_driver.go index 412a3ba1..fa3a3146 100644 --- a/drivers/gpio/makey_button_driver.go +++ b/drivers/gpio/makey_button_driver.go @@ -3,7 +3,7 @@ package gpio import ( "time" - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" ) // MakeyButtonDriver Represents a Makey Button @@ -21,7 +21,8 @@ type MakeyButtonDriver struct { // 10 Milliseconds given a DigitalReader and pin. // // Optionally accepts: -// time.Duration: Interval at which the ButtonDriver is polled for new information +// +// time.Duration: Interval at which the ButtonDriver is polled for new information func NewMakeyButtonDriver(a DigitalReader, pin string, v ...time.Duration) *MakeyButtonDriver { m := &MakeyButtonDriver{ name: gobot.DefaultName("MakeyButton"), @@ -59,7 +60,8 @@ func (b *MakeyButtonDriver) Connection() gobot.Connection { return b.connection. // Start starts the MakeyButtonDriver and polls the state of the button at the given interval. // // Emits the Events: -// Push int - On button push +// +// Push int - On button push // Release int - On button release // Error error - On button error func (b *MakeyButtonDriver) Start() (err error) { diff --git a/drivers/gpio/makey_button_driver_test.go b/drivers/gpio/makey_button_driver_test.go index 54ffcafd..cf5857fe 100644 --- a/drivers/gpio/makey_button_driver_test.go +++ b/drivers/gpio/makey_button_driver_test.go @@ -5,8 +5,8 @@ import ( "testing" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) var _ gobot.Driver = (*MakeyButtonDriver)(nil) diff --git a/drivers/gpio/max7219_driver.go b/drivers/gpio/max7219_driver.go index 9fad63f0..9693ec30 100644 --- a/drivers/gpio/max7219_driver.go +++ b/drivers/gpio/max7219_driver.go @@ -1,7 +1,7 @@ package gpio import ( - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" ) // Access and command constants for the driver diff --git a/drivers/gpio/max7219_driver_test.go b/drivers/gpio/max7219_driver_test.go index d1a7e43b..dda37438 100644 --- a/drivers/gpio/max7219_driver_test.go +++ b/drivers/gpio/max7219_driver_test.go @@ -4,8 +4,8 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) var _ gobot.Driver = (*MAX7219Driver)(nil) diff --git a/drivers/gpio/motor_driver.go b/drivers/gpio/motor_driver.go index 29f8e296..f14dc970 100644 --- a/drivers/gpio/motor_driver.go +++ b/drivers/gpio/motor_driver.go @@ -1,7 +1,7 @@ package gpio import ( - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" ) // MotorDriver Represents a Motor diff --git a/drivers/gpio/motor_driver_test.go b/drivers/gpio/motor_driver_test.go index 3ed03b70..e1107d6f 100644 --- a/drivers/gpio/motor_driver_test.go +++ b/drivers/gpio/motor_driver_test.go @@ -4,8 +4,8 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) var _ gobot.Driver = (*MotorDriver)(nil) diff --git a/drivers/gpio/pir_motion_driver.go b/drivers/gpio/pir_motion_driver.go index 97d7ad1b..f64d8b58 100644 --- a/drivers/gpio/pir_motion_driver.go +++ b/drivers/gpio/pir_motion_driver.go @@ -3,7 +3,7 @@ package gpio import ( "time" - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" ) // PIRMotionDriver represents a digital Proximity Infra Red (PIR) motion detecter @@ -21,7 +21,8 @@ type PIRMotionDriver struct { // 10 Milliseconds given a DigitalReader and pin. // // Optionally accepts: -// time.Duration: Interval at which the PIRMotionDriver is polled for new information +// +// time.Duration: Interval at which the PIRMotionDriver is polled for new information func NewPIRMotionDriver(a DigitalReader, pin string, v ...time.Duration) *PIRMotionDriver { b := &PIRMotionDriver{ name: gobot.DefaultName("PIRMotion"), @@ -47,7 +48,8 @@ func NewPIRMotionDriver(a DigitalReader, pin string, v ...time.Duration) *PIRMot // Start starts the PIRMotionDriver and polls the state of the sensor at the given interval. // // Emits the Events: -// MotionDetected - On motion detected +// +// MotionDetected - On motion detected // MotionStopped int - On motion stopped // Error error - On button error // diff --git a/drivers/gpio/pir_motion_driver_test.go b/drivers/gpio/pir_motion_driver_test.go index 5aa33c8f..7d73c575 100644 --- a/drivers/gpio/pir_motion_driver_test.go +++ b/drivers/gpio/pir_motion_driver_test.go @@ -6,8 +6,8 @@ import ( "testing" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) var _ gobot.Driver = (*PIRMotionDriver)(nil) diff --git a/drivers/gpio/relay_driver.go b/drivers/gpio/relay_driver.go index 8c811711..5a4861ef 100644 --- a/drivers/gpio/relay_driver.go +++ b/drivers/gpio/relay_driver.go @@ -1,6 +1,6 @@ package gpio -import "gobot.io/x/gobot" +import "gobot.io/x/gobot/v2" // RelayDriver represents a digital relay type RelayDriver struct { @@ -15,6 +15,7 @@ type RelayDriver struct { // NewRelayDriver return a new RelayDriver given a DigitalWriter and pin. // // Adds the following API Commands: +// // "Toggle" - See RelayDriver.Toggle // "On" - See RelayDriver.On // "Off" - See RelayDriver.Off diff --git a/drivers/gpio/relay_driver_test.go b/drivers/gpio/relay_driver_test.go index 82f2143c..bb347586 100644 --- a/drivers/gpio/relay_driver_test.go +++ b/drivers/gpio/relay_driver_test.go @@ -4,8 +4,8 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) var _ gobot.Driver = (*RelayDriver)(nil) diff --git a/drivers/gpio/rgb_led_driver.go b/drivers/gpio/rgb_led_driver.go index bdcf14ac..22116a15 100644 --- a/drivers/gpio/rgb_led_driver.go +++ b/drivers/gpio/rgb_led_driver.go @@ -1,6 +1,6 @@ package gpio -import "gobot.io/x/gobot" +import "gobot.io/x/gobot/v2" // RgbLedDriver represents a digital RGB Led type RgbLedDriver struct { @@ -20,6 +20,7 @@ type RgbLedDriver struct { // 3 pins: redPin, greenPin, and bluePin // // Adds the following API Commands: +// // "SetRGB" - See RgbLedDriver.SetRGB // "Toggle" - See RgbLedDriver.Toggle // "On" - See RgbLedDriver.On @@ -70,7 +71,9 @@ func (l *RgbLedDriver) Name() string { return l.name } func (l *RgbLedDriver) SetName(n string) { l.name = n } // Pin returns the RgbLedDrivers pins -func (l *RgbLedDriver) Pin() string { return "r=" + l.pinRed + ", g=" + l.pinGreen + ", b=" + l.pinBlue } +func (l *RgbLedDriver) Pin() string { + return "r=" + l.pinRed + ", g=" + l.pinGreen + ", b=" + l.pinBlue +} // RedPin returns the RgbLedDrivers redPin func (l *RgbLedDriver) RedPin() string { return l.pinRed } diff --git a/drivers/gpio/rgb_led_driver_test.go b/drivers/gpio/rgb_led_driver_test.go index 46d18665..b4fa5e82 100644 --- a/drivers/gpio/rgb_led_driver_test.go +++ b/drivers/gpio/rgb_led_driver_test.go @@ -5,8 +5,8 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) var _ gobot.Driver = (*RgbLedDriver)(nil) diff --git a/drivers/gpio/servo_driver.go b/drivers/gpio/servo_driver.go index 08ed82a5..53a560bf 100644 --- a/drivers/gpio/servo_driver.go +++ b/drivers/gpio/servo_driver.go @@ -1,6 +1,6 @@ package gpio -import "gobot.io/x/gobot" +import "gobot.io/x/gobot/v2" // ServoDriver Represents a Servo type ServoDriver struct { @@ -14,7 +14,8 @@ type ServoDriver struct { // NewServoDriver returns a new ServoDriver given a ServoWriter and pin. // // Adds the following API Commands: -// "Move" - See ServoDriver.Move +// +// "Move" - See ServoDriver.Move // "Min" - See ServoDriver.Min // "Center" - See ServoDriver.Center // "Max" - See ServoDriver.Max diff --git a/drivers/gpio/servo_driver_test.go b/drivers/gpio/servo_driver_test.go index e44bacb5..e58c4d46 100644 --- a/drivers/gpio/servo_driver_test.go +++ b/drivers/gpio/servo_driver_test.go @@ -5,8 +5,8 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) var _ gobot.Driver = (*ServoDriver)(nil) diff --git a/drivers/gpio/stepper_driver.go b/drivers/gpio/stepper_driver.go index 8810b024..427644a0 100644 --- a/drivers/gpio/stepper_driver.go +++ b/drivers/gpio/stepper_driver.go @@ -8,7 +8,7 @@ import ( "sync" "time" - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" ) type phase [][4]byte diff --git a/drivers/gpio/stepper_driver_test.go b/drivers/gpio/stepper_driver_test.go index 44d2d17a..56aefeb9 100644 --- a/drivers/gpio/stepper_driver_test.go +++ b/drivers/gpio/stepper_driver_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2/gobottest" ) const ( diff --git a/drivers/gpio/tm1638_driver.go b/drivers/gpio/tm1638_driver.go index e896d8ec..5c34593d 100644 --- a/drivers/gpio/tm1638_driver.go +++ b/drivers/gpio/tm1638_driver.go @@ -5,7 +5,7 @@ import ( "strings" - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" ) // Colors of the display diff --git a/drivers/gpio/tm1638_driver_test.go b/drivers/gpio/tm1638_driver_test.go index 9c4606b3..ccff9152 100644 --- a/drivers/gpio/tm1638_driver_test.go +++ b/drivers/gpio/tm1638_driver_test.go @@ -4,8 +4,8 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) var _ gobot.Driver = (*TM1638Driver)(nil) diff --git a/drivers/i2c/README.md b/drivers/i2c/README.md index a42141c2..6afa05cb 100644 --- a/drivers/i2c/README.md +++ b/drivers/i2c/README.md @@ -1,15 +1,19 @@ # I2C -This package provides drivers for [i2c](https://en.wikipedia.org/wiki/I%C2%B2C)devices. It must be used along with an adaptor such as [firmata](https://gobot.io/x/gobot/platforms/firmata) that supports the needed interfaces for i2c devices. +This package provides drivers for [i2c](https://en.wikipedia.org/wiki/I%C2%B2C)devices. It must be used along with an +adaptor such as [Tinker Board](https://gobot.io/documentation/platforms/tinkerboard/) that supports the needed +interfaces for i2c devices. ## Getting Started ## Installing -``` -go get -d -u gobot.io/x/gobot/... + +```sh +go get -d -u gobot.io/x/gobot/v2/... ``` ## Hardware Support + Gobot has a extensible system for connecting to hardware devices. The following i2c devices are currently supported: - Adafruit 2x16 RGB-LCD with 5 keys @@ -54,7 +58,8 @@ More drivers are coming soon... ## Using A Different Bus or Address -You can set a different I2C address or I2C bus than the default when initializing your I2C drivers by using optional parameters. Here is an example: +You can set a different I2C address or I2C bus than the default when initializing your I2C drivers by using optional +parameters. Here is an example: ```go blinkm := i2c.NewBlinkMDriver(e, i2c.WithBus(0), i2c.WithAddress(0x09)) diff --git a/drivers/i2c/adafruit1109_driver.go b/drivers/i2c/adafruit1109_driver.go index 42795edb..7bd4afa7 100644 --- a/drivers/i2c/adafruit1109_driver.go +++ b/drivers/i2c/adafruit1109_driver.go @@ -6,8 +6,8 @@ import ( "strconv" "strings" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" ) const adafruit1109Debug = false diff --git a/drivers/i2c/adafruit1109_driver_test.go b/drivers/i2c/adafruit1109_driver_test.go index 6db3e08a..9e9a1e3c 100644 --- a/drivers/i2c/adafruit1109_driver_test.go +++ b/drivers/i2c/adafruit1109_driver_test.go @@ -6,8 +6,8 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) var _ gobot.Driver = (*Adafruit1109Driver)(nil) diff --git a/drivers/i2c/adafruit_driver.go b/drivers/i2c/adafruit_driver.go index ee4c5995..1d534ebf 100644 --- a/drivers/i2c/adafruit_driver.go +++ b/drivers/i2c/adafruit_driver.go @@ -6,7 +6,7 @@ import ( "math" "time" - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" ) // AdafruitDirection declares a type for specification of the motor direction @@ -97,12 +97,13 @@ const ( // NewAdafruitMotorHatDriver initializes the internal DCMotor and StepperMotor types. // Again the Adafruit Motor Hat supports up to four DC motors and up to two stepper motors. // Params: -// conn Connector - the Adaptor to use with this Driver +// +// conn Connector - the Adaptor to use with this Driver // // Optional params: -// i2c.WithBus(int): bus to use with this driver -// i2c.WithAddress(int): address to use with this driver // +// i2c.WithBus(int): bus to use with this driver +// i2c.WithAddress(int): address to use with this driver func NewAdafruitMotorHatDriver(conn Connector, options ...func(Config)) *AdafruitMotorHatDriver { var dc []adaFruitDCMotor var st []adaFruitStepperMotor diff --git a/drivers/i2c/adafruit_driver_test.go b/drivers/i2c/adafruit_driver_test.go index 4d7ed219..4f2bbd6b 100644 --- a/drivers/i2c/adafruit_driver_test.go +++ b/drivers/i2c/adafruit_driver_test.go @@ -5,8 +5,8 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) // this ensures that the implementation implements the gobot.Driver interface diff --git a/drivers/i2c/ads1x15_driver_1015_test.go b/drivers/i2c/ads1x15_driver_1015_test.go index 69432d47..8e009bcd 100644 --- a/drivers/i2c/ads1x15_driver_1015_test.go +++ b/drivers/i2c/ads1x15_driver_1015_test.go @@ -5,7 +5,7 @@ import ( "strings" "testing" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2/gobottest" ) func initTestADS1015DriverWithStubbedAdaptor() (*ADS1x15Driver, *i2cTestAdaptor) { diff --git a/drivers/i2c/ads1x15_driver_1115_test.go b/drivers/i2c/ads1x15_driver_1115_test.go index 2730985d..617d39fa 100644 --- a/drivers/i2c/ads1x15_driver_1115_test.go +++ b/drivers/i2c/ads1x15_driver_1115_test.go @@ -5,7 +5,7 @@ import ( "strings" "testing" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2/gobottest" ) func initTestADS1115DriverWithStubbedAdaptor() (*ADS1x15Driver, *i2cTestAdaptor) { diff --git a/drivers/i2c/ads1x15_driver_test.go b/drivers/i2c/ads1x15_driver_test.go index 8575ce49..948a3659 100644 --- a/drivers/i2c/ads1x15_driver_test.go +++ b/drivers/i2c/ads1x15_driver_test.go @@ -4,9 +4,9 @@ import ( "errors" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/aio" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/aio" + "gobot.io/x/gobot/v2/gobottest" ) // this ensures that the implementation is based on i2c.Driver, which implements the gobot.Driver diff --git a/drivers/i2c/adxl345_driver_test.go b/drivers/i2c/adxl345_driver_test.go index e3eab82c..69719f94 100644 --- a/drivers/i2c/adxl345_driver_test.go +++ b/drivers/i2c/adxl345_driver_test.go @@ -5,8 +5,8 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) // this ensures that the implementation is based on i2c.Driver, which implements the gobot.Driver diff --git a/drivers/i2c/bh1750_driver_test.go b/drivers/i2c/bh1750_driver_test.go index 10c80a9b..9d8fc94a 100644 --- a/drivers/i2c/bh1750_driver_test.go +++ b/drivers/i2c/bh1750_driver_test.go @@ -7,8 +7,8 @@ import ( "bytes" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) // this ensures that the implementation is based on i2c.Driver, which implements the gobot.Driver diff --git a/drivers/i2c/blinkm_driver_test.go b/drivers/i2c/blinkm_driver_test.go index e7779c8f..2093b2b3 100644 --- a/drivers/i2c/blinkm_driver_test.go +++ b/drivers/i2c/blinkm_driver_test.go @@ -5,8 +5,8 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) // this ensures that the implementation is based on i2c.Driver, which implements the gobot.Driver diff --git a/drivers/i2c/bme280_driver.go b/drivers/i2c/bme280_driver.go index ac8a4e8e..bcb3bf0b 100644 --- a/drivers/i2c/bme280_driver.go +++ b/drivers/i2c/bme280_driver.go @@ -39,8 +39,8 @@ type bmeHumidityCalibrationCoefficients struct { // It implements all of the same functions as the BMP280Driver, but also // adds the Humidity() function by reading the BME280's humidity sensor. // For details on the BMP280Driver please see: -// https://godoc.org/gobot.io/x/gobot/drivers/i2c#BMP280Driver // +// https://godoc.org/gobot.io/x/gobot/v2/drivers/i2c#BMP280Driver type BME280Driver struct { *BMP280Driver humCalCoeffs *bmeHumidityCalibrationCoefficients @@ -49,12 +49,13 @@ type BME280Driver struct { // NewBME280Driver creates a new driver with specified i2c interface. // Params: -// conn Connector - the Adaptor to use with this Driver +// +// conn Connector - the Adaptor to use with this Driver // // Optional params: -// i2c.WithBus(int): bus to use with this driver -// i2c.WithAddress(int): address to use with this driver // +// i2c.WithBus(int): bus to use with this driver +// i2c.WithAddress(int): address to use with this driver func NewBME280Driver(c Connector, options ...func(Config)) *BME280Driver { d := &BME280Driver{ BMP280Driver: NewBMP280Driver(c), diff --git a/drivers/i2c/bme280_driver_test.go b/drivers/i2c/bme280_driver_test.go index f5a00a22..f90f8a23 100644 --- a/drivers/i2c/bme280_driver_test.go +++ b/drivers/i2c/bme280_driver_test.go @@ -6,8 +6,8 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) // this ensures that the implementation is based on i2c.Driver, which implements the gobot.Driver diff --git a/drivers/i2c/bmp180_driver_test.go b/drivers/i2c/bmp180_driver_test.go index d8225d3a..882c07a7 100644 --- a/drivers/i2c/bmp180_driver_test.go +++ b/drivers/i2c/bmp180_driver_test.go @@ -8,8 +8,8 @@ import ( "testing" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) // this ensures that the implementation is based on i2c.Driver, which implements the gobot.Driver diff --git a/drivers/i2c/bmp280_driver_test.go b/drivers/i2c/bmp280_driver_test.go index fbaa87b6..e312f182 100644 --- a/drivers/i2c/bmp280_driver_test.go +++ b/drivers/i2c/bmp280_driver_test.go @@ -6,8 +6,8 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) // this ensures that the implementation is based on i2c.Driver, which implements the gobot.Driver diff --git a/drivers/i2c/bmp388_driver_test.go b/drivers/i2c/bmp388_driver_test.go index 732ea5d7..7f273a97 100644 --- a/drivers/i2c/bmp388_driver_test.go +++ b/drivers/i2c/bmp388_driver_test.go @@ -7,8 +7,8 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) // this ensures that the implementation is based on i2c.Driver, which implements the gobot.Driver diff --git a/drivers/i2c/ccs811_driver_test.go b/drivers/i2c/ccs811_driver_test.go index 330a5208..b5c23c6b 100644 --- a/drivers/i2c/ccs811_driver_test.go +++ b/drivers/i2c/ccs811_driver_test.go @@ -5,8 +5,8 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) // this ensures that the implementation is based on i2c.Driver, which implements the gobot.Driver diff --git a/drivers/i2c/doc.go b/drivers/i2c/doc.go index f953fd4e..c112ada7 100644 --- a/drivers/i2c/doc.go +++ b/drivers/i2c/doc.go @@ -3,9 +3,9 @@ Package i2c provides Gobot drivers for i2c devices. Installing: - go get -d -u gobot.io/x/gobot + go get -d -u gobot.io/x/gobot/v2 For further information refer to i2c README: https://github.com/hybridgroup/gobot/blob/master/drivers/i2c/README.md */ -package i2c // import "gobot.io/x/gobot/drivers/i2c" +package i2c // import "gobot.io/x/gobot/v2/drivers/i2c" diff --git a/drivers/i2c/drv2605l_driver_test.go b/drivers/i2c/drv2605l_driver_test.go index 840b68d7..1b5b9773 100644 --- a/drivers/i2c/drv2605l_driver_test.go +++ b/drivers/i2c/drv2605l_driver_test.go @@ -7,8 +7,8 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) // this ensures that the implementation is based on i2c.Driver, which implements the gobot.Driver diff --git a/drivers/i2c/generic_driver_test.go b/drivers/i2c/generic_driver_test.go index ef224373..44d6d94d 100644 --- a/drivers/i2c/generic_driver_test.go +++ b/drivers/i2c/generic_driver_test.go @@ -4,8 +4,8 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) var _ gobot.Driver = (*GenericDriver)(nil) diff --git a/drivers/i2c/grove_drivers_test.go b/drivers/i2c/grove_drivers_test.go index ef18ba29..2d94f771 100644 --- a/drivers/i2c/grove_drivers_test.go +++ b/drivers/i2c/grove_drivers_test.go @@ -4,8 +4,8 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) var _ gobot.Driver = (*GroveLcdDriver)(nil) diff --git a/drivers/i2c/grovepi_driver_test.go b/drivers/i2c/grovepi_driver_test.go index 9ce5df17..7ccd27da 100644 --- a/drivers/i2c/grovepi_driver_test.go +++ b/drivers/i2c/grovepi_driver_test.go @@ -5,10 +5,10 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/aio" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/aio" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/gobottest" ) // this ensures that the implementation is based on i2c.Driver, which implements the gobot.Driver @@ -70,67 +70,67 @@ func TestGrovePiSomeRead(t *testing.T) { "DigitalRead": { usedPin: 2, wantWritten: []uint8{commandSetPinMode, 2, 0, 0, commandReadDigital, 2, 0, 0}, - simResponse: [][]uint8{[]uint8{0}, []uint8{commandReadDigital, 3}}, + simResponse: [][]uint8{{0}, {commandReadDigital, 3}}, wantCallsRead: 2, wantResult: 3, }, "AnalogRead": { usedPin: 3, wantWritten: []uint8{commandSetPinMode, 3, 0, 0, commandReadAnalog, 3, 0, 0}, - simResponse: [][]uint8{[]uint8{0}, []uint8{commandReadAnalog, 4, 5}}, + simResponse: [][]uint8{{0}, {commandReadAnalog, 4, 5}}, wantResult: 1029, }, "UltrasonicRead": { usedPin: 4, wantWritten: []uint8{commandSetPinMode, 4, 0, 0, commandReadUltrasonic, 4, 0, 0}, - simResponse: [][]uint8{[]uint8{0}, []uint8{commandReadUltrasonic, 5, 6}}, + simResponse: [][]uint8{{0}, {commandReadUltrasonic, 5, 6}}, wantResult: 1281, }, "FirmwareVersionRead": { wantWritten: []uint8{commandReadFirmwareVersion, 0, 0, 0}, - simResponse: [][]uint8{[]uint8{commandReadFirmwareVersion, 7, 8, 9}}, + simResponse: [][]uint8{{commandReadFirmwareVersion, 7, 8, 9}}, wantResultString: "7.8.9", }, "DHTRead": { usedPin: 5, wantWritten: []uint8{commandSetPinMode, 5, 0, 0, commandReadDHT, 5, 1, 0}, - simResponse: [][]uint8{[]uint8{0}, []uint8{commandReadDHT, 164, 112, 69, 193, 20, 174, 54, 66}}, + simResponse: [][]uint8{{0}, {commandReadDHT, 164, 112, 69, 193, 20, 174, 54, 66}}, wantResultF1: -12.34, wantResultF2: 45.67, }, "DigitalRead_error_wrong_return_cmd": { usedPin: 15, wantWritten: []uint8{commandSetPinMode, 15, 0, 0, commandReadDigital, 15, 0, 0}, - simResponse: [][]uint8{[]uint8{0}, []uint8{0, 2}}, + simResponse: [][]uint8{{0}, {0, 2}}, wantErr: fmt.Errorf("answer (0) was not for command (1)"), }, "AnalogRead_error_wrong_return_cmd": { usedPin: 16, wantWritten: []uint8{commandSetPinMode, 16, 0, 0, commandReadAnalog, 16, 0, 0}, - simResponse: [][]uint8{[]uint8{0}, []uint8{0, 3, 4}}, + simResponse: [][]uint8{{0}, {0, 3, 4}}, wantErr: fmt.Errorf("answer (0) was not for command (3)"), }, "UltrasonicRead_error_wrong_return_cmd": { usedPin: 17, wantWritten: []uint8{commandSetPinMode, 17, 0, 0, commandReadUltrasonic, 17, 0, 0}, - simResponse: [][]uint8{[]uint8{0}, []uint8{0, 5, 6}}, + simResponse: [][]uint8{{0}, {0, 5, 6}}, wantErr: fmt.Errorf("answer (0) was not for command (7)"), }, "FirmwareVersionRead_error_wrong_return_cmd": { wantWritten: []uint8{commandReadFirmwareVersion, 0, 0, 0}, - simResponse: [][]uint8{[]uint8{0, 7, 8, 9}}, + simResponse: [][]uint8{{0, 7, 8, 9}}, wantErr: fmt.Errorf("answer (0) was not for command (8)"), }, "DHTRead_error_wrong_return_cmd": { usedPin: 18, wantWritten: []uint8{commandSetPinMode, 18, 0, 0, commandReadDHT, 18, 1, 0}, - simResponse: [][]uint8{[]uint8{0}, []uint8{0, 164, 112, 69, 193, 20, 174, 54, 66}}, + simResponse: [][]uint8{{0}, {0, 164, 112, 69, 193, 20, 174, 54, 66}}, wantErr: fmt.Errorf("answer (0) was not for command (40)"), }, "DigitalRead_error_wrong_data_count": { usedPin: 28, wantWritten: []uint8{commandSetPinMode, 28, 0, 0, commandReadDigital, 28, 0, 0}, - simResponse: [][]uint8{[]uint8{0}, []uint8{commandReadDigital, 2, 3}}, + simResponse: [][]uint8{{0}, {commandReadDigital, 2, 3}}, wantErr: fmt.Errorf("read count mismatch (3 should be 2)"), }, } diff --git a/drivers/i2c/hmc5883l_driver_test.go b/drivers/i2c/hmc5883l_driver_test.go index 45889ee4..955ff550 100644 --- a/drivers/i2c/hmc5883l_driver_test.go +++ b/drivers/i2c/hmc5883l_driver_test.go @@ -4,8 +4,8 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) // this ensures that the implementation is based on i2c.Driver, which implements the gobot.Driver diff --git a/drivers/i2c/hmc6352_driver_test.go b/drivers/i2c/hmc6352_driver_test.go index 71400046..fa2e01c0 100644 --- a/drivers/i2c/hmc6352_driver_test.go +++ b/drivers/i2c/hmc6352_driver_test.go @@ -5,8 +5,8 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) // this ensures that the implementation is based on i2c.Driver, which implements the gobot.Driver diff --git a/drivers/i2c/i2c_config_test.go b/drivers/i2c/i2c_config_test.go index 6aea4b04..fac9087a 100644 --- a/drivers/i2c/i2c_config_test.go +++ b/drivers/i2c/i2c_config_test.go @@ -3,7 +3,7 @@ package i2c import ( "testing" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2/gobottest" ) func TestNewConfig(t *testing.T) { diff --git a/drivers/i2c/i2c_connection.go b/drivers/i2c/i2c_connection.go index 5bc1bd3b..178b9eab 100644 --- a/drivers/i2c/i2c_connection.go +++ b/drivers/i2c/i2c_connection.go @@ -3,7 +3,7 @@ package i2c import ( "fmt" - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" ) const ( diff --git a/drivers/i2c/i2c_connection_test.go b/drivers/i2c/i2c_connection_test.go index c1b36a2d..f8a1a17d 100644 --- a/drivers/i2c/i2c_connection_test.go +++ b/drivers/i2c/i2c_connection_test.go @@ -1,3 +1,4 @@ +//go:build !windows // +build !windows package i2c @@ -9,9 +10,9 @@ import ( "syscall" "unsafe" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" - "gobot.io/x/gobot/system" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" + "gobot.io/x/gobot/v2/system" ) const dev = "/dev/i2c-1" diff --git a/drivers/i2c/i2c_driver.go b/drivers/i2c/i2c_driver.go index 84f13d49..238e7ac4 100644 --- a/drivers/i2c/i2c_driver.go +++ b/drivers/i2c/i2c_driver.go @@ -6,7 +6,7 @@ import ( "strconv" "sync" - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" ) // Config is the interface to set and get I2C device related parameters. diff --git a/drivers/i2c/i2c_driver_test.go b/drivers/i2c/i2c_driver_test.go index 75c4e928..cb2b15f7 100644 --- a/drivers/i2c/i2c_driver_test.go +++ b/drivers/i2c/i2c_driver_test.go @@ -5,8 +5,8 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) var _ gobot.Driver = (*Driver)(nil) diff --git a/drivers/i2c/ina3221_driver_test.go b/drivers/i2c/ina3221_driver_test.go index 7eeeefbb..3564fd82 100644 --- a/drivers/i2c/ina3221_driver_test.go +++ b/drivers/i2c/ina3221_driver_test.go @@ -7,8 +7,8 @@ import ( "strings" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) // this ensures that the implementation is based on i2c.Driver, which implements the gobot.Driver diff --git a/drivers/i2c/jhd1313m1_driver.go b/drivers/i2c/jhd1313m1_driver.go index 847b44c1..25649f77 100644 --- a/drivers/i2c/jhd1313m1_driver.go +++ b/drivers/i2c/jhd1313m1_driver.go @@ -5,7 +5,7 @@ import ( "strconv" "time" - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" ) const ( @@ -86,11 +86,12 @@ type JHD1313M1Driver struct { // NewJHD1313M1Driver creates a new driver with specified i2c interface. // Params: -// conn Connector - the Adaptor to use with this Driver +// +// conn Connector - the Adaptor to use with this Driver // // Optional params: -// i2c.WithBus(int): bus to use with this driver // +// i2c.WithBus(int): bus to use with this driver func NewJHD1313M1Driver(a Connector, options ...func(Config)) *JHD1313M1Driver { j := &JHD1313M1Driver{ name: gobot.DefaultName("JHD1313M1"), diff --git a/drivers/i2c/jhd1313m1_driver_test.go b/drivers/i2c/jhd1313m1_driver_test.go index 934bc00a..87acf005 100644 --- a/drivers/i2c/jhd1313m1_driver_test.go +++ b/drivers/i2c/jhd1313m1_driver_test.go @@ -5,8 +5,8 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) var _ gobot.Driver = (*JHD1313M1Driver)(nil) diff --git a/drivers/i2c/l3gd20h_driver_test.go b/drivers/i2c/l3gd20h_driver_test.go index 7d84a443..e0816f84 100644 --- a/drivers/i2c/l3gd20h_driver_test.go +++ b/drivers/i2c/l3gd20h_driver_test.go @@ -5,8 +5,8 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) // this ensures that the implementation is based on i2c.Driver, which implements the gobot.Driver diff --git a/drivers/i2c/lidarlite_driver_test.go b/drivers/i2c/lidarlite_driver_test.go index 19e6bdb1..9a570fb2 100644 --- a/drivers/i2c/lidarlite_driver_test.go +++ b/drivers/i2c/lidarlite_driver_test.go @@ -6,8 +6,8 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) // this ensures that the implementation is based on i2c.Driver, which implements the gobot.Driver diff --git a/drivers/i2c/mcp23017_driver.go b/drivers/i2c/mcp23017_driver.go index 2e32d2f7..0746f576 100644 --- a/drivers/i2c/mcp23017_driver.go +++ b/drivers/i2c/mcp23017_driver.go @@ -5,7 +5,7 @@ import ( "log" "strings" - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" ) // default address for device when a2/a1/a0 pins are all tied to ground @@ -63,19 +63,20 @@ type MCP23017Driver struct { // NewMCP23017Driver creates a new Gobot Driver to the MCP23017 i2c port expander. // Params: -// c Connector - the Adaptor to use with this Driver +// +// c Connector - the Adaptor to use with this Driver // // Optional params: -// i2c.WithBus(int): bus to use with this driver -// i2c.WithAddress(int): address to use with this driver -// i2c.WithMCP23017Bank(int): MCP23017 bank to use with this driver -// i2c.WithMCP23017Mirror(int): MCP23017 mirror to use with this driver -// i2c.WithMCP23017Seqop(int): MCP23017 seqop to use with this driver -// i2c.WithMCP23017Disslw(int): MCP23017 disslw to use with this driver -// i2c.WithMCP23017Haen(int): MCP23017 haen to use with this driver -// i2c.WithMCP23017Odr(int): MCP23017 odr to use with this driver -// i2c.WithMCP23017Intpol(int): MCP23017 intpol to use with this driver // +// i2c.WithBus(int): bus to use with this driver +// i2c.WithAddress(int): address to use with this driver +// i2c.WithMCP23017Bank(int): MCP23017 bank to use with this driver +// i2c.WithMCP23017Mirror(int): MCP23017 mirror to use with this driver +// i2c.WithMCP23017Seqop(int): MCP23017 seqop to use with this driver +// i2c.WithMCP23017Disslw(int): MCP23017 disslw to use with this driver +// i2c.WithMCP23017Haen(int): MCP23017 haen to use with this driver +// i2c.WithMCP23017Odr(int): MCP23017 odr to use with this driver +// i2c.WithMCP23017Intpol(int): MCP23017 intpol to use with this driver func NewMCP23017Driver(c Connector, options ...func(Config)) *MCP23017Driver { d := &MCP23017Driver{ Driver: NewDriver(c, "MCP23017", mcp23017DefaultAddress), diff --git a/drivers/i2c/mcp23017_driver_test.go b/drivers/i2c/mcp23017_driver_test.go index 638dcb28..2026e1e4 100644 --- a/drivers/i2c/mcp23017_driver_test.go +++ b/drivers/i2c/mcp23017_driver_test.go @@ -5,8 +5,8 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) // this ensures that the implementation is based on i2c.Driver, which implements the gobot.Driver diff --git a/drivers/i2c/mfrc522_driver.go b/drivers/i2c/mfrc522_driver.go index 6c9caa30..91a782e5 100644 --- a/drivers/i2c/mfrc522_driver.go +++ b/drivers/i2c/mfrc522_driver.go @@ -1,7 +1,7 @@ package i2c import ( - "gobot.io/x/gobot/drivers/common/mfrc522" + "gobot.io/x/gobot/v2/drivers/common/mfrc522" ) const mfrc522DefaultAddress = 0x00 @@ -16,11 +16,13 @@ type MFRC522Driver struct { // NewMFRC522Driver creates a new Gobot Driver for MFRC522 RFID with i2c connection // // Params: -// c Connector - the Adaptor to use with this Driver +// +// c Connector - the Adaptor to use with this Driver // // Optional params: -// i2c.WithBus(int): bus to use with this driver -// i2c.WithAddress(int): address to use with this driver +// +// i2c.WithBus(int): bus to use with this driver +// i2c.WithAddress(int): address to use with this driver func NewMFRC522Driver(c Connector, options ...func(Config)) *MFRC522Driver { d := &MFRC522Driver{ Driver: NewDriver(c, "MFRC522", mfrc522DefaultAddress), diff --git a/drivers/i2c/mma7660_driver_test.go b/drivers/i2c/mma7660_driver_test.go index 1b298699..d44d0fa8 100644 --- a/drivers/i2c/mma7660_driver_test.go +++ b/drivers/i2c/mma7660_driver_test.go @@ -6,8 +6,8 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) // this ensures that the implementation is based on i2c.Driver, which implements the gobot.Driver diff --git a/drivers/i2c/mpl115a2_driver.go b/drivers/i2c/mpl115a2_driver.go index 0cb17207..40ea3fcc 100644 --- a/drivers/i2c/mpl115a2_driver.go +++ b/drivers/i2c/mpl115a2_driver.go @@ -1,7 +1,7 @@ package i2c import ( - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" "bytes" "encoding/binary" @@ -47,12 +47,13 @@ type MPL115A2Driver struct { // I2C Pressure/Temperature sensor. // // Params: -// c Connector - the Adaptor to use with this Driver +// +// c Connector - the Adaptor to use with this Driver // // Optional params: -// i2c.WithBus(int): bus to use with this driver -// i2c.WithAddress(int): address to use with this driver // +// i2c.WithBus(int): bus to use with this driver +// i2c.WithAddress(int): address to use with this driver func NewMPL115A2Driver(c Connector, options ...func(Config)) *MPL115A2Driver { d := &MPL115A2Driver{ Driver: NewDriver(c, "MPL115A2", mpl115a2DefaultAddress), diff --git a/drivers/i2c/mpl115a2_driver_test.go b/drivers/i2c/mpl115a2_driver_test.go index 7b09b290..19871514 100644 --- a/drivers/i2c/mpl115a2_driver_test.go +++ b/drivers/i2c/mpl115a2_driver_test.go @@ -5,8 +5,8 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) // this ensures that the implementation is based on i2c.Driver, which implements the gobot.Driver diff --git a/drivers/i2c/mpu6050_driver_test.go b/drivers/i2c/mpu6050_driver_test.go index f986542c..79c052d9 100644 --- a/drivers/i2c/mpu6050_driver_test.go +++ b/drivers/i2c/mpu6050_driver_test.go @@ -5,8 +5,8 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) // this ensures that the implementation is based on i2c.Driver, which implements the gobot.Driver diff --git a/drivers/i2c/pca9501_driver_test.go b/drivers/i2c/pca9501_driver_test.go index c588537c..8446e43e 100644 --- a/drivers/i2c/pca9501_driver_test.go +++ b/drivers/i2c/pca9501_driver_test.go @@ -5,8 +5,8 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) // this ensures that the implementation is based on i2c.Driver, which implements the gobot.Driver diff --git a/drivers/i2c/pca953x_driver_test.go b/drivers/i2c/pca953x_driver_test.go index df0c3a02..1c0a65dc 100644 --- a/drivers/i2c/pca953x_driver_test.go +++ b/drivers/i2c/pca953x_driver_test.go @@ -6,8 +6,8 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) // this ensures that the implementation is based on i2c.Driver, which implements the gobot.Driver diff --git a/drivers/i2c/pca9685_driver.go b/drivers/i2c/pca9685_driver.go index 8cdfe308..34ea629c 100644 --- a/drivers/i2c/pca9685_driver.go +++ b/drivers/i2c/pca9685_driver.go @@ -4,7 +4,7 @@ import ( "strconv" "time" - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" ) const pca9685DefaultAddress = 0x40 @@ -36,19 +36,19 @@ const ( // // For example, here is the Adafruit board that uses this chip: // https://www.adafruit.com/product/815 -// type PCA9685Driver struct { *Driver } // NewPCA9685Driver creates a new driver with specified i2c interface // Params: -// c Connector - the Adaptor to use with this Driver +// +// c Connector - the Adaptor to use with this Driver // // Optional params: -// i2c.WithBus(int): bus to use with this driver -// i2c.WithAddress(int): address to use with this driver // +// i2c.WithBus(int): bus to use with this driver +// i2c.WithAddress(int): address to use with this driver func NewPCA9685Driver(c Connector, options ...func(Config)) *PCA9685Driver { p := &PCA9685Driver{ Driver: NewDriver(c, "PCA9685", pca9685DefaultAddress), @@ -86,12 +86,12 @@ func NewPCA9685Driver(c Connector, options ...func(Config)) *PCA9685Driver { // SetPWM sets a specific channel to a pwm value from 0-4095. // Params: -// channel int - the channel to send the pulse -// on uint16 - the time to start the pulse -// off uint16 - the time to stop the pulse +// +// channel int - the channel to send the pulse +// on uint16 - the time to start the pulse +// off uint16 - the time to stop the pulse // // Most typically you set "on" to a zero value, and then set "off" to your desired duty. -// func (p *PCA9685Driver) SetPWM(channel int, on uint16, off uint16) (err error) { if _, err := p.connection.Write([]byte{byte(PCA9685_LED0_ON_L + 4*channel), byte(on) & 0xFF}); err != nil { return err @@ -114,11 +114,11 @@ func (p *PCA9685Driver) SetPWM(channel int, on uint16, off uint16) (err error) { // SetAllPWM sets all channels to a pwm value from 0-4095. // Params: -// on uint16 - the time to start the pulse -// off uint16 - the time to stop the pulse +// +// on uint16 - the time to start the pulse +// off uint16 - the time to stop the pulse // // Most typically you set "on" to a zero value, and then set "off" to your desired duty. -// func (p *PCA9685Driver) SetAllPWM(on uint16, off uint16) (err error) { if _, err := p.connection.Write([]byte{byte(PCA9685_ALLLED_ON_L), byte(on) & 0xFF}); err != nil { return err @@ -187,7 +187,6 @@ func (p *PCA9685Driver) SetPWMFreq(freq float32) error { // PwmWrite writes a PWM signal to the specified channel aka "pin". // Value values are from 0-255, to conform to the PwmWriter interface. // If you need finer control, please look at SetPWM(). -// func (p *PCA9685Driver) PwmWrite(pin string, val byte) (err error) { i, err := strconv.Atoi(pin) if err != nil { @@ -200,7 +199,6 @@ func (p *PCA9685Driver) PwmWrite(pin string, val byte) (err error) { // ServoWrite writes a servo signal to the specified channel aka "pin". // Valid values are from 0-180, to conform to the ServoWriter interface. // If you need finer control, please look at SetPWM(). -// func (p *PCA9685Driver) ServoWrite(pin string, val byte) (err error) { i, err := strconv.Atoi(pin) if err != nil { diff --git a/drivers/i2c/pca9685_driver_test.go b/drivers/i2c/pca9685_driver_test.go index 27221fe6..4fcae5a8 100644 --- a/drivers/i2c/pca9685_driver_test.go +++ b/drivers/i2c/pca9685_driver_test.go @@ -5,9 +5,9 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/gobottest" ) // this ensures that the implementation is based on i2c.Driver, which implements the gobot.Driver diff --git a/drivers/i2c/pcf8583_driver_test.go b/drivers/i2c/pcf8583_driver_test.go index 1fac5eef..95439e04 100644 --- a/drivers/i2c/pcf8583_driver_test.go +++ b/drivers/i2c/pcf8583_driver_test.go @@ -5,8 +5,8 @@ import ( "testing" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) // this ensures that the implementation is based on i2c.Driver, which implements the gobot.Driver diff --git a/drivers/i2c/pcf8591_driver_test.go b/drivers/i2c/pcf8591_driver_test.go index b7a5ae6f..d00f5de6 100644 --- a/drivers/i2c/pcf8591_driver_test.go +++ b/drivers/i2c/pcf8591_driver_test.go @@ -4,8 +4,8 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) // this ensures that the implementation is based on i2c.Driver, which implements the gobot.Driver diff --git a/drivers/i2c/sht2x_driver_test.go b/drivers/i2c/sht2x_driver_test.go index e424604f..d2d21d17 100644 --- a/drivers/i2c/sht2x_driver_test.go +++ b/drivers/i2c/sht2x_driver_test.go @@ -6,8 +6,8 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) // this ensures that the implementation is based on i2c.Driver, which implements the gobot.Driver diff --git a/drivers/i2c/sht3x_driver_test.go b/drivers/i2c/sht3x_driver_test.go index eabd1358..e9a0a9a1 100644 --- a/drivers/i2c/sht3x_driver_test.go +++ b/drivers/i2c/sht3x_driver_test.go @@ -5,8 +5,8 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) // this ensures that the implementation is based on i2c.Driver, which implements the gobot.Driver diff --git a/drivers/i2c/ssd1306_driver_test.go b/drivers/i2c/ssd1306_driver_test.go index d7d49503..b9dfd010 100644 --- a/drivers/i2c/ssd1306_driver_test.go +++ b/drivers/i2c/ssd1306_driver_test.go @@ -8,8 +8,8 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) // this ensures that the implementation is based on i2c.Driver, which implements the gobot.Driver diff --git a/drivers/i2c/th02_driver_test.go b/drivers/i2c/th02_driver_test.go index 5d0d2268..1276424c 100644 --- a/drivers/i2c/th02_driver_test.go +++ b/drivers/i2c/th02_driver_test.go @@ -6,8 +6,8 @@ import ( "testing" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) // this ensures that the implementation is based on i2c.Driver, which implements the gobot.Driver diff --git a/drivers/i2c/tsl2561_driver_test.go b/drivers/i2c/tsl2561_driver_test.go index bb3e8ff1..d5918d22 100644 --- a/drivers/i2c/tsl2561_driver_test.go +++ b/drivers/i2c/tsl2561_driver_test.go @@ -7,8 +7,8 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) // this ensures that the implementation is based on i2c.Driver, which implements the gobot.Driver diff --git a/drivers/i2c/wiichuck_driver.go b/drivers/i2c/wiichuck_driver.go index 9638dfee..45b6c7ed 100644 --- a/drivers/i2c/wiichuck_driver.go +++ b/drivers/i2c/wiichuck_driver.go @@ -5,7 +5,7 @@ import ( "sync" "time" - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" ) const ( @@ -35,12 +35,13 @@ type WiichuckDriver struct { // NewWiichuckDriver creates a WiichuckDriver with specified i2c interface. // // Params: -// c Connector - the Adaptor to use with this Driver +// +// c Connector - the Adaptor to use with this Driver // // Optional params: -// i2c.WithBus(int): bus to use with this driver -// i2c.WithAddress(int): address to use with this driver // +// i2c.WithBus(int): bus to use with this driver +// i2c.WithAddress(int): address to use with this driver func NewWiichuckDriver(c Connector, options ...func(Config)) *WiichuckDriver { w := &WiichuckDriver{ Driver: NewDriver(c, "Wiichuck", wiichuckDefaultAddress), diff --git a/drivers/i2c/wiichuck_driver_test.go b/drivers/i2c/wiichuck_driver_test.go index 772835c4..0758cbbf 100644 --- a/drivers/i2c/wiichuck_driver_test.go +++ b/drivers/i2c/wiichuck_driver_test.go @@ -5,8 +5,8 @@ import ( "testing" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) // this ensures that the implementation is based on i2c.Driver, which implements the gobot.Driver diff --git a/drivers/i2c/yl40_driver.go b/drivers/i2c/yl40_driver.go index 046e6c40..bc3d2a8b 100644 --- a/drivers/i2c/yl40_driver.go +++ b/drivers/i2c/yl40_driver.go @@ -6,8 +6,8 @@ import ( "strings" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/aio" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/aio" ) // All address pins are connected to ground. @@ -64,7 +64,6 @@ var yl40Pins = map[YL40Pin]string{ // // This driver was tested with Tinkerboard and this board with temperature & brightness sensor: // https://www.makershop.de/download/YL_40_yl40.pdf -// type YL40Driver struct { *PCF8591Driver conf yl40Config @@ -78,14 +77,15 @@ type YL40Driver struct { // NewYL40Driver creates a new driver with specified i2c interface // Params: -// conn Connector - the Adaptor to use with this Driver +// +// conn Connector - the Adaptor to use with this Driver // // Optional parameters: -// refer to PCF8591Driver for i2c specific options -// refer to TemperatureSensorDriver for temperature sensor specific options -// refer to AnalogSensorDriver for analog input specific options -// refer to AnalogActuatorDriver for analog output specific options // +// refer to PCF8591Driver for i2c specific options +// refer to TemperatureSensorDriver for temperature sensor specific options +// refer to AnalogSensorDriver for analog input specific options +// refer to AnalogActuatorDriver for analog output specific options func NewYL40Driver(a Connector, options ...func(Config)) *YL40Driver { options = append(options, WithAddress(yl40DefaultAddress)) pcf := NewPCF8591Driver(a, options...) diff --git a/drivers/i2c/yl40_driver_test.go b/drivers/i2c/yl40_driver_test.go index 598f67b4..1ee183b1 100644 --- a/drivers/i2c/yl40_driver_test.go +++ b/drivers/i2c/yl40_driver_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2/gobottest" ) func initTestYL40DriverWithStubbedAdaptor() (*YL40Driver, *i2cTestAdaptor) { diff --git a/drivers/spi/README.md b/drivers/spi/README.md index 9b7c43ac..9a3ee55f 100644 --- a/drivers/spi/README.md +++ b/drivers/spi/README.md @@ -7,7 +7,7 @@ This package provides drivers for [SPI](https://en.wikipedia.org/wiki/Serial_Per ## Installing ```sh -go get -d -u gobot.io/x/gobot/... +go get -d -u gobot.io/x/gobot/v2/... ``` ## Hardware Support diff --git a/drivers/spi/apa102_test.go b/drivers/spi/apa102_test.go index 1d09e735..74b6d0e4 100644 --- a/drivers/spi/apa102_test.go +++ b/drivers/spi/apa102_test.go @@ -5,8 +5,8 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) // this ensures that the implementation is based on spi.Driver, which implements the gobot.Driver diff --git a/drivers/spi/doc.go b/drivers/spi/doc.go index b9180749..682c2fce 100644 --- a/drivers/spi/doc.go +++ b/drivers/spi/doc.go @@ -2,8 +2,10 @@ Package spi provides Gobot drivers for spi devices. Uses periph.io for spi Installing: - go get -d -u gobot.io/x/gobot + + go get -d -u gobot.io/x/gobot/v2 + For further information refer to spi README: https://github.com/hybridgroup/gobot/blob/master/drivers/spi/README.md */ -package spi // import "gobot.io/x/gobot/drivers/spi" +package spi // import "gobot.io/x/gobot/v2/drivers/spi" diff --git a/drivers/spi/helpers_test.go b/drivers/spi/helpers_test.go index 192668f4..c66c310c 100644 --- a/drivers/spi/helpers_test.go +++ b/drivers/spi/helpers_test.go @@ -3,8 +3,8 @@ package spi import ( "fmt" - "gobot.io/x/gobot" - "gobot.io/x/gobot/system" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/system" ) // make sure that this SpiBusAdaptor fulfills all the required interfaces diff --git a/drivers/spi/mcp3002_test.go b/drivers/spi/mcp3002_test.go index f1a0e25d..00bbf35d 100644 --- a/drivers/spi/mcp3002_test.go +++ b/drivers/spi/mcp3002_test.go @@ -5,9 +5,9 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/aio" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/aio" + "gobot.io/x/gobot/v2/gobottest" ) // this ensures that the implementation is based on spi.Driver, which implements the gobot.Driver diff --git a/drivers/spi/mcp3004_test.go b/drivers/spi/mcp3004_test.go index 0566e9e3..066b18ac 100644 --- a/drivers/spi/mcp3004_test.go +++ b/drivers/spi/mcp3004_test.go @@ -5,9 +5,9 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/aio" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/aio" + "gobot.io/x/gobot/v2/gobottest" ) // this ensures that the implementation is based on spi.Driver, which implements the gobot.Driver diff --git a/drivers/spi/mcp3008_test.go b/drivers/spi/mcp3008_test.go index 413a1df1..be05954e 100644 --- a/drivers/spi/mcp3008_test.go +++ b/drivers/spi/mcp3008_test.go @@ -5,9 +5,9 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/aio" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/aio" + "gobot.io/x/gobot/v2/gobottest" ) // this ensures that the implementation is based on spi.Driver, which implements the gobot.Driver diff --git a/drivers/spi/mcp3202.go b/drivers/spi/mcp3202.go index 5d30bbb4..6c687c8a 100644 --- a/drivers/spi/mcp3202.go +++ b/drivers/spi/mcp3202.go @@ -4,7 +4,7 @@ import ( "fmt" "strconv" - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" ) // MCP3202DriverMaxChannel is the number of channels of this A/D converter. @@ -18,15 +18,16 @@ type MCP3202Driver struct { // NewMCP3202Driver creates a new Gobot Driver for MCP3202Driver A/D converter // // Params: -// a *Adaptor - the Adaptor to use with this Driver +// +// a *Adaptor - the Adaptor to use with this Driver // // Optional params: -// spi.WithBusNumber(int): bus to use with this driver -// spi.WithChipNumber(int): chip to use with this driver -// spi.WithMode(int): mode to use with this driver -// spi.WithBitCount(int): number of bits to use with this driver -// spi.WithSpeed(int64): speed in Hz to use with this driver // +// spi.WithBusNumber(int): bus to use with this driver +// spi.WithChipNumber(int): chip to use with this driver +// spi.WithMode(int): mode to use with this driver +// spi.WithBitCount(int): number of bits to use with this driver +// spi.WithSpeed(int64): speed in Hz to use with this driver func NewMCP3202Driver(a Connector, options ...func(Config)) *MCP3202Driver { d := &MCP3202Driver{ Driver: NewDriver(a, "MCP3202"), diff --git a/drivers/spi/mcp3202_test.go b/drivers/spi/mcp3202_test.go index 72ce3d89..49a7b5de 100644 --- a/drivers/spi/mcp3202_test.go +++ b/drivers/spi/mcp3202_test.go @@ -5,9 +5,9 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/aio" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/aio" + "gobot.io/x/gobot/v2/gobottest" ) // this ensures that the implementation is based on spi.Driver, which implements the gobot.Driver diff --git a/drivers/spi/mcp3204.go b/drivers/spi/mcp3204.go index 29fb3586..d8deaf42 100644 --- a/drivers/spi/mcp3204.go +++ b/drivers/spi/mcp3204.go @@ -4,7 +4,7 @@ import ( "fmt" "strconv" - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" ) // MCP3204DriverMaxChannel is the number of channels of this A/D converter. @@ -18,15 +18,16 @@ type MCP3204Driver struct { // NewMCP3204Driver creates a new Gobot Driver for MCP3204Driver A/D converter // // Params: -// a *Adaptor - the Adaptor to use with this Driver +// +// a *Adaptor - the Adaptor to use with this Driver // // Optional params: -// spi.WithBusNumber(int): bus to use with this driver -// spi.WithChipNumber(int): chip to use with this driver -// spi.WithMode(int): mode to use with this driver -// spi.WithBitCount(int): number of bits to use with this driver -// spi.WithSpeed(int64): speed in Hz to use with this driver // +// spi.WithBusNumber(int): bus to use with this driver +// spi.WithChipNumber(int): chip to use with this driver +// spi.WithMode(int): mode to use with this driver +// spi.WithBitCount(int): number of bits to use with this driver +// spi.WithSpeed(int64): speed in Hz to use with this driver func NewMCP3204Driver(a Connector, options ...func(Config)) *MCP3204Driver { d := &MCP3204Driver{ Driver: NewDriver(a, "MCP3204"), diff --git a/drivers/spi/mcp3204_test.go b/drivers/spi/mcp3204_test.go index 25bc232e..7462e72f 100644 --- a/drivers/spi/mcp3204_test.go +++ b/drivers/spi/mcp3204_test.go @@ -5,9 +5,9 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/aio" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/aio" + "gobot.io/x/gobot/v2/gobottest" ) // this ensures that the implementation is based on spi.Driver, which implements the gobot.Driver diff --git a/drivers/spi/mcp3208.go b/drivers/spi/mcp3208.go index a96228b2..274e46e7 100644 --- a/drivers/spi/mcp3208.go +++ b/drivers/spi/mcp3208.go @@ -4,7 +4,7 @@ import ( "fmt" "strconv" - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" ) // MCP3208DriverMaxChannel is the number of channels of this A/D converter. @@ -18,15 +18,16 @@ type MCP3208Driver struct { // NewMCP3208Driver creates a new Gobot Driver for MCP3208Driver A/D converter // // Params: -// a *Adaptor - the Adaptor to use with this Driver +// +// a *Adaptor - the Adaptor to use with this Driver // // Optional params: -// spi.WithBusNumber(int): bus to use with this driver -// spi.WithChipNumber(int): chip to use with this driver -// spi.WithMode(int): mode to use with this driver -// spi.WithBitCount(int): number of bits to use with this driver -// spi.WithSpeed(int64): speed in Hz to use with this driver // +// spi.WithBusNumber(int): bus to use with this driver +// spi.WithChipNumber(int): chip to use with this driver +// spi.WithMode(int): mode to use with this driver +// spi.WithBitCount(int): number of bits to use with this driver +// spi.WithSpeed(int64): speed in Hz to use with this driver func NewMCP3208Driver(a Connector, options ...func(Config)) *MCP3208Driver { d := &MCP3208Driver{ Driver: NewDriver(a, "MCP3208"), diff --git a/drivers/spi/mcp3208_test.go b/drivers/spi/mcp3208_test.go index a5138a44..629ca41b 100644 --- a/drivers/spi/mcp3208_test.go +++ b/drivers/spi/mcp3208_test.go @@ -5,9 +5,9 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/aio" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/aio" + "gobot.io/x/gobot/v2/gobottest" ) // this ensures that the implementation is based on spi.Driver, which implements the gobot.Driver diff --git a/drivers/spi/mcp3304.go b/drivers/spi/mcp3304.go index 924dd318..1f6aa58f 100644 --- a/drivers/spi/mcp3304.go +++ b/drivers/spi/mcp3304.go @@ -4,7 +4,7 @@ import ( "fmt" "strconv" - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" ) // MCP3304DriverMaxChannel is the number of channels of this A/D converter. @@ -18,15 +18,16 @@ type MCP3304Driver struct { // NewMCP3304Driver creates a new Gobot Driver for MCP3304Driver A/D converter // // Params: -// a *Adaptor - the Adaptor to use with this Driver +// +// a *Adaptor - the Adaptor to use with this Driver // // Optional params: -// spi.WithBusNumber(int): bus to use with this driver -// spi.WithChipNumber(int): chip to use with this driver -// spi.WithMode(int): mode to use with this driver -// spi.WithBitCount(int): number of bits to use with this driver -// spi.WithSpeed(int64): speed in Hz to use with this driver // +// spi.WithBusNumber(int): bus to use with this driver +// spi.WithChipNumber(int): chip to use with this driver +// spi.WithMode(int): mode to use with this driver +// spi.WithBitCount(int): number of bits to use with this driver +// spi.WithSpeed(int64): speed in Hz to use with this driver func NewMCP3304Driver(a Connector, options ...func(Config)) *MCP3304Driver { d := &MCP3304Driver{ Driver: NewDriver(a, "MCP3304"), diff --git a/drivers/spi/mcp3304_test.go b/drivers/spi/mcp3304_test.go index 9d0e99f3..f11b215c 100644 --- a/drivers/spi/mcp3304_test.go +++ b/drivers/spi/mcp3304_test.go @@ -5,9 +5,9 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/aio" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/aio" + "gobot.io/x/gobot/v2/gobottest" ) // this ensures that the implementation is based on spi.Driver, which implements the gobot.Driver diff --git a/drivers/spi/mfrc522_driver.go b/drivers/spi/mfrc522_driver.go index fbafa302..ae3f6d0c 100644 --- a/drivers/spi/mfrc522_driver.go +++ b/drivers/spi/mfrc522_driver.go @@ -1,7 +1,7 @@ package spi import ( - "gobot.io/x/gobot/drivers/common/mfrc522" + "gobot.io/x/gobot/v2/drivers/common/mfrc522" ) // MFRC522Driver is a wrapper for SPI bus usage. Please refer to the mfrc522.MFRC522Common package @@ -14,15 +14,16 @@ type MFRC522Driver struct { // NewMFRC522Driver creates a new Gobot Driver for MFRC522 RFID with SPI connection // // Params: -// a *Adaptor - the Adaptor to use with this Driver +// +// a *Adaptor - the Adaptor to use with this Driver // // Optional params: -// spi.WithBusNumber(int): bus to use with this driver -// spi.WithChipNumber(int): chip to use with this driver -// spi.WithMode(int): mode to use with this driver -// spi.WithBitCount(int): number of bits to use with this driver -// spi.WithSpeed(int64): speed in Hz to use with this driver // +// spi.WithBusNumber(int): bus to use with this driver +// spi.WithChipNumber(int): chip to use with this driver +// spi.WithMode(int): mode to use with this driver +// spi.WithBitCount(int): number of bits to use with this driver +// spi.WithSpeed(int64): speed in Hz to use with this driver func NewMFRC522Driver(a Connector, options ...func(Config)) *MFRC522Driver { d := &MFRC522Driver{ Driver: NewDriver(a, "MFRC522"), diff --git a/drivers/spi/mfrc522_driver_test.go b/drivers/spi/mfrc522_driver_test.go index bcf0de8b..7412a402 100644 --- a/drivers/spi/mfrc522_driver_test.go +++ b/drivers/spi/mfrc522_driver_test.go @@ -4,8 +4,8 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) // this ensures that the implementation is based on spi.Driver, which implements the gobot.Driver diff --git a/drivers/spi/spi_connection.go b/drivers/spi/spi_connection.go index d2cc3854..13cd4d20 100644 --- a/drivers/spi/spi_connection.go +++ b/drivers/spi/spi_connection.go @@ -4,7 +4,7 @@ import ( "fmt" "sync" - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" ) const ( diff --git a/drivers/spi/spi_connection_test.go b/drivers/spi/spi_connection_test.go index 99ba3349..eca649b1 100644 --- a/drivers/spi/spi_connection_test.go +++ b/drivers/spi/spi_connection_test.go @@ -3,9 +3,9 @@ package spi import ( "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" - "gobot.io/x/gobot/system" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" + "gobot.io/x/gobot/v2/system" ) var _ gobot.SpiOperations = (*spiConnection)(nil) diff --git a/drivers/spi/spi_driver.go b/drivers/spi/spi_driver.go index 59694136..bf5d0aa9 100644 --- a/drivers/spi/spi_driver.go +++ b/drivers/spi/spi_driver.go @@ -3,7 +3,7 @@ package spi import ( "sync" - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" ) const ( diff --git a/drivers/spi/spi_driver_test.go b/drivers/spi/spi_driver_test.go index d74c084d..8bea00fc 100644 --- a/drivers/spi/spi_driver_test.go +++ b/drivers/spi/spi_driver_test.go @@ -4,8 +4,8 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) var _ gobot.Driver = (*Driver)(nil) diff --git a/drivers/spi/ssd1306_driver.go b/drivers/spi/ssd1306_driver.go index 8758fef9..9c8bb94f 100644 --- a/drivers/spi/ssd1306_driver.go +++ b/drivers/spi/ssd1306_driver.go @@ -5,8 +5,8 @@ import ( "image" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" ) const ( @@ -114,20 +114,21 @@ type SSD1306Driver struct { // NewSSD1306Driver creates a new SSD1306Driver. // // Params: -// conn Connector - the Adaptor to use with this Driver +// +// conn Connector - the Adaptor to use with this Driver // // Optional params: -// spi.WithBusNumber(int): bus to use with this driver -// spi.WithChipNumber(int): chip to use with this driver -// spi.WithMode(int): mode to use with this driver -// spi.WithBitCount(int): number of bits to use with this driver -// spi.WithSpeed(int64): speed in Hz to use with this driver -// spi.WithDisplayWidth(int): width of display (defaults to 128) -// spi.WithDisplayHeight(int): height of display (defaults to 64) -// spi.WithDCPin(string): gpio pin number connected to dc pin on display (defaults to "16") -// spi.WithRstPin(string): gpio pin number connected to rst pin on display (defaults to "18") -// spi.WithExternalVCC(bool): set to true if using external vcc (defaults to false) // +// spi.WithBusNumber(int): bus to use with this driver +// spi.WithChipNumber(int): chip to use with this driver +// spi.WithMode(int): mode to use with this driver +// spi.WithBitCount(int): number of bits to use with this driver +// spi.WithSpeed(int64): speed in Hz to use with this driver +// spi.WithDisplayWidth(int): width of display (defaults to 128) +// spi.WithDisplayHeight(int): height of display (defaults to 64) +// spi.WithDCPin(string): gpio pin number connected to dc pin on display (defaults to "16") +// spi.WithRstPin(string): gpio pin number connected to rst pin on display (defaults to "18") +// spi.WithExternalVCC(bool): set to true if using external vcc (defaults to false) func NewSSD1306Driver(a gobot.Adaptor, options ...func(Config)) *SSD1306Driver { // cast adaptor to spi connector since we also need the adaptor for gpio b, ok := a.(Connector) diff --git a/drivers/spi/ssd1306_driver_test.go b/drivers/spi/ssd1306_driver_test.go index 632e4544..d6364244 100644 --- a/drivers/spi/ssd1306_driver_test.go +++ b/drivers/spi/ssd1306_driver_test.go @@ -6,8 +6,8 @@ import ( "sync" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) // this ensures that the implementation is based on spi.Driver, which implements the gobot.Driver diff --git a/eventer_test.go b/eventer_test.go index 0aad76ed..862d58bf 100644 --- a/eventer_test.go +++ b/eventer_test.go @@ -4,7 +4,7 @@ import ( "testing" "time" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2/gobottest" ) func TestEventerAddEvent(t *testing.T) { diff --git a/examples/ardrone.go b/examples/ardrone.go index 27053b81..74349c5b 100644 --- a/examples/ardrone.go +++ b/examples/ardrone.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,8 +9,8 @@ package main import ( "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/parrot/ardrone" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/parrot/ardrone" ) func main() { diff --git a/examples/ardrone_face_tracking.go b/examples/ardrone_face_tracking.go index 3709fc68..b0a70834 100644 --- a/examples/ardrone_face_tracking.go +++ b/examples/ardrone_face_tracking.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -6,14 +8,15 @@ package main import ( "fmt" + "image" "math" "path" "runtime" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/opencv" - "gobot.io/x/gobot/platforms/parrot/ardrone" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/opencv" + "gobot.io/x/gobot/v2/platforms/parrot/ardrone" "gocv.io/x/gocv" ) diff --git a/examples/ardrone_ps3.go b/examples/ardrone_ps3.go index e49c2928..d7aad83e 100644 --- a/examples/ardrone_ps3.go +++ b/examples/ardrone_ps3.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,9 +10,9 @@ import ( "sync/atomic" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/joystick" - "gobot.io/x/gobot/platforms/parrot/ardrone" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/joystick" + "gobot.io/x/gobot/v2/platforms/parrot/ardrone" ) type pair struct { diff --git a/examples/audio.go b/examples/audio.go index 68a4ed00..dd781956 100644 --- a/examples/audio.go +++ b/examples/audio.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,8 +9,8 @@ package main import ( "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/audio" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/audio" ) func main() { diff --git a/examples/batty.go b/examples/batty.go index d75052d1..918e9944 100644 --- a/examples/batty.go +++ b/examples/batty.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,8 +10,8 @@ import ( "fmt" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/api" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/api" ) func main() { diff --git a/examples/bb8-collision.go b/examples/bb8-collision.go index 641c6ff5..63eb6b86 100644 --- a/examples/bb8-collision.go +++ b/examples/bb8-collision.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -17,9 +19,9 @@ import ( "fmt" "os" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/ble" - "gobot.io/x/gobot/platforms/sphero/bb8" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/ble" + "gobot.io/x/gobot/v2/platforms/sphero/bb8" ) func main() { diff --git a/examples/bb8.go b/examples/bb8.go index cbe7792c..8fc5dfc8 100644 --- a/examples/bb8.go +++ b/examples/bb8.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -17,9 +19,9 @@ import ( "os" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/ble" - "gobot.io/x/gobot/platforms/sphero/bb8" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/ble" + "gobot.io/x/gobot/v2/platforms/sphero/bb8" ) func main() { diff --git a/examples/beaglebone_basic_direct_pin.go b/examples/beaglebone_basic_direct_pin.go index 9d5fa47a..0bb2385b 100644 --- a/examples/beaglebone_basic_direct_pin.go +++ b/examples/beaglebone_basic_direct_pin.go @@ -1,12 +1,14 @@ +//go:build example // +build example + // // Do not build by default. package main import ( - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/beaglebone" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/beaglebone" ) func main() { diff --git a/examples/beaglebone_blink.go b/examples/beaglebone_blink.go index c23fc3d3..fbddafd7 100644 --- a/examples/beaglebone_blink.go +++ b/examples/beaglebone_blink.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,9 +9,9 @@ package main import ( "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/beaglebone" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/beaglebone" ) func main() { diff --git a/examples/beaglebone_blink_usr_led.go b/examples/beaglebone_blink_usr_led.go index 2722ace1..ea50005c 100644 --- a/examples/beaglebone_blink_usr_led.go +++ b/examples/beaglebone_blink_usr_led.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,9 +9,9 @@ package main import ( "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/beaglebone" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/beaglebone" ) func main() { diff --git a/examples/beaglebone_blinkm.go b/examples/beaglebone_blinkm.go index b83d4a9d..97c91e7f 100644 --- a/examples/beaglebone_blinkm.go +++ b/examples/beaglebone_blinkm.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,9 +10,9 @@ import ( "fmt" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/beaglebone" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/beaglebone" ) func main() { diff --git a/examples/beaglebone_button.go b/examples/beaglebone_button.go index 1553a233..2aa22712 100644 --- a/examples/beaglebone_button.go +++ b/examples/beaglebone_button.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,9 +9,9 @@ package main import ( "fmt" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/beaglebone" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/beaglebone" ) func main() { diff --git a/examples/beaglebone_direct_pin.go b/examples/beaglebone_direct_pin.go index 12deaaf8..40ce3544 100644 --- a/examples/beaglebone_direct_pin.go +++ b/examples/beaglebone_direct_pin.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,9 +9,9 @@ package main import ( "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/beaglebone" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/beaglebone" ) func main() { diff --git a/examples/beaglebone_grove_accelerometer.go b/examples/beaglebone_grove_accelerometer.go index 517ed925..f7fff980 100644 --- a/examples/beaglebone_grove_accelerometer.go +++ b/examples/beaglebone_grove_accelerometer.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,9 +10,9 @@ import ( "fmt" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/beaglebone" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/beaglebone" ) func main() { diff --git a/examples/beaglebone_led_brightness.go b/examples/beaglebone_led_brightness.go index 78c973c8..8d84b419 100644 --- a/examples/beaglebone_led_brightness.go +++ b/examples/beaglebone_led_brightness.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,9 +9,9 @@ package main import ( "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/beaglebone" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/beaglebone" ) func main() { diff --git a/examples/beaglebone_led_brightness_with_analog_input.go b/examples/beaglebone_led_brightness_with_analog_input.go index 566f4fcb..c284c74b 100644 --- a/examples/beaglebone_led_brightness_with_analog_input.go +++ b/examples/beaglebone_led_brightness_with_analog_input.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,10 +9,10 @@ package main import ( "fmt" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/aio" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/beaglebone" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/aio" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/beaglebone" ) func main() { diff --git a/examples/beaglebone_makey_button.go b/examples/beaglebone_makey_button.go index 6c86d207..f51e172d 100644 --- a/examples/beaglebone_makey_button.go +++ b/examples/beaglebone_makey_button.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,9 +9,9 @@ package main import ( "fmt" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/beaglebone" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/beaglebone" ) func main() { diff --git a/examples/beaglebone_servo.go b/examples/beaglebone_servo.go index b83330c1..0172eb9c 100644 --- a/examples/beaglebone_servo.go +++ b/examples/beaglebone_servo.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,9 +10,9 @@ import ( "fmt" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/beaglebone" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/beaglebone" ) func main() { diff --git a/examples/bebop.go b/examples/bebop.go index 03f7b495..5af654ab 100644 --- a/examples/bebop.go +++ b/examples/bebop.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,8 +9,8 @@ package main import ( "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/parrot/bebop" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/parrot/bebop" ) func main() { diff --git a/examples/bebop_ps3.go b/examples/bebop_ps3.go index 163dc437..93b51434 100644 --- a/examples/bebop_ps3.go +++ b/examples/bebop_ps3.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,9 +10,9 @@ import ( "sync/atomic" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/joystick" - "gobot.io/x/gobot/platforms/parrot/bebop" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/joystick" + "gobot.io/x/gobot/v2/platforms/parrot/bebop" ) type pair struct { diff --git a/examples/bebop_ps3_video.go b/examples/bebop_ps3_video.go index 5d4bbd43..4f31f373 100644 --- a/examples/bebop_ps3_video.go +++ b/examples/bebop_ps3_video.go @@ -1,25 +1,29 @@ +//go:build example // +build example + // // Do not build by default. /* - This example will connect to the Parrot Bebop allowing you to control - it using a PS3 controller. +This example will connect to the Parrot Bebop allowing you to control +it using a PS3 controller. - It also streams the drone video to a webpage via ffserver. +It also streams the drone video to a webpage via ffserver. - This requires you to have both ffmpeg and ffserver installed - on your computer. +This requires you to have both ffmpeg and ffserver installed +on your computer. - In order to run this example you will first need to start ffserver with: - $ ffserver -f ff.conf +In order to run this example you will first need to start ffserver with: - then in a separate terminal run this program: - $ go run bebop_ps3_video.go + $ ffserver -f ff.conf - You can view the video feed by navigating to - http://localhost:8090/bebop.mjpeg in a web browser. - *NOTE* firefox works best for viewing the video feed. +then in a separate terminal run this program: + + $ go run bebop_ps3_video.go + +You can view the video feed by navigating to +http://localhost:8090/bebop.mjpeg in a web browser. +*NOTE* firefox works best for viewing the video feed. */ package main @@ -31,9 +35,9 @@ import ( "sync/atomic" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/joystick" - "gobot.io/x/gobot/platforms/parrot/bebop" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/joystick" + "gobot.io/x/gobot/v2/platforms/parrot/bebop" ) type pair struct { diff --git a/examples/bebop_rtp_video.go b/examples/bebop_rtp_video.go index 8d71bc03..df3afbe9 100644 --- a/examples/bebop_rtp_video.go +++ b/examples/bebop_rtp_video.go @@ -1,27 +1,30 @@ +//go:build example // +build example + // // Do not build by default. /* - This example will connect to the Parrot Bebop and streams the drone video - via the RTP protocol. +This example will connect to the Parrot Bebop and streams the drone video +via the RTP protocol. - In order to run this example you will first need to connect to the drone with: - $ go run bebop_ps3_video.go +In order to run this example you will first need to connect to the drone with: - then in a separate terminal run this program: + $ go run bebop_ps3_video.go - $ mplayer examples/bebop.sdp +then in a separate terminal run this program: - You can view the video feed by navigating to - http://localhost:8090/bebop.mjpeg in a web browser. - *NOTE* firefox works best for viewing the video feed. + $ mplayer examples/bebop.sdp + +You can view the video feed by navigating to +http://localhost:8090/bebop.mjpeg in a web browser. +*NOTE* firefox works best for viewing the video feed. */ package main import ( - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/parrot/bebop" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/parrot/bebop" ) func main() { diff --git a/examples/ble_battery.go b/examples/ble_battery.go index 43f6fa38..ee8fb04f 100644 --- a/examples/ble_battery.go +++ b/examples/ble_battery.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -18,8 +20,8 @@ import ( "os" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/ble" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/ble" ) func main() { diff --git a/examples/ble_device_info.go b/examples/ble_device_info.go index dfcf40de..5c612d30 100644 --- a/examples/ble_device_info.go +++ b/examples/ble_device_info.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -17,8 +19,8 @@ import ( "fmt" "os" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/ble" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/ble" ) func main() { diff --git a/examples/ble_firmata_blink.go b/examples/ble_firmata_blink.go index 2bedcd91..b63860e1 100644 --- a/examples/ble_firmata_blink.go +++ b/examples/ble_firmata_blink.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -17,9 +19,9 @@ import ( "os" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/firmata" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/firmata" ) func main() { diff --git a/examples/ble_firmata_curie_imu.go b/examples/ble_firmata_curie_imu.go index 565ac1f5..184a9f9f 100644 --- a/examples/ble_firmata_curie_imu.go +++ b/examples/ble_firmata_curie_imu.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -18,10 +20,10 @@ import ( "os" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/firmata" - "gobot.io/x/gobot/platforms/intel-iot/curie" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/firmata" + "gobot.io/x/gobot/v2/platforms/intel-iot/curie" ) func main() { diff --git a/examples/ble_generic_access.go b/examples/ble_generic_access.go index f1276ce4..76131519 100644 --- a/examples/ble_generic_access.go +++ b/examples/ble_generic_access.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -17,8 +19,8 @@ import ( "fmt" "os" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/ble" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/ble" ) func main() { diff --git a/examples/ble_multiple_generic.go b/examples/ble_multiple_generic.go index 5a71af86..15dd9f82 100644 --- a/examples/ble_multiple_generic.go +++ b/examples/ble_multiple_generic.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -17,9 +19,9 @@ import ( "fmt" "os" - "gobot.io/x/gobot" - "gobot.io/x/gobot/api" - "gobot.io/x/gobot/platforms/ble" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/api" + "gobot.io/x/gobot/v2/platforms/ble" ) func NewSwarmBot(port string) *gobot.Robot { diff --git a/examples/ble_multiple_info.go b/examples/ble_multiple_info.go index ad480a9b..8f8b3100 100644 --- a/examples/ble_multiple_info.go +++ b/examples/ble_multiple_info.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -17,9 +19,9 @@ import ( "fmt" "os" - "gobot.io/x/gobot" - "gobot.io/x/gobot/api" - "gobot.io/x/gobot/platforms/ble" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/api" + "gobot.io/x/gobot/v2/platforms/ble" ) func NewSwarmBot(port string) *gobot.Robot { diff --git a/examples/chip_blink.go b/examples/chip_blink.go index 691c8de9..528e41f5 100644 --- a/examples/chip_blink.go +++ b/examples/chip_blink.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,9 +9,9 @@ package main import ( "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/chip" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/chip" ) func main() { diff --git a/examples/chip_blinkm.go b/examples/chip_blinkm.go index 2728b765..85bbc816 100644 --- a/examples/chip_blinkm.go +++ b/examples/chip_blinkm.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,9 +10,9 @@ import ( "fmt" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/chip" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/chip" ) func main() { diff --git a/examples/chip_button.go b/examples/chip_button.go index 90d94ffb..bc1a6d60 100644 --- a/examples/chip_button.go +++ b/examples/chip_button.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,9 +9,9 @@ package main import ( "fmt" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/chip" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/chip" ) func main() { diff --git a/examples/chip_button_led.go b/examples/chip_button_led.go index 87240cdc..d011a58b 100644 --- a/examples/chip_button_led.go +++ b/examples/chip_button_led.go @@ -1,13 +1,15 @@ +//go:build example // +build example + // // Do not build by default. package main import ( - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/chip" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/chip" ) func main() { diff --git a/examples/chip_drv2605l.go b/examples/chip_drv2605l.go index af3a8bb8..12fad098 100644 --- a/examples/chip_drv2605l.go +++ b/examples/chip_drv2605l.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,9 +9,9 @@ package main import ( "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/chip" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/chip" ) func main() { diff --git a/examples/chip_grove_accelerometer.go b/examples/chip_grove_accelerometer.go index d49840fd..7030724a 100644 --- a/examples/chip_grove_accelerometer.go +++ b/examples/chip_grove_accelerometer.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,9 +10,9 @@ import ( "fmt" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/chip" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/chip" ) func main() { diff --git a/examples/chip_grove_lcd.go b/examples/chip_grove_lcd.go index 458c7d33..51314768 100644 --- a/examples/chip_grove_lcd.go +++ b/examples/chip_grove_lcd.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,9 +9,9 @@ package main import ( "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/chip" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/chip" ) func main() { diff --git a/examples/chip_mpu6050.go b/examples/chip_mpu6050.go index 18f5c0d6..6238f220 100644 --- a/examples/chip_mpu6050.go +++ b/examples/chip_mpu6050.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,9 +10,9 @@ import ( "fmt" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/chip" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/chip" ) func main() { diff --git a/examples/chip_tsl2561.go b/examples/chip_tsl2561.go index 4cbba1bf..9f7ba1b7 100644 --- a/examples/chip_tsl2561.go +++ b/examples/chip_tsl2561.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,9 +10,9 @@ import ( "fmt" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/chip" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/chip" ) func main() { diff --git a/examples/chip_wiichuck.go b/examples/chip_wiichuck.go index 21a95ae6..120f82c8 100644 --- a/examples/chip_wiichuck.go +++ b/examples/chip_wiichuck.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,9 +9,9 @@ package main import ( "fmt" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/chip" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/chip" ) func main() { diff --git a/examples/digispark_api.go b/examples/digispark_api.go index 0b59ea7b..8614f783 100644 --- a/examples/digispark_api.go +++ b/examples/digispark_api.go @@ -1,14 +1,16 @@ +//go:build example // +build example + // // Do not build by default. package main import ( - "gobot.io/x/gobot" - "gobot.io/x/gobot/api" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/digispark" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/api" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/digispark" ) func main() { diff --git a/examples/digispark_blink.go b/examples/digispark_blink.go index 6f92c6c8..dc500d2d 100644 --- a/examples/digispark_blink.go +++ b/examples/digispark_blink.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,9 +10,9 @@ import ( "fmt" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/digispark" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/digispark" ) func main() { diff --git a/examples/digispark_blinkm.go b/examples/digispark_blinkm.go index 6421b1a3..b64c693b 100644 --- a/examples/digispark_blinkm.go +++ b/examples/digispark_blinkm.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,9 +10,9 @@ import ( "fmt" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/digispark" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/digispark" ) func main() { diff --git a/examples/digispark_driver.go b/examples/digispark_driver.go index d570bb2a..369449b7 100644 --- a/examples/digispark_driver.go +++ b/examples/digispark_driver.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -9,9 +11,9 @@ import ( "strconv" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/digispark" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/digispark" ) // This is an example for using the generic I2C driver to write and read values diff --git a/examples/digispark_led_brightness.go b/examples/digispark_led_brightness.go index 961170a0..e52cfe17 100644 --- a/examples/digispark_led_brightness.go +++ b/examples/digispark_led_brightness.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,9 +9,9 @@ package main import ( "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/digispark" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/digispark" ) func main() { diff --git a/examples/digispark_mpl115a2.go b/examples/digispark_mpl115a2.go index 62b84991..b4bd8ea6 100644 --- a/examples/digispark_mpl115a2.go +++ b/examples/digispark_mpl115a2.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,9 +10,9 @@ import ( "fmt" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/digispark" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/digispark" ) func main() { diff --git a/examples/digispark_pca9501.go b/examples/digispark_pca9501.go index 3e44ddae..81ae873e 100644 --- a/examples/digispark_pca9501.go +++ b/examples/digispark_pca9501.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,9 +10,9 @@ import ( "fmt" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/digispark" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/digispark" ) // Program use EEPROM with GPIO to rotate pins, get best experience, when diff --git a/examples/digispark_servo.go b/examples/digispark_servo.go index ea42948e..7968b5ed 100644 --- a/examples/digispark_servo.go +++ b/examples/digispark_servo.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,9 +10,9 @@ import ( "fmt" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/digispark" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/digispark" ) func main() { diff --git a/examples/dragonboard_button.go b/examples/dragonboard_button.go index 3aa8c981..101ec500 100644 --- a/examples/dragonboard_button.go +++ b/examples/dragonboard_button.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,9 +9,9 @@ package main import ( "fmt" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/chip" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/chip" ) func main() { diff --git a/examples/edison_blink.go b/examples/edison_blink.go index 5325b152..7d3dd1d9 100644 --- a/examples/edison_blink.go +++ b/examples/edison_blink.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,9 +9,9 @@ package main import ( "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/intel-iot/edison" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/intel-iot/edison" ) const boardType = "arduino" // "sparkfun" for a Sparkfun Edison board with the GPIO block diff --git a/examples/edison_blink_without_all_gobot_framework.go b/examples/edison_blink_without_all_gobot_framework.go index 5729464e..935e1840 100644 --- a/examples/edison_blink_without_all_gobot_framework.go +++ b/examples/edison_blink_without_all_gobot_framework.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,8 +9,8 @@ package main import ( "time" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/intel-iot/edison" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/intel-iot/edison" ) // Example of a simple led toggle without the initialization of diff --git a/examples/edison_blinkm.go b/examples/edison_blinkm.go index 155b4da3..4b75e34a 100644 --- a/examples/edison_blinkm.go +++ b/examples/edison_blinkm.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,9 +10,9 @@ import ( "fmt" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/intel-iot/edison" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/intel-iot/edison" ) func main() { diff --git a/examples/edison_bme280.go b/examples/edison_bme280.go index 0a7db09f..ec16959c 100644 --- a/examples/edison_bme280.go +++ b/examples/edison_bme280.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,9 +10,9 @@ import ( "fmt" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/intel-iot/edison" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/intel-iot/edison" ) func main() { diff --git a/examples/edison_button.go b/examples/edison_button.go index 28e73936..022eedcc 100644 --- a/examples/edison_button.go +++ b/examples/edison_button.go @@ -1,13 +1,15 @@ +//go:build example // +build example + // // Do not build by default. package main import ( - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/intel-iot/edison" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/intel-iot/edison" ) func main() { diff --git a/examples/edison_button_led.go b/examples/edison_button_led.go index de089a81..74e0456d 100644 --- a/examples/edison_button_led.go +++ b/examples/edison_button_led.go @@ -1,13 +1,15 @@ +//go:build example // +build example + // // Do not build by default. package main import ( - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/intel-iot/edison" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/intel-iot/edison" ) func main() { diff --git a/examples/edison_button_led_api.go b/examples/edison_button_led_api.go index 750a2835..7884d3aa 100644 --- a/examples/edison_button_led_api.go +++ b/examples/edison_button_led_api.go @@ -1,15 +1,17 @@ +//go:build example // +build example + // // Do not build by default. package main import ( - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/intel-iot/edison" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/intel-iot/edison" - "gobot.io/x/gobot/api" + "gobot.io/x/gobot/v2/api" ) func main() { diff --git a/examples/edison_grove_accelerometer.go b/examples/edison_grove_accelerometer.go index 7c2b2586..845d89d1 100644 --- a/examples/edison_grove_accelerometer.go +++ b/examples/edison_grove_accelerometer.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,9 +10,9 @@ import ( "fmt" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/intel-iot/edison" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/intel-iot/edison" ) func main() { diff --git a/examples/edison_grove_blink.go b/examples/edison_grove_blink.go index e6ddb4f2..f390ef6b 100644 --- a/examples/edison_grove_blink.go +++ b/examples/edison_grove_blink.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,9 +9,9 @@ package main import ( "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/intel-iot/edison" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/intel-iot/edison" ) func main() { diff --git a/examples/edison_grove_button.go b/examples/edison_grove_button.go index 65bf3762..a5827046 100644 --- a/examples/edison_grove_button.go +++ b/examples/edison_grove_button.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,9 +9,9 @@ package main import ( "fmt" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/intel-iot/edison" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/intel-iot/edison" ) func main() { diff --git a/examples/edison_grove_buzzer.go b/examples/edison_grove_buzzer.go index 714d6454..2721dc93 100644 --- a/examples/edison_grove_buzzer.go +++ b/examples/edison_grove_buzzer.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,9 +9,9 @@ package main import ( "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/intel-iot/edison" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/intel-iot/edison" ) func main() { diff --git a/examples/edison_grove_lcd.go b/examples/edison_grove_lcd.go index adc40375..040a927b 100644 --- a/examples/edison_grove_lcd.go +++ b/examples/edison_grove_lcd.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,9 +9,9 @@ package main import ( "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/intel-iot/edison" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/intel-iot/edison" ) func main() { diff --git a/examples/edison_grove_led.go b/examples/edison_grove_led.go index 4525cefb..8df00721 100644 --- a/examples/edison_grove_led.go +++ b/examples/edison_grove_led.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,9 +9,9 @@ package main import ( "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/intel-iot/edison" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/intel-iot/edison" ) func main() { diff --git a/examples/edison_grove_light_sensor.go b/examples/edison_grove_light_sensor.go index 944534b0..4497b064 100644 --- a/examples/edison_grove_light_sensor.go +++ b/examples/edison_grove_light_sensor.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,9 +9,9 @@ package main import ( "fmt" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/aio" - "gobot.io/x/gobot/platforms/intel-iot/edison" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/aio" + "gobot.io/x/gobot/v2/platforms/intel-iot/edison" ) func main() { diff --git a/examples/edison_grove_piezo_vibration.go b/examples/edison_grove_piezo_vibration.go index 5948f075..635d19b8 100644 --- a/examples/edison_grove_piezo_vibration.go +++ b/examples/edison_grove_piezo_vibration.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,9 +9,9 @@ package main import ( "fmt" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/aio" - "gobot.io/x/gobot/platforms/intel-iot/edison" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/aio" + "gobot.io/x/gobot/v2/platforms/intel-iot/edison" ) func main() { diff --git a/examples/edison_grove_rotary_sensor.go b/examples/edison_grove_rotary_sensor.go index 451f91ae..2b50db7e 100644 --- a/examples/edison_grove_rotary_sensor.go +++ b/examples/edison_grove_rotary_sensor.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,9 +9,9 @@ package main import ( "fmt" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/aio" - "gobot.io/x/gobot/platforms/intel-iot/edison" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/aio" + "gobot.io/x/gobot/v2/platforms/intel-iot/edison" ) func main() { diff --git a/examples/edison_grove_sound_sensor.go b/examples/edison_grove_sound_sensor.go index c2756a7b..002e7f5c 100644 --- a/examples/edison_grove_sound_sensor.go +++ b/examples/edison_grove_sound_sensor.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,9 +9,9 @@ package main import ( "fmt" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/aio" - "gobot.io/x/gobot/platforms/intel-iot/edison" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/aio" + "gobot.io/x/gobot/v2/platforms/intel-iot/edison" ) func main() { diff --git a/examples/edison_grove_temperature_sensor.go b/examples/edison_grove_temperature_sensor.go index 25d616cb..721b93e1 100644 --- a/examples/edison_grove_temperature_sensor.go +++ b/examples/edison_grove_temperature_sensor.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,9 +10,9 @@ import ( "fmt" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/aio" - "gobot.io/x/gobot/platforms/intel-iot/edison" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/aio" + "gobot.io/x/gobot/v2/platforms/intel-iot/edison" ) func main() { diff --git a/examples/edison_grove_touch.go b/examples/edison_grove_touch.go index 756bdadf..96d63d30 100644 --- a/examples/edison_grove_touch.go +++ b/examples/edison_grove_touch.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,9 +9,9 @@ package main import ( "fmt" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/intel-iot/edison" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/intel-iot/edison" ) func main() { diff --git a/examples/edison_led_brightness.go b/examples/edison_led_brightness.go index edefe1e6..11537e0c 100644 --- a/examples/edison_led_brightness.go +++ b/examples/edison_led_brightness.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,9 +9,9 @@ package main import ( "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/intel-iot/edison" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/intel-iot/edison" ) func main() { diff --git a/examples/edison_led_brightness_with_analog_input.go b/examples/edison_led_brightness_with_analog_input.go index bab82445..edba45aa 100644 --- a/examples/edison_led_brightness_with_analog_input.go +++ b/examples/edison_led_brightness_with_analog_input.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,10 +9,10 @@ package main import ( "fmt" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/aio" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/intel-iot/edison" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/aio" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/intel-iot/edison" ) func main() { diff --git a/examples/edison_miniboard_grove_accelerometer.go b/examples/edison_miniboard_grove_accelerometer.go index 587e5380..b20c511d 100644 --- a/examples/edison_miniboard_grove_accelerometer.go +++ b/examples/edison_miniboard_grove_accelerometer.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,9 +10,9 @@ import ( "fmt" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/intel-iot/edison" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/intel-iot/edison" ) func main() { diff --git a/examples/edison_rgb_led.go b/examples/edison_rgb_led.go index 6aa8f1f6..427a26c3 100644 --- a/examples/edison_rgb_led.go +++ b/examples/edison_rgb_led.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,9 +9,9 @@ package main import ( "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/intel-iot/edison" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/intel-iot/edison" ) func main() { diff --git a/examples/every_done.go b/examples/every_done.go index e4106402..607f5073 100644 --- a/examples/every_done.go +++ b/examples/every_done.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,7 +10,7 @@ import ( "fmt" "time" - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" ) func main() { diff --git a/examples/firmata_adxl345.go b/examples/firmata_adxl345.go index 8496d41f..a791c2bb 100644 --- a/examples/firmata_adxl345.go +++ b/examples/firmata_adxl345.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -16,9 +18,9 @@ import ( "os" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/firmata" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/firmata" ) func main() { diff --git a/examples/firmata_aip1640.go b/examples/firmata_aip1640.go index 6d623289..2faad221 100644 --- a/examples/firmata_aip1640.go +++ b/examples/firmata_aip1640.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -15,9 +17,9 @@ import ( "os" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/firmata" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/firmata" ) func main() { diff --git a/examples/firmata_blink.go b/examples/firmata_blink.go index 5710674f..ee7ab54f 100644 --- a/examples/firmata_blink.go +++ b/examples/firmata_blink.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -16,9 +18,9 @@ import ( "os" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/firmata" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/firmata" ) func main() { diff --git a/examples/firmata_blink_api.go b/examples/firmata_blink_api.go index 7e10ca5d..35a6db39 100644 --- a/examples/firmata_blink_api.go +++ b/examples/firmata_blink_api.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,10 +9,10 @@ package main import ( "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/api" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/firmata" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/api" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/firmata" ) func main() { diff --git a/examples/firmata_blink_metal.go b/examples/firmata_blink_metal.go index cbc0905c..72136f31 100644 --- a/examples/firmata_blink_metal.go +++ b/examples/firmata_blink_metal.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,8 +9,8 @@ package main import ( "time" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/firmata" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/firmata" ) // Example of a simple led toggle without the initialization of diff --git a/examples/firmata_blink_robot.go b/examples/firmata_blink_robot.go index 87c1f06f..76c276a8 100644 --- a/examples/firmata_blink_robot.go +++ b/examples/firmata_blink_robot.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,9 +9,9 @@ package main import ( "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/firmata" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/firmata" ) func main() { diff --git a/examples/firmata_blinkm.go b/examples/firmata_blinkm.go index 947669f4..e86c6e54 100644 --- a/examples/firmata_blinkm.go +++ b/examples/firmata_blinkm.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -16,9 +18,9 @@ import ( "os" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/firmata" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/firmata" ) func main() { diff --git a/examples/firmata_bme280.go b/examples/firmata_bme280.go index 1a39e802..e9e84ed0 100644 --- a/examples/firmata_bme280.go +++ b/examples/firmata_bme280.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -9,9 +11,9 @@ import ( "os" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/firmata" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/firmata" ) func main() { diff --git a/examples/firmata_bmp180.go b/examples/firmata_bmp180.go index 096ce5be..78980e63 100644 --- a/examples/firmata_bmp180.go +++ b/examples/firmata_bmp180.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -9,9 +11,9 @@ import ( "os" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/firmata" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/firmata" ) func main() { diff --git a/examples/firmata_bmp280.go b/examples/firmata_bmp280.go index ff72fccc..ff649a6e 100644 --- a/examples/firmata_bmp280.go +++ b/examples/firmata_bmp280.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -9,9 +11,9 @@ import ( "os" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/firmata" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/firmata" ) func main() { diff --git a/examples/firmata_button.go b/examples/firmata_button.go index 2cc85040..0844b18c 100644 --- a/examples/firmata_button.go +++ b/examples/firmata_button.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -14,9 +16,9 @@ package main import ( "os" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/firmata" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/firmata" ) func main() { diff --git a/examples/firmata_buzzer.go b/examples/firmata_buzzer.go index 1b352fe2..2a406c95 100644 --- a/examples/firmata_buzzer.go +++ b/examples/firmata_buzzer.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -15,9 +17,9 @@ import ( "os" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/firmata" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/firmata" ) func main() { diff --git a/examples/firmata_cat_toy.go b/examples/firmata_cat_toy.go index d855674d..d1bbef2a 100644 --- a/examples/firmata_cat_toy.go +++ b/examples/firmata_cat_toy.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -16,10 +18,10 @@ import ( "os" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/firmata" - "gobot.io/x/gobot/platforms/leap" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/firmata" + "gobot.io/x/gobot/v2/platforms/leap" ) func main() { diff --git a/examples/firmata_curie_imu.go b/examples/firmata_curie_imu.go index a3f03501..f9f53e4b 100644 --- a/examples/firmata_curie_imu.go +++ b/examples/firmata_curie_imu.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -16,10 +18,10 @@ import ( "os" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/firmata" - "gobot.io/x/gobot/platforms/intel-iot/curie" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/firmata" + "gobot.io/x/gobot/v2/platforms/intel-iot/curie" ) func main() { diff --git a/examples/firmata_curie_imu_shock_detect.go b/examples/firmata_curie_imu_shock_detect.go index 5143efe4..bbc09abb 100644 --- a/examples/firmata_curie_imu_shock_detect.go +++ b/examples/firmata_curie_imu_shock_detect.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -16,10 +18,10 @@ import ( "os" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/firmata" - "gobot.io/x/gobot/platforms/intel-iot/curie" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/firmata" + "gobot.io/x/gobot/v2/platforms/intel-iot/curie" ) func main() { diff --git a/examples/firmata_curie_imu_step_counter.go b/examples/firmata_curie_imu_step_counter.go index 20e82120..a6797586 100644 --- a/examples/firmata_curie_imu_step_counter.go +++ b/examples/firmata_curie_imu_step_counter.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -16,10 +18,10 @@ import ( "os" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/firmata" - "gobot.io/x/gobot/platforms/intel-iot/curie" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/firmata" + "gobot.io/x/gobot/v2/platforms/intel-iot/curie" ) func main() { diff --git a/examples/firmata_curie_imu_tap_detect.go b/examples/firmata_curie_imu_tap_detect.go index 828bc59b..501711b0 100644 --- a/examples/firmata_curie_imu_tap_detect.go +++ b/examples/firmata_curie_imu_tap_detect.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -16,10 +18,10 @@ import ( "os" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/firmata" - "gobot.io/x/gobot/platforms/intel-iot/curie" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/firmata" + "gobot.io/x/gobot/v2/platforms/intel-iot/curie" ) func main() { diff --git a/examples/firmata_direct_pin.go b/examples/firmata_direct_pin.go index a7ac93db..2ba80f25 100644 --- a/examples/firmata_direct_pin.go +++ b/examples/firmata_direct_pin.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -15,9 +17,9 @@ import ( "os" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/firmata" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/firmata" ) func main() { diff --git a/examples/firmata_gpio_max7219.go b/examples/firmata_gpio_max7219.go index c261161e..d77865c6 100644 --- a/examples/firmata_gpio_max7219.go +++ b/examples/firmata_gpio_max7219.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -19,9 +21,9 @@ import ( "os" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/firmata" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/firmata" ) func main() { diff --git a/examples/firmata_grove_lcd.go b/examples/firmata_grove_lcd.go index 8ff98a6a..4cf6287b 100644 --- a/examples/firmata_grove_lcd.go +++ b/examples/firmata_grove_lcd.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,9 +10,9 @@ import ( "os" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/firmata" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/firmata" ) func main() { diff --git a/examples/firmata_grove_sound_sensor.go b/examples/firmata_grove_sound_sensor.go index 7b14a037..d0e12ab6 100644 --- a/examples/firmata_grove_sound_sensor.go +++ b/examples/firmata_grove_sound_sensor.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,9 +10,9 @@ import ( "fmt" "os" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/aio" - "gobot.io/x/gobot/platforms/firmata" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/aio" + "gobot.io/x/gobot/v2/platforms/firmata" ) func main() { diff --git a/examples/firmata_hmc6352.go b/examples/firmata_hmc6352.go index 9f7b9741..74c307c2 100644 --- a/examples/firmata_hmc6352.go +++ b/examples/firmata_hmc6352.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -16,9 +18,9 @@ import ( "os" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/firmata" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/firmata" ) func main() { diff --git a/examples/firmata_integration.go b/examples/firmata_integration.go index d983c7d8..d4006ff5 100644 --- a/examples/firmata_integration.go +++ b/examples/firmata_integration.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -16,10 +18,10 @@ import ( "os" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/aio" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/firmata" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/aio" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/firmata" ) func main() { diff --git a/examples/firmata_led_brightness.go b/examples/firmata_led_brightness.go index 128c4e5c..970093a0 100644 --- a/examples/firmata_led_brightness.go +++ b/examples/firmata_led_brightness.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -15,9 +17,9 @@ import ( "os" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/firmata" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/firmata" ) func main() { diff --git a/examples/firmata_led_brightness_with_analog_input.go b/examples/firmata_led_brightness_with_analog_input.go index a03964af..a9c6b4c3 100644 --- a/examples/firmata_led_brightness_with_analog_input.go +++ b/examples/firmata_led_brightness_with_analog_input.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -15,10 +17,10 @@ import ( "fmt" "os" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/aio" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/firmata" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/aio" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/firmata" ) func main() { diff --git a/examples/firmata_lidarlite.go b/examples/firmata_lidarlite.go index 0384ff1b..ff6a1ced 100644 --- a/examples/firmata_lidarlite.go +++ b/examples/firmata_lidarlite.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -16,9 +18,9 @@ import ( "os" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/firmata" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/firmata" ) func main() { diff --git a/examples/firmata_makey_button.go b/examples/firmata_makey_button.go index b511f8e7..ff398593 100644 --- a/examples/firmata_makey_button.go +++ b/examples/firmata_makey_button.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -14,9 +16,9 @@ package main import ( "os" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/firmata" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/firmata" ) func main() { diff --git a/examples/firmata_metal_button.go b/examples/firmata_metal_button.go index c091f306..003d34c7 100644 --- a/examples/firmata_metal_button.go +++ b/examples/firmata_metal_button.go @@ -1,21 +1,24 @@ +//go:build example // +build example + // // Do not build by default. // TO RUN: +// // firmata_metal_button // // EXAMPLE: -// go run ./examples/firmata_metal_button /dev/ttyACM0 // +// go run ./examples/firmata_metal_button /dev/ttyACM0 package main import ( "fmt" "os" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/firmata" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/firmata" ) func main() { diff --git a/examples/firmata_mma7660.go b/examples/firmata_mma7660.go index c7f0b2dd..4e9c804e 100644 --- a/examples/firmata_mma7660.go +++ b/examples/firmata_mma7660.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -16,9 +18,9 @@ import ( "os" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/firmata" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/firmata" ) func main() { diff --git a/examples/firmata_motor.go b/examples/firmata_motor.go index 4fff2d42..ab0d66fe 100644 --- a/examples/firmata_motor.go +++ b/examples/firmata_motor.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -15,9 +17,9 @@ import ( "os" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/firmata" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/firmata" ) func main() { diff --git a/examples/firmata_mpl115a2.go b/examples/firmata_mpl115a2.go index 15704231..20e943fb 100644 --- a/examples/firmata_mpl115a2.go +++ b/examples/firmata_mpl115a2.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -16,9 +18,9 @@ import ( "os" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/firmata" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/firmata" ) func main() { diff --git a/examples/firmata_mpu6050.go b/examples/firmata_mpu6050.go index d4a637ea..231a6ead 100644 --- a/examples/firmata_mpu6050.go +++ b/examples/firmata_mpu6050.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -16,9 +18,9 @@ import ( "os" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/firmata" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/firmata" ) func main() { diff --git a/examples/firmata_pca9685.go b/examples/firmata_pca9685.go index 54892671..658b96e9 100644 --- a/examples/firmata_pca9685.go +++ b/examples/firmata_pca9685.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -16,10 +18,10 @@ import ( "os" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/firmata" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/firmata" ) func main() { diff --git a/examples/firmata_pir_motion.go b/examples/firmata_pir_motion.go index c26645d6..ceb4fd0d 100644 --- a/examples/firmata_pir_motion.go +++ b/examples/firmata_pir_motion.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -15,9 +17,9 @@ import ( "fmt" "os" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/firmata" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/firmata" ) func main() { diff --git a/examples/firmata_rgb_led.go b/examples/firmata_rgb_led.go index 9b0e0893..e9cd613b 100644 --- a/examples/firmata_rgb_led.go +++ b/examples/firmata_rgb_led.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -15,9 +17,9 @@ import ( "os" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/firmata" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/firmata" ) func main() { diff --git a/examples/firmata_servo.go b/examples/firmata_servo.go index 5e084d5b..c55a0b35 100644 --- a/examples/firmata_servo.go +++ b/examples/firmata_servo.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -16,9 +18,9 @@ import ( "os" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/firmata" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/firmata" ) func main() { diff --git a/examples/firmata_ssd1306.go b/examples/firmata_ssd1306.go index 80a8dc13..a65dcf23 100644 --- a/examples/firmata_ssd1306.go +++ b/examples/firmata_ssd1306.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -9,9 +11,9 @@ import ( "os" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/firmata" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/firmata" ) func main() { diff --git a/examples/firmata_temp36.go b/examples/firmata_temp36.go index 09a83040..abc95fa1 100644 --- a/examples/firmata_temp36.go +++ b/examples/firmata_temp36.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -17,8 +19,8 @@ import ( "fmt" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/firmata" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/firmata" ) func main() { diff --git a/examples/firmata_tm1638.go b/examples/firmata_tm1638.go index b8c95d9f..0d80c9c0 100644 --- a/examples/firmata_tm1638.go +++ b/examples/firmata_tm1638.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -15,9 +17,9 @@ import ( "os" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/firmata" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/firmata" ) func main() { diff --git a/examples/firmata_travis.go b/examples/firmata_travis.go index 459c8d95..4c836d2a 100644 --- a/examples/firmata_travis.go +++ b/examples/firmata_travis.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -19,9 +21,9 @@ import ( "os" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/firmata" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/firmata" ) type TravisResponse struct { diff --git a/examples/firmata_wiichuck.go b/examples/firmata_wiichuck.go index dcb0b9e3..dff3c3cc 100644 --- a/examples/firmata_wiichuck.go +++ b/examples/firmata_wiichuck.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -15,9 +17,9 @@ import ( "fmt" "os" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/firmata" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/firmata" ) func main() { diff --git a/examples/gopigo3.go b/examples/gopigo3.go index da7d8cd5..338cced0 100644 --- a/examples/gopigo3.go +++ b/examples/gopigo3.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,9 +10,9 @@ import ( "fmt" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/dexter/gopigo3" - "gobot.io/x/gobot/platforms/raspi" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/dexter/gopigo3" + "gobot.io/x/gobot/v2/platforms/raspi" ) func main() { diff --git a/examples/gopigo3_grove_button.go b/examples/gopigo3_grove_button.go index 1b457bbf..36712c48 100644 --- a/examples/gopigo3_grove_button.go +++ b/examples/gopigo3_grove_button.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,10 +9,10 @@ package main import ( "fmt" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/dexter/gopigo3" - "gobot.io/x/gobot/platforms/raspi" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/dexter/gopigo3" + "gobot.io/x/gobot/v2/platforms/raspi" ) func main() { diff --git a/examples/gopigo3_grove_lcd.go b/examples/gopigo3_grove_lcd.go index 13c8e808..3423400d 100644 --- a/examples/gopigo3_grove_lcd.go +++ b/examples/gopigo3_grove_lcd.go @@ -1,14 +1,16 @@ +//go:build example // +build example + // // Do not build by default. package main import ( - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/dexter/gopigo3" - "gobot.io/x/gobot/platforms/raspi" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/dexter/gopigo3" + "gobot.io/x/gobot/v2/platforms/raspi" ) func main() { diff --git a/examples/gopigo3_grove_light_sensor.go b/examples/gopigo3_grove_light_sensor.go index d24250fc..e9472e34 100644 --- a/examples/gopigo3_grove_light_sensor.go +++ b/examples/gopigo3_grove_light_sensor.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,10 +9,10 @@ package main import ( "fmt" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/aio" - "gobot.io/x/gobot/platforms/dexter/gopigo3" - "gobot.io/x/gobot/platforms/raspi" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/aio" + "gobot.io/x/gobot/v2/platforms/dexter/gopigo3" + "gobot.io/x/gobot/v2/platforms/raspi" ) func main() { diff --git a/examples/gopigo3_led_brightness.go b/examples/gopigo3_led_brightness.go index 77d49b95..e6d3fb54 100644 --- a/examples/gopigo3_led_brightness.go +++ b/examples/gopigo3_led_brightness.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,10 +9,10 @@ package main import ( "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/dexter/gopigo3" - "gobot.io/x/gobot/platforms/raspi" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/dexter/gopigo3" + "gobot.io/x/gobot/v2/platforms/raspi" ) func main() { diff --git a/examples/gopigo3_servo.go b/examples/gopigo3_servo.go index 316f6589..0cd08e18 100644 --- a/examples/gopigo3_servo.go +++ b/examples/gopigo3_servo.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,10 +10,10 @@ import ( "fmt" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/dexter/gopigo3" - "gobot.io/x/gobot/platforms/raspi" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/dexter/gopigo3" + "gobot.io/x/gobot/v2/platforms/raspi" ) func main() { diff --git a/examples/hello.go b/examples/hello.go index 4afd0365..6f150367 100644 --- a/examples/hello.go +++ b/examples/hello.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,7 +10,7 @@ import ( "fmt" "time" - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" ) func main() { diff --git a/examples/hello_api.go b/examples/hello_api.go index fa795e9b..5707720c 100644 --- a/examples/hello_api.go +++ b/examples/hello_api.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -9,8 +11,8 @@ import ( "html" "net/http" - "gobot.io/x/gobot" - "gobot.io/x/gobot/api" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/api" ) func main() { diff --git a/examples/hello_api_auth.go b/examples/hello_api_auth.go index 7e6a8c06..04da9e86 100644 --- a/examples/hello_api_auth.go +++ b/examples/hello_api_auth.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -9,8 +11,8 @@ import ( "html" "net/http" - "gobot.io/x/gobot" - "gobot.io/x/gobot/api" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/api" ) func main() { diff --git a/examples/hello_api_custom.go b/examples/hello_api_custom.go index 9719183a..7fddff34 100644 --- a/examples/hello_api_custom.go +++ b/examples/hello_api_custom.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,8 +10,8 @@ import ( "fmt" "net/http" - "gobot.io/x/gobot" - "gobot.io/x/gobot/api" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/api" ) func main() { diff --git a/examples/hello_api_video.go b/examples/hello_api_video.go index 359e51fc..3d63fe04 100644 --- a/examples/hello_api_video.go +++ b/examples/hello_api_video.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -10,8 +12,8 @@ import ( "os" "github.com/hybridgroup/mjpeg" - "gobot.io/x/gobot" - "gobot.io/x/gobot/api" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/api" "gocv.io/x/gocv" ) diff --git a/examples/holystone_hs200.go b/examples/holystone_hs200.go index 40f10f42..7d9473b8 100644 --- a/examples/holystone_hs200.go +++ b/examples/holystone_hs200.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -13,8 +15,8 @@ package main import ( "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/holystone/hs200" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/holystone/hs200" ) func main() { diff --git a/examples/jetson-nano_blink.go b/examples/jetson-nano_blink.go index 72f8ba70..9174565e 100644 --- a/examples/jetson-nano_blink.go +++ b/examples/jetson-nano_blink.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,9 +9,9 @@ package main import ( "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/jetson" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/jetson" ) func main() { diff --git a/examples/jetson-nano_servo.go b/examples/jetson-nano_servo.go index 98586376..9a2278c0 100644 --- a/examples/jetson-nano_servo.go +++ b/examples/jetson-nano_servo.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -13,9 +15,9 @@ import ( "log" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/jetson" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/jetson" ) func main() { diff --git a/examples/joule_blink.go b/examples/joule_blink.go index 8434459c..87552920 100644 --- a/examples/joule_blink.go +++ b/examples/joule_blink.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,9 +9,9 @@ package main import ( "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/intel-iot/joule" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/intel-iot/joule" ) func main() { diff --git a/examples/joule_blinkm.go b/examples/joule_blinkm.go index 0a9c1e73..cc6ac5ae 100644 --- a/examples/joule_blinkm.go +++ b/examples/joule_blinkm.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,9 +10,9 @@ import ( "fmt" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/intel-iot/joule" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/intel-iot/joule" ) func main() { diff --git a/examples/joule_grove_lcd.go b/examples/joule_grove_lcd.go index 4ba1d235..ec2afd3b 100644 --- a/examples/joule_grove_lcd.go +++ b/examples/joule_grove_lcd.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,9 +9,9 @@ package main import ( "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/intel-iot/joule" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/intel-iot/joule" ) func main() { diff --git a/examples/joule_grove_rotary_sensor.go b/examples/joule_grove_rotary_sensor.go index c07dff29..84a16c2f 100644 --- a/examples/joule_grove_rotary_sensor.go +++ b/examples/joule_grove_rotary_sensor.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,10 +9,10 @@ package main import ( "fmt" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/aio" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/intel-iot/joule" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/aio" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/intel-iot/joule" ) func main() { diff --git a/examples/joule_led_brightness.go b/examples/joule_led_brightness.go index ae5b18ca..0fec54b7 100644 --- a/examples/joule_led_brightness.go +++ b/examples/joule_led_brightness.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,9 +10,9 @@ import ( "fmt" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/intel-iot/joule" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/intel-iot/joule" ) func main() { diff --git a/examples/joule_led_brightness_with_analog_input.go b/examples/joule_led_brightness_with_analog_input.go index 7e067431..3bef2733 100644 --- a/examples/joule_led_brightness_with_analog_input.go +++ b/examples/joule_led_brightness_with_analog_input.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,11 +9,11 @@ package main import ( "fmt" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/aio" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/intel-iot/joule" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/aio" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/intel-iot/joule" ) func main() { diff --git a/examples/joule_leds.go b/examples/joule_leds.go index 2a967057..ec34e215 100644 --- a/examples/joule_leds.go +++ b/examples/joule_leds.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,9 +9,9 @@ package main import ( "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/intel-iot/joule" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/intel-iot/joule" ) func main() { diff --git a/examples/joule_rgb_led.go b/examples/joule_rgb_led.go index 07af7540..b94e9fc2 100644 --- a/examples/joule_rgb_led.go +++ b/examples/joule_rgb_led.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,9 +9,9 @@ package main import ( "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/intel-iot/joule" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/intel-iot/joule" ) func main() { diff --git a/examples/joystick_ps3.go b/examples/joystick_ps3.go index 1d61119a..2cdb55bc 100644 --- a/examples/joystick_ps3.go +++ b/examples/joystick_ps3.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,8 +9,8 @@ package main import ( "fmt" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/joystick" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/joystick" ) func main() { diff --git a/examples/joystick_ps4.go b/examples/joystick_ps4.go index aaaad2e9..046c7bd0 100644 --- a/examples/joystick_ps4.go +++ b/examples/joystick_ps4.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,8 +9,8 @@ package main import ( "fmt" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/joystick" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/joystick" ) func main() { diff --git a/examples/joystick_ps5.go b/examples/joystick_ps5.go index 0333efcc..fe8d1063 100644 --- a/examples/joystick_ps5.go +++ b/examples/joystick_ps5.go @@ -9,8 +9,8 @@ package main import ( "fmt" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/joystick" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/joystick" ) func main() { diff --git a/examples/joystick_xbox360.go b/examples/joystick_xbox360.go index 9f61049f..655cb388 100644 --- a/examples/joystick_xbox360.go +++ b/examples/joystick_xbox360.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,8 +9,8 @@ package main import ( "fmt" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/joystick" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/joystick" ) func main() { diff --git a/examples/joystick_xbox360_rock_band_drums.go b/examples/joystick_xbox360_rock_band_drums.go index 1e52bfa6..a83c6993 100644 --- a/examples/joystick_xbox360_rock_band_drums.go +++ b/examples/joystick_xbox360_rock_band_drums.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,8 +9,8 @@ package main import ( "fmt" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/joystick" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/joystick" ) func main() { diff --git a/examples/joystick_xboxone.go b/examples/joystick_xboxone.go index 2133fe59..d29737c9 100644 --- a/examples/joystick_xboxone.go +++ b/examples/joystick_xboxone.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,8 +9,8 @@ package main import ( "fmt" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/joystick" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/joystick" ) func main() { diff --git a/examples/keyboard.go b/examples/keyboard.go index 20ad24e4..b26b8166 100644 --- a/examples/keyboard.go +++ b/examples/keyboard.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,8 +9,8 @@ package main import ( "fmt" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/keyboard" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/keyboard" ) func main() { diff --git a/examples/keyboard_mqtt.go b/examples/keyboard_mqtt.go index 112dfe15..b56f8155 100644 --- a/examples/keyboard_mqtt.go +++ b/examples/keyboard_mqtt.go @@ -1,13 +1,15 @@ +//go:build example // +build example + // // Do not build by default. package main import ( - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/keyboard" - "gobot.io/x/gobot/platforms/mqtt" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/keyboard" + "gobot.io/x/gobot/v2/platforms/mqtt" ) func main() { diff --git a/examples/leap_motion.go b/examples/leap_motion.go index 8ce25fbc..25ae1e9f 100644 --- a/examples/leap_motion.go +++ b/examples/leap_motion.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,8 +9,8 @@ package main import ( "fmt" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/leap" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/leap" ) func main() { diff --git a/examples/leap_motion_gestures.go b/examples/leap_motion_gestures.go index 901e6e4f..152826a3 100644 --- a/examples/leap_motion_gestures.go +++ b/examples/leap_motion_gestures.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,8 +9,8 @@ package main import ( "fmt" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/leap" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/leap" ) func main() { diff --git a/examples/leap_motion_hands.go b/examples/leap_motion_hands.go index 84936700..ecf2fbd3 100644 --- a/examples/leap_motion_hands.go +++ b/examples/leap_motion_hands.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,8 +9,8 @@ package main import ( "fmt" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/leap" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/leap" ) func main() { diff --git a/examples/leap_servos.go b/examples/leap_servos.go index b0feee5a..f3d71544 100644 --- a/examples/leap_servos.go +++ b/examples/leap_servos.go @@ -1,14 +1,16 @@ +//go:build example // +build example + // // Do not build by default. package main import ( - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/firmata" - "gobot.io/x/gobot/platforms/leap" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/firmata" + "gobot.io/x/gobot/v2/platforms/leap" ) // Video: https://www.youtube.com/watch?v=ayNMyUfdAqc diff --git a/examples/leap_sphero.go b/examples/leap_sphero.go index a77a46ee..455faec8 100644 --- a/examples/leap_sphero.go +++ b/examples/leap_sphero.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,9 +9,9 @@ package main import ( "math" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/leap" - "gobot.io/x/gobot/platforms/sphero" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/leap" + "gobot.io/x/gobot/v2/platforms/sphero" ) func main() { diff --git a/examples/mavlink.go b/examples/mavlink.go index ee3fdc1a..6f21624f 100644 --- a/examples/mavlink.go +++ b/examples/mavlink.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,9 +9,9 @@ package main import ( "fmt" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/mavlink" - common "gobot.io/x/gobot/platforms/mavlink/common" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/mavlink" + common "gobot.io/x/gobot/v2/platforms/mavlink/common" ) func main() { diff --git a/examples/megapi_motor.go b/examples/megapi_motor.go index ced95121..ca61c3db 100644 --- a/examples/megapi_motor.go +++ b/examples/megapi_motor.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,8 +9,8 @@ package main import ( "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/megapi" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/megapi" ) func main() { diff --git a/examples/metal_button.go b/examples/metal_button.go index 5cea3069..3516e641 100644 --- a/examples/metal_button.go +++ b/examples/metal_button.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,8 +9,8 @@ package main import ( "fmt" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/intel-iot/edison" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/intel-iot/edison" ) func main() { diff --git a/examples/microbit_accelerometer.go b/examples/microbit_accelerometer.go index bc66b91c..0d85c72f 100644 --- a/examples/microbit_accelerometer.go +++ b/examples/microbit_accelerometer.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -28,9 +30,9 @@ import ( "fmt" "os" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/ble" - "gobot.io/x/gobot/platforms/microbit" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/ble" + "gobot.io/x/gobot/v2/platforms/microbit" ) func main() { diff --git a/examples/microbit_blink.go b/examples/microbit_blink.go index bb5f1164..d453254c 100644 --- a/examples/microbit_blink.go +++ b/examples/microbit_blink.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -31,10 +33,10 @@ import ( "os" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/ble" - "gobot.io/x/gobot/platforms/microbit" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/ble" + "gobot.io/x/gobot/v2/platforms/microbit" ) func main() { diff --git a/examples/microbit_buttons.go b/examples/microbit_buttons.go index 0f324dc2..afd77abd 100644 --- a/examples/microbit_buttons.go +++ b/examples/microbit_buttons.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -26,9 +28,9 @@ import ( "fmt" "os" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/ble" - "gobot.io/x/gobot/platforms/microbit" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/ble" + "gobot.io/x/gobot/v2/platforms/microbit" ) func main() { diff --git a/examples/microbit_buttons_leds.go b/examples/microbit_buttons_leds.go index e424dbd6..77cb3f0f 100644 --- a/examples/microbit_buttons_leds.go +++ b/examples/microbit_buttons_leds.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -27,9 +29,9 @@ package main import ( "os" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/ble" - "gobot.io/x/gobot/platforms/microbit" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/ble" + "gobot.io/x/gobot/v2/platforms/microbit" ) func main() { diff --git a/examples/microbit_io_button.go b/examples/microbit_io_button.go index e0cfd699..c9978138 100644 --- a/examples/microbit_io_button.go +++ b/examples/microbit_io_button.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -31,10 +33,10 @@ package main import ( "os" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/ble" - "gobot.io/x/gobot/platforms/microbit" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/ble" + "gobot.io/x/gobot/v2/platforms/microbit" ) func main() { diff --git a/examples/microbit_led.go b/examples/microbit_led.go index 94241bce..a034f35b 100644 --- a/examples/microbit_led.go +++ b/examples/microbit_led.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -28,9 +30,9 @@ import ( "os" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/ble" - "gobot.io/x/gobot/platforms/microbit" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/ble" + "gobot.io/x/gobot/v2/platforms/microbit" ) func main() { diff --git a/examples/microbit_magnetometer.go b/examples/microbit_magnetometer.go index 1e06d089..ffae1d67 100644 --- a/examples/microbit_magnetometer.go +++ b/examples/microbit_magnetometer.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -28,9 +30,9 @@ import ( "fmt" "os" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/ble" - "gobot.io/x/gobot/platforms/microbit" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/ble" + "gobot.io/x/gobot/v2/platforms/microbit" ) func main() { diff --git a/examples/microbit_temperature.go b/examples/microbit_temperature.go index 22da29ec..821aad37 100644 --- a/examples/microbit_temperature.go +++ b/examples/microbit_temperature.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -28,9 +30,9 @@ import ( "fmt" "os" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/ble" - "gobot.io/x/gobot/platforms/microbit" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/ble" + "gobot.io/x/gobot/v2/platforms/microbit" ) func main() { diff --git a/examples/minidrone.go b/examples/minidrone.go index 1e4d121d..a7a0b93b 100644 --- a/examples/minidrone.go +++ b/examples/minidrone.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -17,9 +19,9 @@ import ( "os" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/ble" - "gobot.io/x/gobot/platforms/parrot/minidrone" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/ble" + "gobot.io/x/gobot/v2/platforms/parrot/minidrone" ) func main() { diff --git a/examples/minidrone_events.go b/examples/minidrone_events.go index 02b4c816..6005d29e 100644 --- a/examples/minidrone_events.go +++ b/examples/minidrone_events.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -18,9 +20,9 @@ import ( "os" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/ble" - "gobot.io/x/gobot/platforms/parrot/minidrone" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/ble" + "gobot.io/x/gobot/v2/platforms/parrot/minidrone" ) func main() { diff --git a/examples/minidrone_mambo_ps3.go b/examples/minidrone_mambo_ps3.go index e7c72425..d38e4af6 100644 --- a/examples/minidrone_mambo_ps3.go +++ b/examples/minidrone_mambo_ps3.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -25,10 +27,10 @@ import ( "sync/atomic" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/ble" - "gobot.io/x/gobot/platforms/joystick" - "gobot.io/x/gobot/platforms/parrot/minidrone" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/ble" + "gobot.io/x/gobot/v2/platforms/joystick" + "gobot.io/x/gobot/v2/platforms/parrot/minidrone" ) type pair struct { diff --git a/examples/minidrone_ps3.go b/examples/minidrone_ps3.go index a591d1e1..a09959ec 100644 --- a/examples/minidrone_ps3.go +++ b/examples/minidrone_ps3.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -25,10 +27,10 @@ import ( "sync/atomic" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/ble" - "gobot.io/x/gobot/platforms/joystick" - "gobot.io/x/gobot/platforms/parrot/minidrone" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/ble" + "gobot.io/x/gobot/v2/platforms/joystick" + "gobot.io/x/gobot/v2/platforms/parrot/minidrone" ) type pair struct { diff --git a/examples/mqtt_driver_ping.go b/examples/mqtt_driver_ping.go index 7d4905cc..1236d80c 100644 --- a/examples/mqtt_driver_ping.go +++ b/examples/mqtt_driver_ping.go @@ -1,13 +1,16 @@ +//go:build example // +build example + // // Do not build by default. // TO RUN: -// go run ./examples/mqtt_driver_ping.go +// +// go run ./examples/mqtt_driver_ping.go // // EXAMPLE: -// go run ./examples/mqtt_driver_ping.go ssl://iot.eclipse.org:8883 // +// go run ./examples/mqtt_driver_ping.go ssl://iot.eclipse.org:8883 package main import ( @@ -15,8 +18,8 @@ import ( "os" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/mqtt" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/mqtt" ) func main() { diff --git a/examples/mqtt_firmata_blink.go b/examples/mqtt_firmata_blink.go index fce4f6d1..23fb9701 100644 --- a/examples/mqtt_firmata_blink.go +++ b/examples/mqtt_firmata_blink.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,10 +9,10 @@ package main import ( "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/firmata" - "gobot.io/x/gobot/platforms/mqtt" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/firmata" + "gobot.io/x/gobot/v2/platforms/mqtt" ) func main() { diff --git a/examples/mqtt_ping.go b/examples/mqtt_ping.go index e97ba08c..ba3b1ccd 100644 --- a/examples/mqtt_ping.go +++ b/examples/mqtt_ping.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,8 +10,8 @@ import ( "fmt" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/mqtt" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/mqtt" ) func main() { diff --git a/examples/nanopi_direct_pin.go b/examples/nanopi_direct_pin.go index 1d72b289..616b2ef7 100644 --- a/examples/nanopi_direct_pin.go +++ b/examples/nanopi_direct_pin.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,10 +10,10 @@ import ( "fmt" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/adaptors" - "gobot.io/x/gobot/platforms/nanopi" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/adaptors" + "gobot.io/x/gobot/v2/platforms/nanopi" ) // Wiring diff --git a/examples/nanopi_direct_pin_event.go b/examples/nanopi_direct_pin_event.go index 55b8f12c..39c2a2c8 100644 --- a/examples/nanopi_direct_pin_event.go +++ b/examples/nanopi_direct_pin_event.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,9 +10,9 @@ import ( "fmt" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/nanopi" - "gobot.io/x/gobot/system" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/nanopi" + "gobot.io/x/gobot/v2/system" ) const ( diff --git a/examples/nanopi_led_brightness.go b/examples/nanopi_led_brightness.go index 199aebb0..72af91a0 100644 --- a/examples/nanopi_led_brightness.go +++ b/examples/nanopi_led_brightness.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,9 +10,9 @@ import ( "fmt" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/nanopi" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/nanopi" ) // Wiring diff --git a/examples/nanopi_pca9533.go b/examples/nanopi_pca9533.go index a7b16c9d..9c5f64bb 100644 --- a/examples/nanopi_pca9533.go +++ b/examples/nanopi_pca9533.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,9 +10,9 @@ import ( "fmt" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/nanopi" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/nanopi" ) // Wiring diff --git a/examples/nats.go b/examples/nats.go index 7a541a9a..fdefc508 100644 --- a/examples/nats.go +++ b/examples/nats.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,8 +10,8 @@ import ( "fmt" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/nats" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/nats" ) func main() { diff --git a/examples/nats_driver_ping.go b/examples/nats_driver_ping.go index 2352d9ab..b813b9fb 100644 --- a/examples/nats_driver_ping.go +++ b/examples/nats_driver_ping.go @@ -1,13 +1,16 @@ +//go:build example // +build example + // // Do not build by default. // TO RUN: -// go run ./examples/nats_driver_ping.go +// +// go run ./examples/nats_driver_ping.go // // EXAMPLE: -// go run ./examples/nats_driver_ping.go tls://nats.demo.io:4443 // +// go run ./examples/nats_driver_ping.go tls://nats.demo.io:4443 package main import ( @@ -15,8 +18,8 @@ import ( "os" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/nats" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/nats" ) func main() { diff --git a/examples/neurosky.go b/examples/neurosky.go index e9dd1618..37cb12a9 100644 --- a/examples/neurosky.go +++ b/examples/neurosky.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,8 +9,8 @@ package main import ( "fmt" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/neurosky" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/neurosky" ) func main() { diff --git a/examples/ollie.go b/examples/ollie.go index 7b480ba2..e98da7b1 100644 --- a/examples/ollie.go +++ b/examples/ollie.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,9 +10,9 @@ import ( "os" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/ble" - "gobot.io/x/gobot/platforms/sphero/ollie" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/ble" + "gobot.io/x/gobot/v2/platforms/sphero/ollie" ) func main() { diff --git a/examples/ollie_boost.go b/examples/ollie_boost.go index f3ce608d..389008c4 100644 --- a/examples/ollie_boost.go +++ b/examples/ollie_boost.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,9 +10,9 @@ import ( "os" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/ble" - "gobot.io/x/gobot/platforms/sphero/ollie" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/ble" + "gobot.io/x/gobot/v2/platforms/sphero/ollie" ) func main() { diff --git a/examples/ollie_crazy.go b/examples/ollie_crazy.go index 42a0502e..d6a7bf9f 100644 --- a/examples/ollie_crazy.go +++ b/examples/ollie_crazy.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,9 +10,9 @@ import ( "os" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/ble" - "gobot.io/x/gobot/platforms/sphero/ollie" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/ble" + "gobot.io/x/gobot/v2/platforms/sphero/ollie" ) func main() { diff --git a/examples/ollie_mqtt.go b/examples/ollie_mqtt.go index b2923d69..3e8998f6 100644 --- a/examples/ollie_mqtt.go +++ b/examples/ollie_mqtt.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -9,10 +11,10 @@ import ( "strconv" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/ble" - "gobot.io/x/gobot/platforms/mqtt" - "gobot.io/x/gobot/platforms/sphero/ollie" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/ble" + "gobot.io/x/gobot/v2/platforms/mqtt" + "gobot.io/x/gobot/v2/platforms/sphero/ollie" ) const ( diff --git a/examples/ollie_multiple.go b/examples/ollie_multiple.go index 1bf9a966..01dadf81 100644 --- a/examples/ollie_multiple.go +++ b/examples/ollie_multiple.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -16,10 +18,10 @@ import ( "os" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/api" - "gobot.io/x/gobot/platforms/ble" - "gobot.io/x/gobot/platforms/sphero/ollie" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/api" + "gobot.io/x/gobot/v2/platforms/ble" + "gobot.io/x/gobot/v2/platforms/sphero/ollie" ) func NewSwarmBot(port string) *gobot.Robot { diff --git a/examples/ollie_roll.go b/examples/ollie_roll.go index 8363c419..3ee7c30a 100644 --- a/examples/ollie_roll.go +++ b/examples/ollie_roll.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,9 +10,9 @@ import ( "os" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/ble" - "gobot.io/x/gobot/platforms/sphero/ollie" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/ble" + "gobot.io/x/gobot/v2/platforms/sphero/ollie" ) func main() { diff --git a/examples/ollie_spin.go b/examples/ollie_spin.go index acab57cf..736e9a4e 100644 --- a/examples/ollie_spin.go +++ b/examples/ollie_spin.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,9 +10,9 @@ import ( "os" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/ble" - "gobot.io/x/gobot/platforms/sphero/ollie" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/ble" + "gobot.io/x/gobot/v2/platforms/sphero/ollie" ) func main() { diff --git a/examples/opencv_face_detect.go b/examples/opencv_face_detect.go index c3af94c6..54774e8e 100644 --- a/examples/opencv_face_detect.go +++ b/examples/opencv_face_detect.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -10,8 +12,8 @@ import ( "sync/atomic" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/opencv" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/opencv" "gocv.io/x/gocv" ) diff --git a/examples/opencv_window.go b/examples/opencv_window.go index 7b3a0073..ece48d18 100644 --- a/examples/opencv_window.go +++ b/examples/opencv_window.go @@ -1,12 +1,14 @@ +//go:build example // +build example + // // Do not build by default. package main import ( - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/opencv" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/opencv" "gocv.io/x/gocv" ) diff --git a/examples/particle_api.go b/examples/particle_api.go index 4487968c..d39f390a 100644 --- a/examples/particle_api.go +++ b/examples/particle_api.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -15,10 +17,10 @@ import ( "os" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/api" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/particle" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/api" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/particle" ) func main() { diff --git a/examples/particle_blink.go b/examples/particle_blink.go index 835118df..53212927 100644 --- a/examples/particle_blink.go +++ b/examples/particle_blink.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -15,9 +17,9 @@ import ( "os" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/particle" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/particle" ) func main() { diff --git a/examples/particle_button.go b/examples/particle_button.go index d4328415..abe5d7f9 100644 --- a/examples/particle_button.go +++ b/examples/particle_button.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -14,9 +16,9 @@ package main import ( "os" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/particle" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/particle" ) func main() { diff --git a/examples/particle_events.go b/examples/particle_events.go index 8088be9f..77d39b43 100644 --- a/examples/particle_events.go +++ b/examples/particle_events.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -15,8 +17,8 @@ import ( "fmt" "os" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/particle" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/particle" ) func main() { diff --git a/examples/particle_function.go b/examples/particle_function.go index 714fff8c..5135519c 100644 --- a/examples/particle_function.go +++ b/examples/particle_function.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -15,8 +17,8 @@ import ( "fmt" "os" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/particle" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/particle" ) func main() { diff --git a/examples/particle_led_brightness.go b/examples/particle_led_brightness.go index c0448660..40e7672c 100644 --- a/examples/particle_led_brightness.go +++ b/examples/particle_led_brightness.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -15,9 +17,9 @@ import ( "os" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/particle" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/particle" ) func main() { diff --git a/examples/particle_variable.go b/examples/particle_variable.go index 4022fbfd..1f202390 100644 --- a/examples/particle_variable.go +++ b/examples/particle_variable.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -16,8 +18,8 @@ import ( "os" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/particle" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/particle" ) func main() { diff --git a/examples/pebble.go b/examples/pebble.go index 4c95f4ba..d585e565 100644 --- a/examples/pebble.go +++ b/examples/pebble.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,9 +9,9 @@ package main import ( "fmt" - "gobot.io/x/gobot" - "gobot.io/x/gobot/api" - "gobot.io/x/gobot/platforms/pebble" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/api" + "gobot.io/x/gobot/v2/platforms/pebble" ) func main() { diff --git a/examples/pebble_accelerometer.go b/examples/pebble_accelerometer.go index 13554956..5444312b 100644 --- a/examples/pebble_accelerometer.go +++ b/examples/pebble_accelerometer.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,9 +9,9 @@ package main import ( "fmt" - "gobot.io/x/gobot" - "gobot.io/x/gobot/api" - "gobot.io/x/gobot/platforms/pebble" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/api" + "gobot.io/x/gobot/v2/platforms/pebble" ) func main() { diff --git a/examples/raspi_adafruit_dcmotor.go b/examples/raspi_adafruit_dcmotor.go index 07bb1e8e..8850a0bb 100644 --- a/examples/raspi_adafruit_dcmotor.go +++ b/examples/raspi_adafruit_dcmotor.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,9 +10,9 @@ import ( "log" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/raspi" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/raspi" ) func adafruitDCMotorRunner(a *i2c.AdafruitMotorHatDriver, dcMotor int) (err error) { diff --git a/examples/raspi_adafruit_servo.go b/examples/raspi_adafruit_servo.go index 1146ec42..1d56311b 100644 --- a/examples/raspi_adafruit_servo.go +++ b/examples/raspi_adafruit_servo.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,9 +10,9 @@ import ( "log" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/raspi" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/raspi" ) var ( diff --git a/examples/raspi_adafruit_stepper.go b/examples/raspi_adafruit_stepper.go index 6808048d..205b1d26 100644 --- a/examples/raspi_adafruit_stepper.go +++ b/examples/raspi_adafruit_stepper.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,9 +10,9 @@ import ( "log" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/raspi" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/raspi" ) func adafruitStepperMotorRunner(a *i2c.AdafruitMotorHatDriver, motor int) (err error) { diff --git a/examples/raspi_ads1015.go b/examples/raspi_ads1015.go index 19155b18..8ac0b29a 100644 --- a/examples/raspi_ads1015.go +++ b/examples/raspi_ads1015.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,9 +10,9 @@ import ( "fmt" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/raspi" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/raspi" ) func main() { diff --git a/examples/raspi_blink.go b/examples/raspi_blink.go index ed06cf0c..fb362395 100644 --- a/examples/raspi_blink.go +++ b/examples/raspi_blink.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,9 +9,9 @@ package main import ( "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/raspi" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/raspi" ) func main() { diff --git a/examples/raspi_blinkm.go b/examples/raspi_blinkm.go index 7be9a1e9..bf7a3d06 100644 --- a/examples/raspi_blinkm.go +++ b/examples/raspi_blinkm.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,9 +10,9 @@ import ( "fmt" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/raspi" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/raspi" ) func main() { diff --git a/examples/raspi_button.go b/examples/raspi_button.go index 8ac28bfb..b1e620df 100644 --- a/examples/raspi_button.go +++ b/examples/raspi_button.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,9 +9,9 @@ package main import ( "fmt" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/raspi" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/raspi" ) func main() { diff --git a/examples/raspi_ccs811.go b/examples/raspi_ccs811.go index 7087af73..275fe915 100644 --- a/examples/raspi_ccs811.go +++ b/examples/raspi_ccs811.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,9 +10,9 @@ import ( "fmt" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/raspi" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/raspi" ) func CCS811BootData(a *i2c.CCS811Driver) { diff --git a/examples/raspi_direct_pin.go b/examples/raspi_direct_pin.go index 968e6e19..24f31e47 100644 --- a/examples/raspi_direct_pin.go +++ b/examples/raspi_direct_pin.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,10 +10,10 @@ import ( "fmt" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/adaptors" - "gobot.io/x/gobot/platforms/raspi" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/adaptors" + "gobot.io/x/gobot/v2/platforms/raspi" ) // Wiring diff --git a/examples/raspi_direct_pin_event.go b/examples/raspi_direct_pin_event.go index b2d469ad..ccb44c0a 100644 --- a/examples/raspi_direct_pin_event.go +++ b/examples/raspi_direct_pin_event.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,9 +10,9 @@ import ( "fmt" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/raspi" - "gobot.io/x/gobot/system" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/raspi" + "gobot.io/x/gobot/v2/system" ) const ( diff --git a/examples/raspi_generic.go b/examples/raspi_generic.go index 83f2ac97..45ea5cbe 100644 --- a/examples/raspi_generic.go +++ b/examples/raspi_generic.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -9,9 +11,9 @@ import ( "reflect" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/raspi" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/raspi" ) // Wiring diff --git a/examples/raspi_grove_pi_blink.go b/examples/raspi_grove_pi_blink.go index bd058f4c..96d0678c 100644 --- a/examples/raspi_grove_pi_blink.go +++ b/examples/raspi_grove_pi_blink.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,10 +9,10 @@ package main import ( "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/raspi" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/raspi" ) func main() { diff --git a/examples/raspi_grove_pi_button.go b/examples/raspi_grove_pi_button.go index 63371065..c7818fba 100644 --- a/examples/raspi_grove_pi_button.go +++ b/examples/raspi_grove_pi_button.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,10 +9,10 @@ package main import ( "fmt" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/raspi" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/raspi" ) func main() { diff --git a/examples/raspi_grove_pi_dht.go b/examples/raspi_grove_pi_dht.go index 06415562..6aee0f99 100644 --- a/examples/raspi_grove_pi_dht.go +++ b/examples/raspi_grove_pi_dht.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,9 +10,9 @@ import ( "fmt" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/raspi" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/raspi" ) const ( diff --git a/examples/raspi_grove_pi_rotary.go b/examples/raspi_grove_pi_rotary.go index fa225652..c73ba961 100644 --- a/examples/raspi_grove_pi_rotary.go +++ b/examples/raspi_grove_pi_rotary.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,10 +9,10 @@ package main import ( "fmt" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/aio" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/raspi" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/aio" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/raspi" ) func main() { diff --git a/examples/raspi_grove_pi_ultrasonic.go b/examples/raspi_grove_pi_ultrasonic.go index ba6db6c1..4d213b90 100644 --- a/examples/raspi_grove_pi_ultrasonic.go +++ b/examples/raspi_grove_pi_ultrasonic.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,9 +10,9 @@ import ( "fmt" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/raspi" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/raspi" ) const ( diff --git a/examples/raspi_grove_rotary_sensor.go b/examples/raspi_grove_rotary_sensor.go index abe42517..43879890 100644 --- a/examples/raspi_grove_rotary_sensor.go +++ b/examples/raspi_grove_rotary_sensor.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,10 +9,10 @@ package main import ( "fmt" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/aio" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/raspi" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/aio" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/raspi" ) func main() { diff --git a/examples/raspi_hmc5883l.go b/examples/raspi_hmc5883l.go index 2d86e7e8..57c55b43 100644 --- a/examples/raspi_hmc5883l.go +++ b/examples/raspi_hmc5883l.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -14,9 +16,9 @@ import ( "fmt" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/raspi" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/raspi" ) func main() { diff --git a/examples/raspi_ina3221.go b/examples/raspi_ina3221.go index 7d08d8ad..001f4153 100644 --- a/examples/raspi_ina3221.go +++ b/examples/raspi_ina3221.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,9 +10,9 @@ import ( "fmt" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/raspi" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/raspi" ) func main() { diff --git a/examples/raspi_led_brightness.go b/examples/raspi_led_brightness.go index 19e0ba6a..ae3da2c2 100644 --- a/examples/raspi_led_brightness.go +++ b/examples/raspi_led_brightness.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,9 +9,9 @@ package main import ( "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/raspi" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/raspi" ) func main() { diff --git a/examples/raspi_mcp3008.go b/examples/raspi_mcp3008.go index 1a8827d7..1ecebd75 100644 --- a/examples/raspi_mcp3008.go +++ b/examples/raspi_mcp3008.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,9 +10,9 @@ import ( "fmt" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/spi" - "gobot.io/x/gobot/platforms/raspi" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/spi" + "gobot.io/x/gobot/v2/platforms/raspi" ) func main() { diff --git a/examples/raspi_pca9533.go b/examples/raspi_pca9533.go index 6cd0f6cb..a48ec1f4 100644 --- a/examples/raspi_pca9533.go +++ b/examples/raspi_pca9533.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,9 +10,9 @@ import ( "fmt" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/raspi" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/raspi" ) // Wiring diff --git a/examples/raspi_sht2x.go b/examples/raspi_sht2x.go index a6b64964..92cca323 100644 --- a/examples/raspi_sht2x.go +++ b/examples/raspi_sht2x.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,9 +10,9 @@ import ( "fmt" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/raspi" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/raspi" ) func main() { diff --git a/examples/raspi_sht3x.go b/examples/raspi_sht3x.go index 8634c305..2f3411ba 100644 --- a/examples/raspi_sht3x.go +++ b/examples/raspi_sht3x.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,9 +10,9 @@ import ( "fmt" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/raspi" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/raspi" ) func main() { diff --git a/examples/raspi_ssd1306.go b/examples/raspi_ssd1306.go index 0d030f29..fc08aa93 100644 --- a/examples/raspi_ssd1306.go +++ b/examples/raspi_ssd1306.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,9 +9,9 @@ package main import ( "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/raspi" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/raspi" ) func main() { diff --git a/examples/raspi_ssd1306spi.go b/examples/raspi_ssd1306spi.go index 1d560087..4df424e7 100644 --- a/examples/raspi_ssd1306spi.go +++ b/examples/raspi_ssd1306spi.go @@ -1,13 +1,15 @@ +//go:build example // +build example + // // Do not build by default. package main import ( - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/spi" - "gobot.io/x/gobot/platforms/raspi" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/spi" + "gobot.io/x/gobot/v2/platforms/raspi" ) // this example only works for a 128x64 display diff --git a/examples/raspi_stepper_move.go b/examples/raspi_stepper_move.go index 15495481..5c22b9b2 100644 --- a/examples/raspi_stepper_move.go +++ b/examples/raspi_stepper_move.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,9 +9,9 @@ package main import ( "fmt" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/raspi" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/raspi" ) func main() { diff --git a/examples/sphero.go b/examples/sphero.go index 2f2b3c7f..f876f4a1 100644 --- a/examples/sphero.go +++ b/examples/sphero.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,8 +10,8 @@ import ( "fmt" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/sphero" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/sphero" ) func main() { diff --git a/examples/sphero_api.go b/examples/sphero_api.go index 204d3ca2..0c38abce 100644 --- a/examples/sphero_api.go +++ b/examples/sphero_api.go @@ -1,13 +1,15 @@ +//go:build example // +build example + // // Do not build by default. package main import ( - "gobot.io/x/gobot" - "gobot.io/x/gobot/api" - "gobot.io/x/gobot/platforms/sphero" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/api" + "gobot.io/x/gobot/v2/platforms/sphero" ) func main() { diff --git a/examples/sphero_conways.go b/examples/sphero_conways.go index 353b7db6..23d97fc6 100644 --- a/examples/sphero_conways.go +++ b/examples/sphero_conways.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,8 +10,8 @@ import ( "fmt" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/sphero" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/sphero" ) type conway struct { diff --git a/examples/sphero_dpad.go b/examples/sphero_dpad.go index 0a0b01d3..f41c16c6 100644 --- a/examples/sphero_dpad.go +++ b/examples/sphero_dpad.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,9 +9,9 @@ package main import ( "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/api" - "gobot.io/x/gobot/platforms/sphero" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/api" + "gobot.io/x/gobot/v2/platforms/sphero" ) func main() { diff --git a/examples/sphero_master.go b/examples/sphero_master.go index a6653c40..19fe9b43 100644 --- a/examples/sphero_master.go +++ b/examples/sphero_master.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,8 +9,8 @@ package main import ( "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/sphero" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/sphero" ) func main() { diff --git a/examples/sphero_multiple.go b/examples/sphero_multiple.go index 94e55342..5748d771 100644 --- a/examples/sphero_multiple.go +++ b/examples/sphero_multiple.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,9 +10,9 @@ import ( "fmt" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/api" - "gobot.io/x/gobot/platforms/sphero" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/api" + "gobot.io/x/gobot/v2/platforms/sphero" ) func NewSwarmBot(port string) *gobot.Robot { diff --git a/examples/sprkplus.go b/examples/sprkplus.go index 5b2dd795..8ad732e8 100644 --- a/examples/sprkplus.go +++ b/examples/sprkplus.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -17,9 +19,9 @@ import ( "os" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/ble" - "gobot.io/x/gobot/platforms/sphero/sprkplus" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/ble" + "gobot.io/x/gobot/v2/platforms/sphero/sprkplus" ) func main() { diff --git a/examples/sprkplus_collision.go b/examples/sprkplus_collision.go index fc707a4b..4d58a5f8 100644 --- a/examples/sprkplus_collision.go +++ b/examples/sprkplus_collision.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -17,9 +19,9 @@ import ( "fmt" "os" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/ble" - "gobot.io/x/gobot/platforms/sphero/sprkplus" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/ble" + "gobot.io/x/gobot/v2/platforms/sphero/sprkplus" ) func main() { diff --git a/examples/square.go b/examples/square.go index 1a36ab6a..bd0921b8 100644 --- a/examples/square.go +++ b/examples/square.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,10 +9,10 @@ package main import ( "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/api" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/intel-iot/edison" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/api" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/intel-iot/edison" ) func main() { diff --git a/examples/square_fire.go b/examples/square_fire.go index aae23487..69c9c012 100644 --- a/examples/square_fire.go +++ b/examples/square_fire.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,10 +9,10 @@ package main import ( "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/api" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/intel-iot/edison" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/api" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/intel-iot/edison" ) func main() { diff --git a/examples/tello.go b/examples/tello.go index ea019794..2d7b442f 100644 --- a/examples/tello.go +++ b/examples/tello.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -16,8 +18,8 @@ package main import ( "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/dji/tello" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/dji/tello" ) func main() { diff --git a/examples/tello_facetracker.go b/examples/tello_facetracker.go index 632e56c3..1a65dfd6 100644 --- a/examples/tello_facetracker.go +++ b/examples/tello_facetracker.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -28,9 +30,9 @@ import ( "sync/atomic" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/dji/tello" - "gobot.io/x/gobot/platforms/joystick" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/dji/tello" + "gobot.io/x/gobot/v2/platforms/joystick" "gocv.io/x/gocv" ) diff --git a/examples/tello_keyboard.go b/examples/tello_keyboard.go index 29d7121e..82ee7c9b 100644 --- a/examples/tello_keyboard.go +++ b/examples/tello_keyboard.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -16,9 +18,9 @@ package main import ( "fmt" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/dji/tello" - "gobot.io/x/gobot/platforms/keyboard" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/dji/tello" + "gobot.io/x/gobot/v2/platforms/keyboard" ) func resetDronePostion(drone *tello.Driver) { diff --git a/examples/tello_opencv.go b/examples/tello_opencv.go index 4620ace4..165c5d85 100644 --- a/examples/tello_opencv.go +++ b/examples/tello_opencv.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -20,8 +22,8 @@ import ( "strconv" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/dji/tello" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/dji/tello" "gocv.io/x/gocv" ) diff --git a/examples/tello_ps3.go b/examples/tello_ps3.go index 83cd1912..5d4f998d 100644 --- a/examples/tello_ps3.go +++ b/examples/tello_ps3.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -20,9 +22,9 @@ import ( "sync/atomic" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/dji/tello" - "gobot.io/x/gobot/platforms/joystick" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/dji/tello" + "gobot.io/x/gobot/v2/platforms/joystick" ) type pair struct { diff --git a/examples/tello_video.go b/examples/tello_video.go index 3d2bf15d..55b649b4 100644 --- a/examples/tello_video.go +++ b/examples/tello_video.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -18,8 +20,8 @@ import ( "os/exec" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/dji/tello" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/dji/tello" ) func main() { diff --git a/examples/tinkerboard_adafruit1109_lcd_keys.go b/examples/tinkerboard_adafruit1109_lcd_keys.go index 0f29c146..ae3f93fe 100644 --- a/examples/tinkerboard_adafruit1109_lcd_keys.go +++ b/examples/tinkerboard_adafruit1109_lcd_keys.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,9 +10,9 @@ import ( "fmt" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/tinkerboard" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/tinkerboard" ) // Wiring diff --git a/examples/tinkerboard_ads1115.go b/examples/tinkerboard_ads1115.go index c08e48d4..88304863 100644 --- a/examples/tinkerboard_ads1115.go +++ b/examples/tinkerboard_ads1115.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,9 +10,9 @@ import ( "fmt" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/tinkerboard" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/tinkerboard" ) // Wiring diff --git a/examples/tinkerboard_adxl345.go b/examples/tinkerboard_adxl345.go index c75d6cad..4dd6b65c 100644 --- a/examples/tinkerboard_adxl345.go +++ b/examples/tinkerboard_adxl345.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,9 +10,9 @@ import ( "fmt" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/tinkerboard" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/tinkerboard" ) // Wiring diff --git a/examples/tinkerboard_blink.go b/examples/tinkerboard_blink.go index 7e363529..c90faefe 100644 --- a/examples/tinkerboard_blink.go +++ b/examples/tinkerboard_blink.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,9 +9,9 @@ package main import ( "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/tinkerboard" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/tinkerboard" ) func main() { diff --git a/examples/tinkerboard_bme280.go b/examples/tinkerboard_bme280.go index f6bb2068..4a78ff95 100644 --- a/examples/tinkerboard_bme280.go +++ b/examples/tinkerboard_bme280.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,9 +10,9 @@ import ( "fmt" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/tinkerboard" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/tinkerboard" ) // Wiring diff --git a/examples/tinkerboard_bmp280.go b/examples/tinkerboard_bmp280.go index 12fd9782..8146ca7e 100644 --- a/examples/tinkerboard_bmp280.go +++ b/examples/tinkerboard_bmp280.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,9 +10,9 @@ import ( "fmt" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/tinkerboard" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/tinkerboard" ) // Wiring diff --git a/examples/tinkerboard_direct_pin.go b/examples/tinkerboard_direct_pin.go index b37999ca..4a3b4352 100644 --- a/examples/tinkerboard_direct_pin.go +++ b/examples/tinkerboard_direct_pin.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,10 +10,10 @@ import ( "fmt" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/adaptors" - "gobot.io/x/gobot/platforms/tinkerboard" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/adaptors" + "gobot.io/x/gobot/v2/platforms/tinkerboard" ) // Wiring diff --git a/examples/tinkerboard_generic.go b/examples/tinkerboard_generic.go index 78e2ead6..e54948b4 100644 --- a/examples/tinkerboard_generic.go +++ b/examples/tinkerboard_generic.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -9,9 +11,9 @@ import ( "reflect" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/tinkerboard" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/tinkerboard" ) // Attention! Possibly this will not work, because the current kernel of Tinker-OS 4.4.194 (2021-10-06) needs the diff --git a/examples/tinkerboard_grove_lcd.go b/examples/tinkerboard_grove_lcd.go index d69e02b9..b0ff7ed7 100644 --- a/examples/tinkerboard_grove_lcd.go +++ b/examples/tinkerboard_grove_lcd.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,9 +9,9 @@ package main import ( "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/tinkerboard" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/tinkerboard" ) func main() { diff --git a/examples/tinkerboard_hmc5883l.go b/examples/tinkerboard_hmc5883l.go index a985496f..32b9c3c3 100644 --- a/examples/tinkerboard_hmc5883l.go +++ b/examples/tinkerboard_hmc5883l.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -9,9 +11,9 @@ import ( "log" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/tinkerboard" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/tinkerboard" ) // Wiring diff --git a/examples/tinkerboard_mfcrc522gpio.go b/examples/tinkerboard_mfcrc522gpio.go index 50fa6715..b630b2ef 100644 --- a/examples/tinkerboard_mfcrc522gpio.go +++ b/examples/tinkerboard_mfcrc522gpio.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,10 +10,10 @@ import ( "fmt" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/spi" - "gobot.io/x/gobot/platforms/adaptors" - "gobot.io/x/gobot/platforms/tinkerboard" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/spi" + "gobot.io/x/gobot/v2/platforms/adaptors" + "gobot.io/x/gobot/v2/platforms/tinkerboard" ) // Wiring diff --git a/examples/tinkerboard_mfcrc522spi.go b/examples/tinkerboard_mfcrc522spi.go index ece3cf77..ccb0c849 100644 --- a/examples/tinkerboard_mfcrc522spi.go +++ b/examples/tinkerboard_mfcrc522spi.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,9 +10,9 @@ import ( "fmt" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/spi" - "gobot.io/x/gobot/platforms/tinkerboard" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/spi" + "gobot.io/x/gobot/v2/platforms/tinkerboard" ) // Wiring diff --git a/examples/tinkerboard_mpl115a2.go b/examples/tinkerboard_mpl115a2.go index adc42d79..fbab149e 100644 --- a/examples/tinkerboard_mpl115a2.go +++ b/examples/tinkerboard_mpl115a2.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,9 +10,9 @@ import ( "fmt" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/tinkerboard" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/tinkerboard" ) // Wiring diff --git a/examples/tinkerboard_mpu6050.go b/examples/tinkerboard_mpu6050.go index 0fb63377..dbac9d20 100644 --- a/examples/tinkerboard_mpu6050.go +++ b/examples/tinkerboard_mpu6050.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,9 +10,9 @@ import ( "fmt" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/tinkerboard" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/tinkerboard" ) // Wiring diff --git a/examples/tinkerboard_pca9533.go b/examples/tinkerboard_pca9533.go index bf7564d5..2b136096 100644 --- a/examples/tinkerboard_pca9533.go +++ b/examples/tinkerboard_pca9533.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,9 +10,9 @@ import ( "fmt" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/tinkerboard" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/tinkerboard" ) // Wiring diff --git a/examples/tinkerboard_pcf8583_clock.go b/examples/tinkerboard_pcf8583_clock.go index 4fba0488..da2e93dc 100644 --- a/examples/tinkerboard_pcf8583_clock.go +++ b/examples/tinkerboard_pcf8583_clock.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -9,9 +11,9 @@ import ( "log" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/tinkerboard" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/tinkerboard" ) // Wiring diff --git a/examples/tinkerboard_pcf8583_counter.go b/examples/tinkerboard_pcf8583_counter.go index a63c0f10..63fda967 100644 --- a/examples/tinkerboard_pcf8583_counter.go +++ b/examples/tinkerboard_pcf8583_counter.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -9,9 +11,9 @@ import ( "log" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/tinkerboard" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/tinkerboard" ) // Wiring diff --git a/examples/tinkerboard_pcf8591.go b/examples/tinkerboard_pcf8591.go index 32977c6b..c25cc664 100644 --- a/examples/tinkerboard_pcf8591.go +++ b/examples/tinkerboard_pcf8591.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -9,10 +11,10 @@ import ( "log" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/aio" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/tinkerboard" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/aio" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/tinkerboard" ) func main() { diff --git a/examples/tinkerboard_yl40.go b/examples/tinkerboard_yl40.go index c947d3a1..222d9562 100644 --- a/examples/tinkerboard_yl40.go +++ b/examples/tinkerboard_yl40.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -9,9 +11,9 @@ import ( "log" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/tinkerboard" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/tinkerboard" ) func main() { diff --git a/examples/up2_lcd.go b/examples/up2_lcd.go index 79e5d0ab..94cf3b86 100644 --- a/examples/up2_lcd.go +++ b/examples/up2_lcd.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,9 +9,9 @@ package main import ( "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/upboard/up2" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/upboard/up2" ) func main() { diff --git a/examples/up2_leds.go b/examples/up2_leds.go index 2994837b..9c7ff091 100644 --- a/examples/up2_leds.go +++ b/examples/up2_leds.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -7,9 +9,9 @@ package main import ( "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/upboard/up2" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/upboard/up2" ) func main() { diff --git a/examples/wifi_firmata_analog_input.go b/examples/wifi_firmata_analog_input.go index ba8a8c78..912f5d6d 100644 --- a/examples/wifi_firmata_analog_input.go +++ b/examples/wifi_firmata_analog_input.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,9 +10,9 @@ import ( "fmt" "os" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/aio" - "gobot.io/x/gobot/platforms/firmata" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/aio" + "gobot.io/x/gobot/v2/platforms/firmata" ) func main() { diff --git a/examples/wifi_firmata_blink.go b/examples/wifi_firmata_blink.go index cf0c3e73..b996db11 100644 --- a/examples/wifi_firmata_blink.go +++ b/examples/wifi_firmata_blink.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -21,9 +23,9 @@ import ( "os" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/firmata" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/firmata" ) func main() { diff --git a/examples_test.go b/examples_test.go index 302633c6..533f882c 100644 --- a/examples_test.go +++ b/examples_test.go @@ -5,8 +5,8 @@ import ( "testing" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) func ExampleEvery() { diff --git a/go.mod b/go.mod index b1cc2d36..4204a4c9 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module gobot.io/x/gobot +module gobot.io/x/gobot/v2 go 1.17 diff --git a/master_test.go b/master_test.go index 6fc21baf..34f6f3d7 100644 --- a/master_test.go +++ b/master_test.go @@ -8,7 +8,7 @@ import ( "time" multierror "github.com/hashicorp/go-multierror" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2/gobottest" ) func initTestMaster() *Master { diff --git a/platforms/adaptors/digitalpinsadaptor.go b/platforms/adaptors/digitalpinsadaptor.go index 75d57caa..a171134e 100644 --- a/platforms/adaptors/digitalpinsadaptor.go +++ b/platforms/adaptors/digitalpinsadaptor.go @@ -6,8 +6,8 @@ import ( "time" "github.com/hashicorp/go-multierror" - "gobot.io/x/gobot" - "gobot.io/x/gobot/system" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/system" ) type digitalPinTranslator func(pin string) (chip string, line int, err error) diff --git a/platforms/adaptors/digitalpinsadaptor_test.go b/platforms/adaptors/digitalpinsadaptor_test.go index 008c6c8b..df0f5674 100644 --- a/platforms/adaptors/digitalpinsadaptor_test.go +++ b/platforms/adaptors/digitalpinsadaptor_test.go @@ -11,10 +11,10 @@ import ( "strconv" "sync" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/gobottest" - "gobot.io/x/gobot/system" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/gobottest" + "gobot.io/x/gobot/v2/system" ) // make sure that this adaptor fulfills all the required interfaces diff --git a/platforms/adaptors/i2cbusadaptor.go b/platforms/adaptors/i2cbusadaptor.go index ed2a4e09..cc104197 100644 --- a/platforms/adaptors/i2cbusadaptor.go +++ b/platforms/adaptors/i2cbusadaptor.go @@ -5,9 +5,9 @@ import ( "sync" multierror "github.com/hashicorp/go-multierror" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/system" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/system" ) type i2cBusNumberValidator func(busNumber int) error diff --git a/platforms/adaptors/i2cbusadaptor_test.go b/platforms/adaptors/i2cbusadaptor_test.go index a69c3b27..b0cab6f8 100644 --- a/platforms/adaptors/i2cbusadaptor_test.go +++ b/platforms/adaptors/i2cbusadaptor_test.go @@ -5,9 +5,9 @@ import ( "strings" "testing" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/gobottest" - "gobot.io/x/gobot/system" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/gobottest" + "gobot.io/x/gobot/v2/system" ) // make sure that this Adaptor fulfills all the required interfaces diff --git a/platforms/adaptors/pwmpinsadaptor.go b/platforms/adaptors/pwmpinsadaptor.go index c8f8bc9a..11c2969b 100644 --- a/platforms/adaptors/pwmpinsadaptor.go +++ b/platforms/adaptors/pwmpinsadaptor.go @@ -5,11 +5,11 @@ import ( "sync" multierror "github.com/hashicorp/go-multierror" - "gobot.io/x/gobot" - "gobot.io/x/gobot/system" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/system" ) -//note for period in nano seconds: +// note for period in nano seconds: // 100000000ns = 100ms = 10Hz, 10000000ns = 10ms = 100Hz, 1000000ns = 1ms = 1kHz, // 100000ns = 100us = 10kHz, 10000ns = 10us = 100kHz, 1000ns = 1us = 1MHz, // 100ns = 10MHz, 10ns = 100MHz, 1ns = 1GHz diff --git a/platforms/adaptors/pwmpinsadaptor_test.go b/platforms/adaptors/pwmpinsadaptor_test.go index 0058391d..016301d4 100644 --- a/platforms/adaptors/pwmpinsadaptor_test.go +++ b/platforms/adaptors/pwmpinsadaptor_test.go @@ -8,10 +8,10 @@ import ( "sync" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/gobottest" - "gobot.io/x/gobot/system" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/gobottest" + "gobot.io/x/gobot/v2/system" ) const ( diff --git a/platforms/adaptors/spibusadaptor.go b/platforms/adaptors/spibusadaptor.go index 943169da..12e6acf0 100644 --- a/platforms/adaptors/spibusadaptor.go +++ b/platforms/adaptors/spibusadaptor.go @@ -5,8 +5,8 @@ import ( "sync" multierror "github.com/hashicorp/go-multierror" - "gobot.io/x/gobot/drivers/spi" - "gobot.io/x/gobot/system" + "gobot.io/x/gobot/v2/drivers/spi" + "gobot.io/x/gobot/v2/system" ) type spiBusNumberValidator func(busNumber int) error diff --git a/platforms/adaptors/spibusadaptor_test.go b/platforms/adaptors/spibusadaptor_test.go index b92fd405..14c91c0b 100644 --- a/platforms/adaptors/spibusadaptor_test.go +++ b/platforms/adaptors/spibusadaptor_test.go @@ -5,9 +5,9 @@ import ( "strings" "testing" - "gobot.io/x/gobot/drivers/spi" - "gobot.io/x/gobot/gobottest" - "gobot.io/x/gobot/system" + "gobot.io/x/gobot/v2/drivers/spi" + "gobot.io/x/gobot/v2/gobottest" + "gobot.io/x/gobot/v2/system" ) // make sure that this SpiBusAdaptor fulfills all the required interfaces diff --git a/platforms/audio/audio_adaptor.go b/platforms/audio/audio_adaptor.go index 9eec6fcb..09d96f93 100644 --- a/platforms/audio/audio_adaptor.go +++ b/platforms/audio/audio_adaptor.go @@ -8,7 +8,7 @@ import ( "os/exec" "path" - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" ) // Adaptor is gobot Adaptor connection to audio playback @@ -17,7 +17,6 @@ type Adaptor struct { } // NewAdaptor returns a new audio Adaptor -// func NewAdaptor() *Adaptor { return &Adaptor{name: gobot.DefaultName("Audio")} } @@ -36,7 +35,7 @@ func (a *Adaptor) Finalize() error { return nil } // Sound plays a sound and accepts: // -// string: The filename of the audio to start playing +// string: The filename of the audio to start playing func (a *Adaptor) Sound(fileName string) []error { var errorsList []error @@ -74,7 +73,7 @@ func (a *Adaptor) Sound(fileName string) []error { // CommandName defines the playback command for a sound and accepts: // -// string: The filename of the audio that needs playback +// string: The filename of the audio that needs playback func CommandName(fileName string) (commandName string, err error) { fileType := path.Ext(fileName) if fileType == ".mp3" { @@ -90,8 +89,8 @@ var execCommand = exec.Command // RunCommand executes the playback command for a sound file and accepts: // -// string: The audio command to be use for playback -// string: The filename of the audio that needs playback +// string: The audio command to be use for playback +// string: The filename of the audio that needs playback func RunCommand(audioCommand string, filename string) error { cmd := execCommand(audioCommand, filename) err := cmd.Start() diff --git a/platforms/audio/audio_adaptor_test.go b/platforms/audio/audio_adaptor_test.go index d1af90f2..f03326b2 100644 --- a/platforms/audio/audio_adaptor_test.go +++ b/platforms/audio/audio_adaptor_test.go @@ -6,8 +6,8 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) var _ gobot.Adaptor = (*Adaptor)(nil) diff --git a/platforms/audio/audio_driver.go b/platforms/audio/audio_driver.go index 45286aa9..02518050 100644 --- a/platforms/audio/audio_driver.go +++ b/platforms/audio/audio_driver.go @@ -4,7 +4,7 @@ package audio import ( "time" - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" ) // Driver is gobot software device for audio playback @@ -21,8 +21,8 @@ type Driver struct { // NewDriver returns a new audio Driver. It accepts: // // *Adaptor: The audio adaptor to use for the driver -// string: The filename of the audio to start playing // +// string: The filename of the audio to start playing func NewDriver(a *Adaptor, filename string) *Driver { return &Driver{ name: gobot.DefaultName("Audio"), @@ -51,7 +51,7 @@ func (d *Driver) Connection() gobot.Connection { // Sound plays back a sound file. It accepts: // -// string: The filename of the audio to start playing +// string: The filename of the audio to start playing func (d *Driver) Sound(fileName string) []error { return d.Connection().(*Adaptor).Sound(fileName) } diff --git a/platforms/audio/audio_driver_test.go b/platforms/audio/audio_driver_test.go index d7e7a0c7..c9cba850 100644 --- a/platforms/audio/audio_driver_test.go +++ b/platforms/audio/audio_driver_test.go @@ -7,8 +7,8 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) var _ gobot.Driver = (*Driver)(nil) diff --git a/platforms/audio/doc.go b/platforms/audio/doc.go index 977fba59..b213f62f 100644 --- a/platforms/audio/doc.go +++ b/platforms/audio/doc.go @@ -4,4 +4,4 @@ Package audio provides the Gobot adaptor for audio. For more information refer to the README: https://github.com/hybridgroup/gobot/blob/master/platforms/audio/README.md */ -package audio // import "gobot.io/x/gobot/platforms/audio" +package audio // import "gobot.io/x/gobot/v2/platforms/audio" diff --git a/platforms/beaglebone/README.md b/platforms/beaglebone/README.md index d5aa4c38..40dc4113 100644 --- a/platforms/beaglebone/README.md +++ b/platforms/beaglebone/README.md @@ -18,7 +18,7 @@ We recommend updating to the latest Debian OS when using the BeagleBone. The cur 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 BeagleBone, and run the program on the BeagleBone itself as documented here. ``` -go get -d -u gobot.io/x/gobot/... +go get -d -u gobot.io/x/gobot/v2/... ``` ## How to Use @@ -33,9 +33,9 @@ package main import ( "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/beaglebone" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/beaglebone" ) func main() { @@ -66,9 +66,9 @@ package main import ( "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/beaglebone" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/beaglebone" ) func main() { diff --git a/platforms/beaglebone/beaglebone_adaptor.go b/platforms/beaglebone/beaglebone_adaptor.go index a0b6fb69..c208f9fa 100644 --- a/platforms/beaglebone/beaglebone_adaptor.go +++ b/platforms/beaglebone/beaglebone_adaptor.go @@ -8,9 +8,9 @@ import ( "sync" multierror "github.com/hashicorp/go-multierror" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/adaptors" - "gobot.io/x/gobot/system" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/adaptors" + "gobot.io/x/gobot/v2/system" ) type pwmPinData struct { diff --git a/platforms/beaglebone/beaglebone_adaptor_test.go b/platforms/beaglebone/beaglebone_adaptor_test.go index a15ebffa..008f896d 100644 --- a/platforms/beaglebone/beaglebone_adaptor_test.go +++ b/platforms/beaglebone/beaglebone_adaptor_test.go @@ -6,13 +6,13 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/aio" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/drivers/spi" - "gobot.io/x/gobot/gobottest" - "gobot.io/x/gobot/system" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/aio" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/drivers/spi" + "gobot.io/x/gobot/v2/gobottest" + "gobot.io/x/gobot/v2/system" ) // make sure that this Adaptor fulfills all the required interfaces diff --git a/platforms/beaglebone/doc.go b/platforms/beaglebone/doc.go index f94786b9..0215f2a1 100644 --- a/platforms/beaglebone/doc.go +++ b/platforms/beaglebone/doc.go @@ -4,7 +4,7 @@ separate Adaptor for the PocketBeagle. Installing: - go get gobot.io/x/gobot/platforms/beaglebone + go get gobot.io/x/gobot/v2/platforms/beaglebone Example: @@ -13,9 +13,9 @@ Example: import ( "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/beaglebone" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/beaglebone" ) func main() { @@ -40,4 +40,4 @@ Example: For more information refer to the beaglebone README: https://github.com/hybridgroup/gobot/blob/master/platforms/beaglebone/README.md */ -package beaglebone // import "gobot.io/x/gobot/platforms/beaglebone" +package beaglebone // import "gobot.io/x/gobot/v2/platforms/beaglebone" diff --git a/platforms/beaglebone/pocketbeagle_adaptor.go b/platforms/beaglebone/pocketbeagle_adaptor.go index 7ccf1f0b..68c6db49 100644 --- a/platforms/beaglebone/pocketbeagle_adaptor.go +++ b/platforms/beaglebone/pocketbeagle_adaptor.go @@ -1,14 +1,14 @@ package beaglebone import ( - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/adaptors" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/adaptors" ) // PocketBeagleAdaptor is the Gobot Adaptor for the PocketBeagle // For more information check out: -// http://beagleboard.org/pocket // +// http://beagleboard.org/pocket type PocketBeagleAdaptor struct { *Adaptor } diff --git a/platforms/ble/README.md b/platforms/ble/README.md index c6e600b6..342741f5 100644 --- a/platforms/ble/README.md +++ b/platforms/ble/README.md @@ -14,7 +14,7 @@ This package also includes drivers for several well-known BLE Services: ## How to Install ``` -go get -d -u gobot.io/x/gobot/... +go get -d -u gobot.io/x/gobot/v2/... ``` ### macOS @@ -60,8 +60,8 @@ import ( "os" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/ble" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/ble" ) func main() { diff --git a/platforms/ble/battery_driver.go b/platforms/ble/battery_driver.go index c9240142..0366a63d 100644 --- a/platforms/ble/battery_driver.go +++ b/platforms/ble/battery_driver.go @@ -4,7 +4,7 @@ import ( "bytes" "log" - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" ) // BatteryDriver represents the Battery Service for a BLE Peripheral diff --git a/platforms/ble/battery_driver_test.go b/platforms/ble/battery_driver_test.go index 03796ddb..8ba4e42d 100644 --- a/platforms/ble/battery_driver_test.go +++ b/platforms/ble/battery_driver_test.go @@ -4,8 +4,8 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) var _ gobot.Driver = (*BatteryDriver)(nil) diff --git a/platforms/ble/ble_client_adaptor.go b/platforms/ble/ble_client_adaptor.go index b18b01d5..7f61414a 100644 --- a/platforms/ble/ble_client_adaptor.go +++ b/platforms/ble/ble_client_adaptor.go @@ -7,7 +7,7 @@ import ( "time" "github.com/pkg/errors" - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" "tinygo.org/x/bluetooth" ) diff --git a/platforms/ble/ble_client_adaptor_test.go b/platforms/ble/ble_client_adaptor_test.go index 54730fc6..e3b0e7a5 100644 --- a/platforms/ble/ble_client_adaptor_test.go +++ b/platforms/ble/ble_client_adaptor_test.go @@ -4,8 +4,8 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) var _ gobot.Adaptor = (*ClientAdaptor)(nil) diff --git a/platforms/ble/device_information_driver.go b/platforms/ble/device_information_driver.go index c836c43e..0629a21d 100644 --- a/platforms/ble/device_information_driver.go +++ b/platforms/ble/device_information_driver.go @@ -4,7 +4,7 @@ import ( "bytes" "log" - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" ) // DeviceInformationDriver represents the Device Information Service for a BLE Peripheral diff --git a/platforms/ble/device_information_driver_test.go b/platforms/ble/device_information_driver_test.go index c36cbb05..81d6f333 100644 --- a/platforms/ble/device_information_driver_test.go +++ b/platforms/ble/device_information_driver_test.go @@ -4,8 +4,8 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) var _ gobot.Driver = (*DeviceInformationDriver)(nil) diff --git a/platforms/ble/doc.go b/platforms/ble/doc.go index 076457ce..39b9e825 100644 --- a/platforms/ble/doc.go +++ b/platforms/ble/doc.go @@ -10,4 +10,4 @@ It also includes drivers for several well-known BLE Services: For more information refer to the README: https://github.com/hybridgroup/gobot/blob/master/platforms/ble/README.md */ -package ble // import "gobot.io/x/gobot/platforms/ble" +package ble // import "gobot.io/x/gobot/v2/platforms/ble" diff --git a/platforms/ble/generic_access_driver.go b/platforms/ble/generic_access_driver.go index 0a12fb8c..431f20df 100644 --- a/platforms/ble/generic_access_driver.go +++ b/platforms/ble/generic_access_driver.go @@ -5,7 +5,7 @@ import ( "encoding/binary" "log" - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" ) // GenericAccessDriver represents the Generic Access Service for a BLE Peripheral diff --git a/platforms/ble/generic_access_driver_test.go b/platforms/ble/generic_access_driver_test.go index b3014498..18dcbf09 100644 --- a/platforms/ble/generic_access_driver_test.go +++ b/platforms/ble/generic_access_driver_test.go @@ -4,8 +4,8 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) var _ gobot.Driver = (*GenericAccessDriver)(nil) diff --git a/platforms/ble/serial_port_test.go b/platforms/ble/serial_port_test.go index 5b879fcd..fe2bebb6 100644 --- a/platforms/ble/serial_port_test.go +++ b/platforms/ble/serial_port_test.go @@ -3,7 +3,7 @@ package ble import ( "testing" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2/gobottest" ) func initTestBLESerialPort() *SerialPort { diff --git a/platforms/chip/README.md b/platforms/chip/README.md index cc20529d..eb30914e 100644 --- a/platforms/chip/README.md +++ b/platforms/chip/README.md @@ -14,7 +14,7 @@ We recommend updating to the latest Debian OS when using the C.H.I.P., however G 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 C.H.I.P and run the program on the C.H.I.P. itself as documented here. ``` -go get -d -u gobot.io/x/gobot/... +go get -d -u gobot.io/x/gobot/v2/... ``` ### PWM support @@ -45,9 +45,9 @@ package main import ( "fmt" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/chip" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/chip" ) func main() { diff --git a/platforms/chip/chip_adaptor.go b/platforms/chip/chip_adaptor.go index 291952cd..fc6acfc8 100644 --- a/platforms/chip/chip_adaptor.go +++ b/platforms/chip/chip_adaptor.go @@ -9,9 +9,9 @@ import ( "sync" multierror "github.com/hashicorp/go-multierror" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/adaptors" - "gobot.io/x/gobot/system" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/adaptors" + "gobot.io/x/gobot/v2/system" ) const defaultI2cBusNumber = 1 @@ -38,8 +38,9 @@ type Adaptor struct { // NewAdaptor creates a C.H.I.P. 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#.# +// +// adaptors.WithGpiodAccess(): use character device gpiod driver instead of sysfs +// adaptors.WithSpiGpioAccess(sclk, nss, mosi, miso): use GPIO's instead of /dev/spidev#.# func NewAdaptor(opts ...func(adaptors.Optioner)) *Adaptor { sys := system.NewAccesser() c := &Adaptor{ diff --git a/platforms/chip/chip_adaptor_test.go b/platforms/chip/chip_adaptor_test.go index ce5e8e7f..e49b9b2c 100644 --- a/platforms/chip/chip_adaptor_test.go +++ b/platforms/chip/chip_adaptor_test.go @@ -6,11 +6,11 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/gobottest" - "gobot.io/x/gobot/system" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/gobottest" + "gobot.io/x/gobot/v2/system" ) // make sure that this Adaptor fulfills all the required interfaces diff --git a/platforms/chip/doc.go b/platforms/chip/doc.go index e3fe9963..49579424 100644 --- a/platforms/chip/doc.go +++ b/platforms/chip/doc.go @@ -4,4 +4,4 @@ Package chip contains the Gobot adaptor for the CHIP and CHIP Pro For further information refer to the chip README: https://github.com/hybridgroup/gobot/blob/master/platforms/chip/README.md */ -package chip // import "gobot.io/x/gobot/platforms/chip" +package chip // import "gobot.io/x/gobot/v2/platforms/chip" diff --git a/platforms/dexter/dexter.go b/platforms/dexter/dexter.go index 9a0c8fc3..18e2ba6c 100644 --- a/platforms/dexter/dexter.go +++ b/platforms/dexter/dexter.go @@ -5,6 +5,6 @@ This package currently supports the following robots: - GoPiGo3 For further information refer to Dexter README: -https://gobot.io/x/gobot/blob/master/platforms/dexter/README.md +https://gobot.io/x/gobot/v2/blob/master/platforms/dexter/README.md */ package dexter diff --git a/platforms/dexter/gopigo3/README.md b/platforms/dexter/gopigo3/README.md index dfa55f24..c5b475c1 100644 --- a/platforms/dexter/gopigo3/README.md +++ b/platforms/dexter/gopigo3/README.md @@ -5,7 +5,7 @@ The GoPiGo3 is a robotics controller by Dexter Industries that is compatible wit ## How to Install ``` -go get -d -u gobot.io/x/gobot/... +go get -d -u gobot.io/x/gobot/v2/... ``` ## How to Use @@ -18,9 +18,9 @@ import ( "fmt" "time" - "gobot.io/x/gobot" - g "gobot.io/x/gobot/platforms/dexter/gopigo3" - "gobot.io/x/gobot/platforms/raspi" + "gobot.io/x/gobot/v2" + g "gobot.io/x/gobot/v2/platforms/dexter/gopigo3" + "gobot.io/x/gobot/v2/platforms/raspi" ) func main() { diff --git a/platforms/dexter/gopigo3/driver.go b/platforms/dexter/gopigo3/driver.go index ca97191b..4574372f 100644 --- a/platforms/dexter/gopigo3/driver.go +++ b/platforms/dexter/gopigo3/driver.go @@ -11,8 +11,8 @@ import ( "math" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/spi" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/spi" ) // spi address for gopigo3 @@ -166,15 +166,16 @@ type Driver struct { // NewDriver creates a new Gobot Driver for the GoPiGo3 board. // // Params: -// a *Adaptor - the Adaptor to use with this Driver +// +// a *Adaptor - the Adaptor to use with this Driver // // Optional params: -// spi.WithBusNumber(int): bus to use with this driver -// spi.WithChipNumber(int): chip to use with this driver -// spi.WithMode(int): mode to use with this driver -// spi.WithBitCount(int): number of bits to use with this driver -// spi.WithSpeed(int64): speed in Hz to use with this driver // +// spi.WithBusNumber(int): bus to use with this driver +// spi.WithChipNumber(int): chip to use with this driver +// spi.WithMode(int): mode to use with this driver +// spi.WithBitCount(int): number of bits to use with this driver +// spi.WithSpeed(int64): speed in Hz to use with this driver func NewDriver(a spi.Connector, options ...func(spi.Config)) *Driver { spiConfig := spi.NewConfig() // use /dev/spidev0.1 diff --git a/platforms/dexter/gopigo3/driver_test.go b/platforms/dexter/gopigo3/driver_test.go index a06d7393..ee55d7d9 100644 --- a/platforms/dexter/gopigo3/driver_test.go +++ b/platforms/dexter/gopigo3/driver_test.go @@ -4,9 +4,9 @@ import ( "encoding/hex" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/spi" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/spi" + "gobot.io/x/gobot/v2/gobottest" ) var _ gobot.Driver = (*Driver)(nil) diff --git a/platforms/digispark/README.md b/platforms/digispark/README.md index acff570f..4803aac2 100644 --- a/platforms/digispark/README.md +++ b/platforms/digispark/README.md @@ -27,7 +27,7 @@ $ sudo apt-get install libusb-dev Now you can install the package with ``` -go get -d -u gobot.io/x/gobot/... +go get -d -u gobot.io/x/gobot/v2/... ``` ## How to Use @@ -38,9 +38,9 @@ package main import ( "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/digispark" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/digispark" ) func main() { diff --git a/platforms/digispark/digispark_adaptor.go b/platforms/digispark/digispark_adaptor.go index 31fb23dc..d72e8817 100644 --- a/platforms/digispark/digispark_adaptor.go +++ b/platforms/digispark/digispark_adaptor.go @@ -5,8 +5,8 @@ import ( "fmt" "strconv" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/i2c" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/i2c" ) // ErrConnection is the error resulting of a connection error with the digispark diff --git a/platforms/digispark/digispark_adaptor_test.go b/platforms/digispark/digispark_adaptor_test.go index 1c7222f5..a4bea231 100644 --- a/platforms/digispark/digispark_adaptor_test.go +++ b/platforms/digispark/digispark_adaptor_test.go @@ -5,9 +5,9 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/gobottest" ) var _ gobot.Adaptor = (*Adaptor)(nil) diff --git a/platforms/digispark/digispark_i2c_test.go b/platforms/digispark/digispark_i2c_test.go index dbaba0e9..48493140 100644 --- a/platforms/digispark/digispark_i2c_test.go +++ b/platforms/digispark/digispark_i2c_test.go @@ -5,8 +5,8 @@ import ( "fmt" "testing" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/gobottest" ) const availableI2cAddress = 0x40 diff --git a/platforms/digispark/doc.go b/platforms/digispark/doc.go index 25a9aaa5..ec04f7c9 100644 --- a/platforms/digispark/doc.go +++ b/platforms/digispark/doc.go @@ -6,7 +6,7 @@ Installing: This package requires installing `libusb`. Then you can install the package with: - go get -u -d gobot.io/x/gobot/platforms/digispark + go get -u -d gobot.io/x/gobot/v2/platforms/digispark Example: @@ -15,9 +15,9 @@ Example: import ( "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/digispark" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/digispark" ) func main() { @@ -42,4 +42,4 @@ Example: For further information refer to digispark README: https://github.com/hybridgroup/gobot/blob/master/platforms/digispark/README.md */ -package digispark // import "gobot.io/x/gobot/platforms/digispark" +package digispark // import "gobot.io/x/gobot/v2/platforms/digispark" diff --git a/platforms/dji/dji.go b/platforms/dji/dji.go index 491dc81c..4a4f3659 100644 --- a/platforms/dji/dji.go +++ b/platforms/dji/dji.go @@ -1,5 +1,4 @@ // Package dji contains the Gobot drivers for DJI drones. // Currently only has support for the DJI Tello. // For more information, go to: -// -package dji // import "gobot.io/x/gobot/platforms/dji" +package dji // import "gobot.io/x/gobot/v2/platforms/dji" diff --git a/platforms/dji/tello/README.md b/platforms/dji/tello/README.md index 42033f3e..7407ab59 100644 --- a/platforms/dji/tello/README.md +++ b/platforms/dji/tello/README.md @@ -7,7 +7,7 @@ For more information on this drone, go to: [https://www.ryzerobotics.com/tello]( ## How to Install ``` -go get -d -u gobot.io/x/gobot/... +go get -d -u gobot.io/x/gobot/v2/... ``` ## How to Use @@ -25,8 +25,8 @@ import ( "fmt" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/dji/tello" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/dji/tello" ) func main() { diff --git a/platforms/dji/tello/driver.go b/platforms/dji/tello/driver.go index 041d688a..5578e6d3 100644 --- a/platforms/dji/tello/driver.go +++ b/platforms/dji/tello/driver.go @@ -13,7 +13,7 @@ import ( "sync/atomic" "time" - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" ) const ( diff --git a/platforms/dji/tello/driver_test.go b/platforms/dji/tello/driver_test.go index d7ae751a..d7ff5346 100644 --- a/platforms/dji/tello/driver_test.go +++ b/platforms/dji/tello/driver_test.go @@ -9,8 +9,8 @@ import ( "testing" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) var _ gobot.Driver = (*Driver)(nil) diff --git a/platforms/dji/tello/pitch_test.go b/platforms/dji/tello/pitch_test.go index a5495dec..5fc1de02 100644 --- a/platforms/dji/tello/pitch_test.go +++ b/platforms/dji/tello/pitch_test.go @@ -3,7 +3,7 @@ package tello import ( "testing" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2/gobottest" ) func TestMinidroneValidatePitchWhenEqualOffset(t *testing.T) { diff --git a/platforms/dragonboard/README.md b/platforms/dragonboard/README.md index bbf5f5da..530a616f 100644 --- a/platforms/dragonboard/README.md +++ b/platforms/dragonboard/README.md @@ -9,7 +9,7 @@ Make sure you are using the latest Linaro Debian image. Both AArch32 and AArch64 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 DragonBoard and run the program on the DragonBoard itself as documented here. ``` -go get -d -u gobot.io/x/gobot/... +go get -d -u gobot.io/x/gobot/v2/... ``` ## How to Use @@ -22,9 +22,9 @@ package main import ( "fmt" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/dragonboard" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/dragonboard" ) func main() { diff --git a/platforms/dragonboard/doc.go b/platforms/dragonboard/doc.go index d1bad232..beee8962 100644 --- a/platforms/dragonboard/doc.go +++ b/platforms/dragonboard/doc.go @@ -4,4 +4,4 @@ Package dragonboard contains the Gobot adaptor for the DragonBoard 410c For further information refer to the chip README: https://github.com/hybridgroup/gobot/blob/master/platforms/dragonboard/README.md */ -package dragonboard // import "gobot.io/x/gobot/platforms/dragonboard" +package dragonboard // import "gobot.io/x/gobot/v2/platforms/dragonboard" diff --git a/platforms/dragonboard/dragonboard_adaptor.go b/platforms/dragonboard/dragonboard_adaptor.go index 40131d2d..cd79f511 100644 --- a/platforms/dragonboard/dragonboard_adaptor.go +++ b/platforms/dragonboard/dragonboard_adaptor.go @@ -5,9 +5,9 @@ import ( "sync" multierror "github.com/hashicorp/go-multierror" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/adaptors" - "gobot.io/x/gobot/system" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/adaptors" + "gobot.io/x/gobot/v2/system" ) const defaultI2cBusNumber = 0 @@ -46,8 +46,9 @@ var fixedPins = map[string]int{ // NewAdaptor creates a DragonBoard 410c 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#.# +// +// adaptors.WithGpiodAccess(): use character device gpiod driver instead of sysfs +// adaptors.WithSpiGpioAccess(sclk, nss, mosi, miso): use GPIO's instead of /dev/spidev#.# func NewAdaptor(opts ...func(adaptors.Optioner)) *Adaptor { sys := system.NewAccesser() c := &Adaptor{ diff --git a/platforms/dragonboard/dragonboard_adaptor_test.go b/platforms/dragonboard/dragonboard_adaptor_test.go index 33298b77..501f3f0f 100644 --- a/platforms/dragonboard/dragonboard_adaptor_test.go +++ b/platforms/dragonboard/dragonboard_adaptor_test.go @@ -6,10 +6,10 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/gobottest" ) // make sure that this Adaptor fulfills all the required interfaces diff --git a/platforms/firmata/README.md b/platforms/firmata/README.md index afc920a2..c00b3fd0 100644 --- a/platforms/firmata/README.md +++ b/platforms/firmata/README.md @@ -11,7 +11,7 @@ For more info about the Arduino platform, go to [http://arduino.cc/](http://ardu ## How to Install ``` -go get -d -u gobot.io/x/gobot/... +go get -d -u gobot.io/x/gobot/v2/... ``` You must install Firmata on your microcontroller before you can connect to it using Gobot. You can do this in many cases using Gort ([http://gort.io](http://gort.io)). @@ -28,9 +28,9 @@ package main import ( "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/firmata" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/firmata" ) func main() { @@ -61,9 +61,9 @@ package main import ( "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/firmata" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/firmata" ) func main() { diff --git a/platforms/firmata/ble_firmata_adaptor.go b/platforms/firmata/ble_firmata_adaptor.go index e892e173..fc90ea22 100644 --- a/platforms/firmata/ble_firmata_adaptor.go +++ b/platforms/firmata/ble_firmata_adaptor.go @@ -1,3 +1,4 @@ +//go:build !windows // +build !windows package firmata @@ -5,8 +6,8 @@ package firmata import ( "io" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/ble" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/ble" ) const ( diff --git a/platforms/firmata/ble_firmata_adaptor_test.go b/platforms/firmata/ble_firmata_adaptor_test.go index 2f8a8dbb..6c5af4fc 100644 --- a/platforms/firmata/ble_firmata_adaptor_test.go +++ b/platforms/firmata/ble_firmata_adaptor_test.go @@ -1,3 +1,4 @@ +//go:build !windows // +build !windows package firmata @@ -6,8 +7,8 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) var _ gobot.Adaptor = (*BLEAdaptor)(nil) diff --git a/platforms/firmata/client/client.go b/platforms/firmata/client/client.go index 94296b5d..0dea4217 100644 --- a/platforms/firmata/client/client.go +++ b/platforms/firmata/client/client.go @@ -1,6 +1,6 @@ // Package client provies a client for interacting with microcontrollers // using the Firmata protocol https://github.com/firmata/protocol. -package client // import "gobot.io/x/gobot/platforms/firmata/client" +package client // import "gobot.io/x/gobot/v2/platforms/firmata/client" import ( "errors" @@ -11,7 +11,7 @@ import ( "sync/atomic" "time" - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" ) // Pin Modes diff --git a/platforms/firmata/client/client_test.go b/platforms/firmata/client/client_test.go index 6b8ef028..fb5b2b32 100644 --- a/platforms/firmata/client/client_test.go +++ b/platforms/firmata/client/client_test.go @@ -7,7 +7,7 @@ import ( "testing" "time" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2/gobottest" ) const semPublishWait = 10 * time.Millisecond diff --git a/platforms/firmata/client/examples/blink.go b/platforms/firmata/client/examples/blink.go index f8b0d1d4..eebee49a 100644 --- a/platforms/firmata/client/examples/blink.go +++ b/platforms/firmata/client/examples/blink.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -9,7 +11,7 @@ import ( "time" "go.bug.st/serial" - "gobot.io/x/gobot/platforms/firmata/client" + "gobot.io/x/gobot/v2/platforms/firmata/client" ) func main() { diff --git a/platforms/firmata/doc.go b/platforms/firmata/doc.go index 3336965e..2677c01e 100644 --- a/platforms/firmata/doc.go +++ b/platforms/firmata/doc.go @@ -3,7 +3,7 @@ Package firmata provides the Gobot adaptor for microcontrollers that support the Installing: - go get -d -u gobot.io/x/gobot/... && go get gobot.io/x/gobot/platforms/firmata + go get -d -u gobot.io/x/gobot/v2/... && go get gobot.io/x/gobot/v2/platforms/firmata Example: @@ -12,9 +12,9 @@ Example: import ( "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/firmata" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/firmata" ) func main() { @@ -39,4 +39,4 @@ Example: For further information refer to firmata readme: https://github.com/hybridgroup/gobot/blob/master/platforms/firmata/README.md */ -package firmata // import "gobot.io/x/gobot/platforms/firmata" +package firmata // import "gobot.io/x/gobot/v2/platforms/firmata" diff --git a/platforms/firmata/firmata_adaptor.go b/platforms/firmata/firmata_adaptor.go index 5a074c12..679c965b 100644 --- a/platforms/firmata/firmata_adaptor.go +++ b/platforms/firmata/firmata_adaptor.go @@ -7,9 +7,9 @@ import ( "time" "go.bug.st/serial" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/platforms/firmata/client" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/platforms/firmata/client" ) type firmataBoard interface { diff --git a/platforms/firmata/firmata_adaptor_test.go b/platforms/firmata/firmata_adaptor_test.go index b8b4ee54..190c1138 100644 --- a/platforms/firmata/firmata_adaptor_test.go +++ b/platforms/firmata/firmata_adaptor_test.go @@ -8,11 +8,11 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/aio" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/gobottest" - "gobot.io/x/gobot/platforms/firmata/client" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/aio" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/gobottest" + "gobot.io/x/gobot/v2/platforms/firmata/client" ) // make sure that this Adaptor fulfills all required analog and digital interfaces diff --git a/platforms/firmata/firmata_i2c.go b/platforms/firmata/firmata_i2c.go index e085efd3..fc74e48c 100644 --- a/platforms/firmata/firmata_i2c.go +++ b/platforms/firmata/firmata_i2c.go @@ -4,7 +4,7 @@ import ( "fmt" "sync" - "gobot.io/x/gobot/platforms/firmata/client" + "gobot.io/x/gobot/v2/platforms/firmata/client" ) // firmataI2cConnection implements the interface gobot.I2cOperations @@ -56,8 +56,9 @@ func (c *firmataI2cConnection) ReadByte() (byte, error) { // ReadByteData reads one byte of the given register address from the i2c device. // TODO: implement the specification, because some devices will not work with this -// current: "S Addr Wr [A] Comm [A] P S Addr Rd [A] [Data] NA P" -// required: "S Addr Wr [A] Comm [A] S Addr Rd [A] [Data] NA P" +// +// current: "S Addr Wr [A] Comm [A] P S Addr Rd [A] [Data] NA P" +// required: "S Addr Wr [A] Comm [A] S Addr Rd [A] [Data] NA P" func (c *firmataI2cConnection) ReadByteData(reg uint8) (uint8, error) { c.mtx.Lock() defer c.mtx.Unlock() @@ -75,8 +76,9 @@ func (c *firmataI2cConnection) ReadByteData(reg uint8) (uint8, error) { // ReadWordData reads two bytes of the given register address from the i2c device. // TODO: implement the specification, because some devices will not work with this -// current: "S Addr Wr [A] Comm [A] P S Addr Rd [A] [DataLow] A [DataHigh] NA P" -// required: "S Addr Wr [A] Comm [A] S Addr Rd [A] [DataLow] A [DataHigh] NA P" +// +// current: "S Addr Wr [A] Comm [A] P S Addr Rd [A] [DataLow] A [DataHigh] NA P" +// required: "S Addr Wr [A] Comm [A] S Addr Rd [A] [DataLow] A [DataHigh] NA P" func (c *firmataI2cConnection) ReadWordData(reg uint8) (uint16, error) { c.mtx.Lock() defer c.mtx.Unlock() @@ -95,8 +97,9 @@ func (c *firmataI2cConnection) ReadWordData(reg uint8) (uint16, error) { // ReadBlockData reads a block of maximum 32 bytes from the given register address of the i2c device. // TODO: implement the specification, because some devices will not work with this -// current: "S Addr Wr [A] Comm [A] P S Addr Rd [A] [Count] A [Data] A [Data] A ... A [Data] NA P" -// required: "S Addr Wr [A] Comm [A] S Addr Rd [A] [Count] A [Data] A [Data] A ... A [Data] NA P" +// +// current: "S Addr Wr [A] Comm [A] P S Addr Rd [A] [Count] A [Data] A [Data] A ... A [Data] NA P" +// required: "S Addr Wr [A] Comm [A] S Addr Rd [A] [Count] A [Data] A [Data] A ... A [Data] NA P" func (c *firmataI2cConnection) ReadBlockData(reg uint8, data []byte) error { c.mtx.Lock() defer c.mtx.Unlock() diff --git a/platforms/firmata/firmata_i2c_test.go b/platforms/firmata/firmata_i2c_test.go index c53ac163..131345c6 100644 --- a/platforms/firmata/firmata_i2c_test.go +++ b/platforms/firmata/firmata_i2c_test.go @@ -6,10 +6,10 @@ import ( "testing" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/gobottest" - "gobot.io/x/gobot/platforms/firmata/client" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/gobottest" + "gobot.io/x/gobot/v2/platforms/firmata/client" ) // make sure that this Adaptor fulfills all required I2C interfaces diff --git a/platforms/firmata/tcp_firmata_adaptor.go b/platforms/firmata/tcp_firmata_adaptor.go index 7dc7f53b..c389a694 100644 --- a/platforms/firmata/tcp_firmata_adaptor.go +++ b/platforms/firmata/tcp_firmata_adaptor.go @@ -4,7 +4,7 @@ import ( "io" "net" - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" ) // TCPAdaptor represents a TCP based connection to a microcontroller running diff --git a/platforms/firmata/tcp_firmata_adaptor_test.go b/platforms/firmata/tcp_firmata_adaptor_test.go index 27a7a4a1..74b26b8d 100644 --- a/platforms/firmata/tcp_firmata_adaptor_test.go +++ b/platforms/firmata/tcp_firmata_adaptor_test.go @@ -4,8 +4,8 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) var _ gobot.Adaptor = (*TCPAdaptor)(nil) diff --git a/platforms/holystone/holystone.go b/platforms/holystone/holystone.go index 030fe3fa..6a9ea73b 100644 --- a/platforms/holystone/holystone.go +++ b/platforms/holystone/holystone.go @@ -2,5 +2,4 @@ // Currently only have support for the HS200 drone. // For more information, go to: // http://www.holystone.com/product/Holy_Stone_HS200W_FPV_Drone_with_720P_HD_Live_Video_Wifi_Camera_2_4GHz_4CH_6_Axis_Gyro_RC_Quadcopter_with_Altitude_Hold,_Gravity_Sensor_and_Headless_Mode_Function_RTF,_Color_Red-39.html -// -package holystone // import "gobot.io/x/gobot/platforms/holystone" +package holystone // import "gobot.io/x/gobot/v2/platforms/holystone" diff --git a/platforms/holystone/hs200/README.md b/platforms/holystone/hs200/README.md index 698f22a6..f6067ea1 100644 --- a/platforms/holystone/hs200/README.md +++ b/platforms/holystone/hs200/README.md @@ -8,7 +8,7 @@ http://www.holystone.com/product/Holy_Stone_HS200W_FPV_Drone_with_720P_HD_Live_V ## How to Install ``` -go get -d -u gobot.io/x/gobot/... +go get -d -u gobot.io/x/gobot/v2/... ``` ## How to Use @@ -24,8 +24,8 @@ package main import ( "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/holystone/hs200" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/holystone/hs200" ) func main() { diff --git a/platforms/holystone/hs200/doc.go b/platforms/holystone/hs200/doc.go index 4ab7b5ba..4a06a8a1 100644 --- a/platforms/holystone/hs200/doc.go +++ b/platforms/holystone/hs200/doc.go @@ -1,2 +1,2 @@ // Package hs200 is the Gobot driver for the Holystone HS200 drone. -package hs200 // import "gobot.io/x/gobot/platforms/holystone/hs200" +package hs200 // import "gobot.io/x/gobot/v2/platforms/holystone/hs200" diff --git a/platforms/holystone/hs200/hs200_driver.go b/platforms/holystone/hs200/hs200_driver.go index a9527196..62fa1e74 100644 --- a/platforms/holystone/hs200/hs200_driver.go +++ b/platforms/holystone/hs200/hs200_driver.go @@ -5,7 +5,7 @@ import ( "sync" "time" - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" ) // Driver represents the control information for the hs200 drone diff --git a/platforms/holystone/hs200/hs200_driver_test.go b/platforms/holystone/hs200/hs200_driver_test.go index d86c6ea2..c63aedc8 100644 --- a/platforms/holystone/hs200/hs200_driver_test.go +++ b/platforms/holystone/hs200/hs200_driver_test.go @@ -3,8 +3,8 @@ package hs200 import ( "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) var _ gobot.Driver = (*Driver)(nil) diff --git a/platforms/intel-iot/curie/README.md b/platforms/intel-iot/curie/README.md index b2f0529e..cc4fdc18 100644 --- a/platforms/intel-iot/curie/README.md +++ b/platforms/intel-iot/curie/README.md @@ -11,7 +11,7 @@ For more info about the Intel Curie platform go to: [https://www.intel.com/conte You would normally install Go and Gobot on your computer. When you execute the Gobot program code, it communicates with the connected microcontroller using the [Firmata protocol](https://github.com/firmata/protocol), either using a serial port, or the Bluetooth LE wireless interface. ``` -go get -d -u gobot.io/x/gobot/... +go get -d -u gobot.io/x/gobot/v2/... ``` ## How To Use @@ -23,10 +23,10 @@ import ( "log" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/firmata" - "gobot.io/x/gobot/platforms/intel-iot/curie" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/firmata" + "gobot.io/x/gobot/v2/platforms/intel-iot/curie" ) func main() { diff --git a/platforms/intel-iot/curie/doc.go b/platforms/intel-iot/curie/doc.go index d66d15ad..5e59b56d 100644 --- a/platforms/intel-iot/curie/doc.go +++ b/platforms/intel-iot/curie/doc.go @@ -4,4 +4,4 @@ Package curie contains the Gobot driver for the Intel Curie IMU. For further information refer to intel-iot README: https://github.com/hybridgroup/gobot/blob/master/platforms/intel-iot/curie/README.md */ -package curie // import "gobot.io/x/gobot/platforms/intel-iot/curie" +package curie // import "gobot.io/x/gobot/v2/platforms/intel-iot/curie" diff --git a/platforms/intel-iot/curie/imu_driver.go b/platforms/intel-iot/curie/imu_driver.go index 3b0d71fd..b9daf610 100644 --- a/platforms/intel-iot/curie/imu_driver.go +++ b/platforms/intel-iot/curie/imu_driver.go @@ -3,8 +3,8 @@ package curie import ( "errors" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/firmata" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/firmata" ) const ( diff --git a/platforms/intel-iot/curie/imu_driver_test.go b/platforms/intel-iot/curie/imu_driver_test.go index 4b20d2a5..0d76e171 100644 --- a/platforms/intel-iot/curie/imu_driver_test.go +++ b/platforms/intel-iot/curie/imu_driver_test.go @@ -7,11 +7,11 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" - "gobot.io/x/gobot/platforms/firmata" - "gobot.io/x/gobot/platforms/firmata/client" + "gobot.io/x/gobot/v2/platforms/firmata" + "gobot.io/x/gobot/v2/platforms/firmata/client" ) var _ gobot.Driver = (*IMUDriver)(nil) diff --git a/platforms/intel-iot/edison/README.md b/platforms/intel-iot/edison/README.md index 6734db32..cc7e4dcd 100644 --- a/platforms/intel-iot/edison/README.md +++ b/platforms/intel-iot/edison/README.md @@ -9,7 +9,7 @@ For more info about the Edison platform click [here](http://www.intel.com/conten 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 Edison, and run the program on the Intel Edison itself as documented here. ``` -go get -d -u gobot.io/x/gobot/... +go get -d -u gobot.io/x/gobot/v2/... ``` ### Setting up your Intel Edison @@ -53,9 +53,9 @@ package main import ( "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/intel-iot/edison" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/intel-iot/edison" ) func main() { @@ -78,7 +78,7 @@ func main() { } ``` -You can read the [full API documentation online](http://godoc.org/gobot.io/x/gobot). +You can read the [full API documentation online](http://godoc.org/gobot.io/x/gobot/v2). ## How to Connect diff --git a/platforms/intel-iot/edison/arduino_pinmap.go b/platforms/intel-iot/edison/arduino_pinmap.go index 9c837942..2baa9ce9 100644 --- a/platforms/intel-iot/edison/arduino_pinmap.go +++ b/platforms/intel-iot/edison/arduino_pinmap.go @@ -1,6 +1,6 @@ package edison -import "gobot.io/x/gobot/system" +import "gobot.io/x/gobot/v2/system" var arduinoPinMap = map[string]sysfsPin{ "0": { diff --git a/platforms/intel-iot/edison/doc.go b/platforms/intel-iot/edison/doc.go index 4963946f..3e068753 100644 --- a/platforms/intel-iot/edison/doc.go +++ b/platforms/intel-iot/edison/doc.go @@ -4,4 +4,4 @@ Package edison contains the Gobot adaptor for the Intel Edison. For further information refer to intel-iot README: https://github.com/hybridgroup/gobot/blob/master/platforms/intel-iot/edison/README.md */ -package edison // import "gobot.io/x/gobot/platforms/intel-iot/edison" +package edison // import "gobot.io/x/gobot/v2/platforms/intel-iot/edison" diff --git a/platforms/intel-iot/edison/edison_adaptor.go b/platforms/intel-iot/edison/edison_adaptor.go index 883d3e0c..0dbd92bc 100644 --- a/platforms/intel-iot/edison/edison_adaptor.go +++ b/platforms/intel-iot/edison/edison_adaptor.go @@ -7,9 +7,9 @@ import ( "sync" multierror "github.com/hashicorp/go-multierror" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/adaptors" - "gobot.io/x/gobot/system" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/adaptors" + "gobot.io/x/gobot/v2/system" ) const ( diff --git a/platforms/intel-iot/edison/edison_adaptor_test.go b/platforms/intel-iot/edison/edison_adaptor_test.go index 040425a6..6c373a19 100644 --- a/platforms/intel-iot/edison/edison_adaptor_test.go +++ b/platforms/intel-iot/edison/edison_adaptor_test.go @@ -5,12 +5,12 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/aio" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/gobottest" - "gobot.io/x/gobot/system" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/aio" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/gobottest" + "gobot.io/x/gobot/v2/system" ) // make sure that this Adaptor fulfills all the required interfaces diff --git a/platforms/intel-iot/intel-iot.go b/platforms/intel-iot/intel-iot.go index f681b6d6..9f5cedd4 100644 --- a/platforms/intel-iot/intel-iot.go +++ b/platforms/intel-iot/intel-iot.go @@ -6,6 +6,6 @@ This package currently supports the following Intel IoT hardware: - Intel Joule developer kit For further information refer to intel-iot README: -https://gobot.io/x/gobot/blob/master/platforms/intel-iot/README.md +https://gobot.io/x/gobot/v2/blob/master/platforms/intel-iot/README.md */ package inteliot diff --git a/platforms/intel-iot/joule/README.md b/platforms/intel-iot/joule/README.md index ec91706a..9204d4f1 100644 --- a/platforms/intel-iot/joule/README.md +++ b/platforms/intel-iot/joule/README.md @@ -11,7 +11,7 @@ http://www.intel.com/joule 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/... +go get -d -u gobot.io/x/gobot/v2/... ``` ### Setting up your Intel Joule @@ -31,9 +31,9 @@ package main import ( "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/intel-iot/joule" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/intel-iot/joule" ) func main() { @@ -56,7 +56,7 @@ func main() { } ``` -You can read the [full API documentation online](http://godoc.org/gobot.io/x/gobot). +You can read the [full API documentation online](http://godoc.org/gobot.io/x/gobot/v2). ## How to Connect diff --git a/platforms/intel-iot/joule/doc.go b/platforms/intel-iot/joule/doc.go index fafca0eb..c63d46a6 100644 --- a/platforms/intel-iot/joule/doc.go +++ b/platforms/intel-iot/joule/doc.go @@ -4,4 +4,4 @@ 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 // import "gobot.io/x/gobot/platforms/intel-iot/joule" +package joule // import "gobot.io/x/gobot/v2/platforms/intel-iot/joule" diff --git a/platforms/intel-iot/joule/joule_adaptor.go b/platforms/intel-iot/joule/joule_adaptor.go index 1401949c..3de70034 100644 --- a/platforms/intel-iot/joule/joule_adaptor.go +++ b/platforms/intel-iot/joule/joule_adaptor.go @@ -5,9 +5,9 @@ import ( "sync" multierror "github.com/hashicorp/go-multierror" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/adaptors" - "gobot.io/x/gobot/system" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/adaptors" + "gobot.io/x/gobot/v2/system" ) const defaultI2cBusNumber = 0 @@ -30,8 +30,9 @@ type Adaptor struct { // NewAdaptor returns a new Joule 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#.# +// +// adaptors.WithGpiodAccess(): use character device gpiod driver instead of sysfs +// adaptors.WithSpiGpioAccess(sclk, nss, mosi, miso): use GPIO's instead of /dev/spidev#.# func NewAdaptor(opts ...func(adaptors.Optioner)) *Adaptor { sys := system.NewAccesser() c := &Adaptor{ diff --git a/platforms/intel-iot/joule/joule_adaptor_test.go b/platforms/intel-iot/joule/joule_adaptor_test.go index c21e79f0..b25a8a7b 100644 --- a/platforms/intel-iot/joule/joule_adaptor_test.go +++ b/platforms/intel-iot/joule/joule_adaptor_test.go @@ -6,11 +6,11 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/gobottest" - "gobot.io/x/gobot/system" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/gobottest" + "gobot.io/x/gobot/v2/system" ) // make sure that this Adaptor fulfills all the required interfaces diff --git a/platforms/jetson/README.md b/platforms/jetson/README.md index 075223d8..928d34e7 100644 --- a/platforms/jetson/README.md +++ b/platforms/jetson/README.md @@ -13,7 +13,7 @@ We recommend updating to the latest jetson-nano OS when using the Jetson Nano, h 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 Jetson Nano, and run the program on the Jetson Nano as documented here. ``` -go get -d -u gobot.io/x/gobot/... +go get -d -u gobot.io/x/gobot/v2/... ``` ## How to Use @@ -26,9 +26,9 @@ package main import ( "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/jetson" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/jetson" ) func main() { diff --git a/platforms/jetson/doc.go b/platforms/jetson/doc.go index a3cc4d9e..9763ef99 100644 --- a/platforms/jetson/doc.go +++ b/platforms/jetson/doc.go @@ -4,4 +4,4 @@ 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 */ -package jetson // import "gobot.io/x/gobot/platforms/jetson" +package jetson // import "gobot.io/x/gobot/v2/platforms/jetson" diff --git a/platforms/jetson/jetson_adaptor.go b/platforms/jetson/jetson_adaptor.go index ce8db51e..c0e25b4c 100644 --- a/platforms/jetson/jetson_adaptor.go +++ b/platforms/jetson/jetson_adaptor.go @@ -6,9 +6,9 @@ import ( "sync" multierror "github.com/hashicorp/go-multierror" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/adaptors" - "gobot.io/x/gobot/system" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/adaptors" + "gobot.io/x/gobot/v2/system" ) const ( @@ -37,8 +37,9 @@ type Adaptor struct { // 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#.# +// +// adaptors.WithGpiodAccess(): use character device gpiod driver instead of sysfs +// adaptors.WithSpiGpioAccess(sclk, nss, mosi, miso): use GPIO's instead of /dev/spidev#.# func NewAdaptor(opts ...func(adaptors.Optioner)) *Adaptor { sys := system.NewAccesser() c := &Adaptor{ @@ -111,7 +112,7 @@ func (c *Adaptor) Finalize() error { return err } -//PWMPin returns a Jetson Nano. PWMPin which provides the gobot.PWMPinner interface +// PWMPin returns a Jetson Nano. PWMPin which provides the gobot.PWMPinner interface func (c *Adaptor) PWMPin(pin string) (gobot.PWMPinner, error) { c.mutex.Lock() defer c.mutex.Unlock() diff --git a/platforms/jetson/jetson_adaptor_test.go b/platforms/jetson/jetson_adaptor_test.go index e1ad3fb2..99408352 100644 --- a/platforms/jetson/jetson_adaptor_test.go +++ b/platforms/jetson/jetson_adaptor_test.go @@ -10,12 +10,12 @@ import ( "strconv" "sync" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/drivers/spi" - "gobot.io/x/gobot/gobottest" - "gobot.io/x/gobot/system" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/drivers/spi" + "gobot.io/x/gobot/v2/gobottest" + "gobot.io/x/gobot/v2/system" ) // make sure that this Adaptor fulfills all the required interfaces diff --git a/platforms/jetson/pwm_pin.go b/platforms/jetson/pwm_pin.go index 1507949f..9a9fcf31 100644 --- a/platforms/jetson/pwm_pin.go +++ b/platforms/jetson/pwm_pin.go @@ -6,8 +6,8 @@ import ( "os" "path" - "gobot.io/x/gobot" - "gobot.io/x/gobot/system" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/system" ) const ( diff --git a/platforms/jetson/pwm_pin_test.go b/platforms/jetson/pwm_pin_test.go index 3e832a63..a67e58e5 100644 --- a/platforms/jetson/pwm_pin_test.go +++ b/platforms/jetson/pwm_pin_test.go @@ -4,9 +4,9 @@ import ( "errors" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" - "gobot.io/x/gobot/system" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" + "gobot.io/x/gobot/v2/system" ) var _ gobot.PWMPinner = (*PWMPin)(nil) diff --git a/platforms/joystick/README.md b/platforms/joystick/README.md index de3e1a05..360cde7d 100644 --- a/platforms/joystick/README.md +++ b/platforms/joystick/README.md @@ -41,7 +41,7 @@ cd SDL2-2.0.8/ Now you can install the package with ``` -go get -d -u gobot.io/x/gobot/... +go get -d -u gobot.io/x/gobot/v2/... ``` ## How to Use @@ -65,8 +65,8 @@ package main import ( "fmt" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/joystick" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/joystick" ) func main() { diff --git a/platforms/joystick/doc.go b/platforms/joystick/doc.go index 9626f455..a42bac57 100644 --- a/platforms/joystick/doc.go +++ b/platforms/joystick/doc.go @@ -6,7 +6,7 @@ Installing: This package requires `sdl2` to be installed on your system Then install package with: - go get gobot.io/x/gobot/platforms/joystick + go get gobot.io/x/gobot/v2/platforms/joystick Example: @@ -15,8 +15,8 @@ Example: import ( "fmt" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/joystick" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/joystick" ) func main() { @@ -64,4 +64,4 @@ Example: For further information refer to joystick README: https://github.com/hybridgroup/gobot/blob/master/platforms/joystick/README.md */ -package joystick // import "gobot.io/x/gobot/platforms/joystick" +package joystick // import "gobot.io/x/gobot/v2/platforms/joystick" diff --git a/platforms/joystick/joystick_adaptor.go b/platforms/joystick/joystick_adaptor.go index e3a93da8..b5cdd5be 100644 --- a/platforms/joystick/joystick_adaptor.go +++ b/platforms/joystick/joystick_adaptor.go @@ -3,7 +3,7 @@ package joystick import ( "errors" - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" "github.com/veandco/go-sdl2/sdl" ) diff --git a/platforms/joystick/joystick_adaptor_test.go b/platforms/joystick/joystick_adaptor_test.go index aa98229c..80bf5a0f 100644 --- a/platforms/joystick/joystick_adaptor_test.go +++ b/platforms/joystick/joystick_adaptor_test.go @@ -5,8 +5,8 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) var _ gobot.Adaptor = (*Adaptor)(nil) diff --git a/platforms/joystick/joystick_driver.go b/platforms/joystick/joystick_driver.go index ee4df60b..85c91c38 100644 --- a/platforms/joystick/joystick_driver.go +++ b/platforms/joystick/joystick_driver.go @@ -7,7 +7,7 @@ import ( "time" "github.com/veandco/go-sdl2/sdl" - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" ) const ( diff --git a/platforms/joystick/joystick_driver_test.go b/platforms/joystick/joystick_driver_test.go index 88894b28..fa4ea047 100644 --- a/platforms/joystick/joystick_driver_test.go +++ b/platforms/joystick/joystick_driver_test.go @@ -6,8 +6,8 @@ import ( "time" "github.com/veandco/go-sdl2/sdl" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) var _ gobot.Driver = (*Driver)(nil) diff --git a/platforms/keyboard/README.md b/platforms/keyboard/README.md index 139956ca..662811f9 100644 --- a/platforms/keyboard/README.md +++ b/platforms/keyboard/README.md @@ -5,7 +5,7 @@ This module implements support for keyboard events, wrapping the `stty` utility. ## How to Install ``` -go get -d -u gobot.io/x/gobot/... +go get -d -u gobot.io/x/gobot/v2/... ``` ## How to Use @@ -18,8 +18,8 @@ package main import ( "fmt" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/keyboard" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/keyboard" ) func main() { diff --git a/platforms/keyboard/doc.go b/platforms/keyboard/doc.go index 8378e3b4..012a05b2 100644 --- a/platforms/keyboard/doc.go +++ b/platforms/keyboard/doc.go @@ -5,7 +5,7 @@ Installing: Then you can install the package with: - go get gobot.io/x/gobot && go install gobot.io/x/gobot/platforms/keyboard + go get gobot.io/x/gobot/v2 && go install gobot.io/x/gobot/v2/platforms/keyboard Example: @@ -14,8 +14,8 @@ Example: import ( "fmt" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/keyboard" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/keyboard" ) func main() { @@ -42,8 +42,7 @@ Example: robot.Start() } - For further information refer to keyboard README: https://github.com/hybridgroup/gobot/blob/master/platforms/keyboard/README.md */ -package keyboard // import "gobot.io/x/gobot/platforms/keyboard" +package keyboard // import "gobot.io/x/gobot/v2/platforms/keyboard" diff --git a/platforms/keyboard/keyboard_driver.go b/platforms/keyboard/keyboard_driver.go index d3b5f000..fbfe856d 100644 --- a/platforms/keyboard/keyboard_driver.go +++ b/platforms/keyboard/keyboard_driver.go @@ -4,7 +4,7 @@ import ( "log" "os" - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" ) const ( @@ -22,7 +22,6 @@ type Driver struct { } // NewDriver returns a new keyboard Driver. -// func NewDriver() *Driver { k := &Driver{ name: gobot.DefaultName("Keyboard"), diff --git a/platforms/keyboard/keyboard_driver_test.go b/platforms/keyboard/keyboard_driver_test.go index 28a857ff..9ebb6147 100644 --- a/platforms/keyboard/keyboard_driver_test.go +++ b/platforms/keyboard/keyboard_driver_test.go @@ -5,8 +5,8 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) var _ gobot.Driver = (*Driver)(nil) diff --git a/platforms/keyboard/keyboard_test.go b/platforms/keyboard/keyboard_test.go index 8eab8262..a8275895 100644 --- a/platforms/keyboard/keyboard_test.go +++ b/platforms/keyboard/keyboard_test.go @@ -3,7 +3,7 @@ package keyboard import ( "testing" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2/gobottest" ) func TestParseSpace(t *testing.T) { diff --git a/platforms/leap/README.md b/platforms/leap/README.md index d7c89413..6dc8ae99 100644 --- a/platforms/leap/README.md +++ b/platforms/leap/README.md @@ -11,7 +11,7 @@ First install the [Leap Motion Software](https://www.leapmotion.com/setup) Now you can install the package with: ``` -go get -d -u gobot.io/x/gobot/... +go get -d -u gobot.io/x/gobot/v2/... ``` ## How to Use @@ -22,8 +22,8 @@ package main import ( "fmt" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/leap" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/leap" ) func main() { diff --git a/platforms/leap/doc.go b/platforms/leap/doc.go index 0d3c88d9..2a91d1c3 100644 --- a/platforms/leap/doc.go +++ b/platforms/leap/doc.go @@ -6,7 +6,7 @@ Installing: * First install the [Leap Motion Software](https://www.leapmotion.com/setup). * Then install the package: - go get gobot.io/x/gobot/platforms/leap + go get gobot.io/x/gobot/v2/platforms/leap Example: @@ -15,8 +15,8 @@ Example: import ( "fmt" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/leap" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/leap" ) func main() { @@ -41,4 +41,4 @@ Example: For more information refer to the leap README: https://github.com/hybridgroup/gobot/blob/master/platforms/leap/README.md */ -package leap // import "gobot.io/x/gobot/platforms/leap" +package leap // import "gobot.io/x/gobot/v2/platforms/leap" diff --git a/platforms/leap/leap_motion_adaptor.go b/platforms/leap/leap_motion_adaptor.go index 98f561f6..e78ae805 100644 --- a/platforms/leap/leap_motion_adaptor.go +++ b/platforms/leap/leap_motion_adaptor.go @@ -3,7 +3,7 @@ package leap import ( "io" - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" "golang.org/x/net/websocket" ) diff --git a/platforms/leap/leap_motion_adaptor_test.go b/platforms/leap/leap_motion_adaptor_test.go index e81e6b9a..bcc6449f 100644 --- a/platforms/leap/leap_motion_adaptor_test.go +++ b/platforms/leap/leap_motion_adaptor_test.go @@ -6,8 +6,8 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) var _ gobot.Adaptor = (*Adaptor)(nil) diff --git a/platforms/leap/leap_motion_driver.go b/platforms/leap/leap_motion_driver.go index ce4f1958..a31025db 100644 --- a/platforms/leap/leap_motion_driver.go +++ b/platforms/leap/leap_motion_driver.go @@ -4,7 +4,7 @@ import ( "encoding/json" "io" - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" "golang.org/x/net/websocket" ) @@ -28,9 +28,10 @@ type Driver struct { // NewDriver creates a new leap motion driver // // Adds the following events: -// "message" - Gets triggered when receiving a message from leap motion -// "hand" - Gets triggered per-message when leap motion detects a hand -// "gesture" - Gets triggered per-message when leap motion detects a gesture +// +// "message" - Gets triggered when receiving a message from leap motion +// "hand" - Gets triggered per-message when leap motion detects a hand +// "gesture" - Gets triggered per-message when leap motion detects a gesture func NewDriver(a *Adaptor) *Driver { l := &Driver{ name: gobot.DefaultName("LeapMotion"), @@ -79,15 +80,16 @@ func enableFeature(l *Driver, feature string) (err error) { // and listening from incoming messages. // // Publishes the following events: -// "message" - Emits Frame on new message received from Leap. -// "hand" - Emits Hand when detected in message from Leap. -// "gesture" - Emits Gesture when detected in message from Leap. +// +// "message" - Emits Frame on new message received from Leap. +// "hand" - Emits Hand when detected in message from Leap. +// "gesture" - Emits Gesture when detected in message from Leap. func (l *Driver) Start() (err error) { - err = enableFeature(l,"enableGestures") + err = enableFeature(l, "enableGestures") if err != nil { return err } - err = enableFeature(l,"background") + err = enableFeature(l, "background") if err != nil { return err } diff --git a/platforms/leap/leap_motion_driver_test.go b/platforms/leap/leap_motion_driver_test.go index 6f42d372..e98d080b 100644 --- a/platforms/leap/leap_motion_driver_test.go +++ b/platforms/leap/leap_motion_driver_test.go @@ -8,8 +8,8 @@ import ( "sync" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) var _ gobot.Driver = (*Driver)(nil) diff --git a/platforms/mavlink/README.md b/platforms/mavlink/README.md index 422c7f21..10724a82 100644 --- a/platforms/mavlink/README.md +++ b/platforms/mavlink/README.md @@ -17,7 +17,7 @@ configured to send version 1.0 frames. ## How to Install ``` -go get -d -u gobot.io/x/gobot/... +go get -d -u gobot.io/x/gobot/v2/... ``` @@ -29,9 +29,9 @@ package main import ( "fmt" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/mavlink" - common "gobot.io/x/gobot/platforms/mavlink/common" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/mavlink" + common "gobot.io/x/gobot/v2/platforms/mavlink/common" ) func main() { diff --git a/platforms/mavlink/doc.go b/platforms/mavlink/doc.go index 93fb6c21..da80cd49 100644 --- a/platforms/mavlink/doc.go +++ b/platforms/mavlink/doc.go @@ -3,7 +3,7 @@ Package mavlink contains the Gobot adaptor and driver for the MAVlink Communicat Installing: - go get gobot.io/x/gobot/platforms/mavlink + go get gobot.io/x/gobot/v2/platforms/mavlink Example: @@ -12,9 +12,9 @@ Example: import ( "fmt" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/mavlink" - common "gobot.io/x/gobot/platforms/mavlink/common" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/mavlink" + common "gobot.io/x/gobot/v2/platforms/mavlink/common" ) func main() { @@ -65,4 +65,4 @@ Example: For further information refer to mavlink README: https://github.com/hybridgroup/gobot/blob/master/platforms/mavlink/README.md */ -package mavlink // import "gobot.io/x/gobot/platforms/mavlink" +package mavlink // import "gobot.io/x/gobot/v2/platforms/mavlink" diff --git a/platforms/mavlink/mavlink_adaptor.go b/platforms/mavlink/mavlink_adaptor.go index 53bffd92..ee0ae411 100644 --- a/platforms/mavlink/mavlink_adaptor.go +++ b/platforms/mavlink/mavlink_adaptor.go @@ -4,8 +4,8 @@ import ( "io" "go.bug.st/serial" - "gobot.io/x/gobot" - common "gobot.io/x/gobot/platforms/mavlink/common" + "gobot.io/x/gobot/v2" + common "gobot.io/x/gobot/v2/platforms/mavlink/common" ) // Adaptor is a Mavlink transport adaptor. diff --git a/platforms/mavlink/mavlink_adaptor_test.go b/platforms/mavlink/mavlink_adaptor_test.go index 931b874c..edc484a2 100644 --- a/platforms/mavlink/mavlink_adaptor_test.go +++ b/platforms/mavlink/mavlink_adaptor_test.go @@ -6,8 +6,8 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) var _ gobot.Adaptor = (*Adaptor)(nil) diff --git a/platforms/mavlink/mavlink_driver.go b/platforms/mavlink/mavlink_driver.go index 84232d5f..97c12cdd 100644 --- a/platforms/mavlink/mavlink_driver.go +++ b/platforms/mavlink/mavlink_driver.go @@ -3,8 +3,8 @@ package mavlink import ( "time" - "gobot.io/x/gobot" - common "gobot.io/x/gobot/platforms/mavlink/common" + "gobot.io/x/gobot/v2" + common "gobot.io/x/gobot/v2/platforms/mavlink/common" ) const ( @@ -31,6 +31,7 @@ type MavlinkInterface interface { // NewDriver creates a new mavlink driver. // // It add the following events: +// // "packet" - triggered when a new packet is read // "message" - triggered when a new valid message is processed func NewDriver(a BaseAdaptor, v ...time.Duration) *Driver { diff --git a/platforms/mavlink/mavlink_driver_test.go b/platforms/mavlink/mavlink_driver_test.go index 54e53ef0..5e7eca89 100644 --- a/platforms/mavlink/mavlink_driver_test.go +++ b/platforms/mavlink/mavlink_driver_test.go @@ -6,9 +6,9 @@ import ( "testing" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" - common "gobot.io/x/gobot/platforms/mavlink/common" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" + common "gobot.io/x/gobot/v2/platforms/mavlink/common" ) var _ gobot.Driver = (*Driver)(nil) diff --git a/platforms/mavlink/mavlink_udp_adaptor.go b/platforms/mavlink/mavlink_udp_adaptor.go index a54f8b5d..d56a07d5 100644 --- a/platforms/mavlink/mavlink_udp_adaptor.go +++ b/platforms/mavlink/mavlink_udp_adaptor.go @@ -3,7 +3,7 @@ package mavlink import ( "net" - common "gobot.io/x/gobot/platforms/mavlink/common" + common "gobot.io/x/gobot/v2/platforms/mavlink/common" ) type UDPConnection interface { diff --git a/platforms/mavlink/mavlink_udp_adaptor_test.go b/platforms/mavlink/mavlink_udp_adaptor_test.go index 5c828782..84f47bd7 100644 --- a/platforms/mavlink/mavlink_udp_adaptor_test.go +++ b/platforms/mavlink/mavlink_udp_adaptor_test.go @@ -7,9 +7,9 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" - mavlink "gobot.io/x/gobot/platforms/mavlink/common" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" + mavlink "gobot.io/x/gobot/v2/platforms/mavlink/common" ) var _ gobot.Adaptor = (*UDPAdaptor)(nil) diff --git a/platforms/megapi/README.md b/platforms/megapi/README.md index 5c7af6ab..fa50f262 100644 --- a/platforms/megapi/README.md +++ b/platforms/megapi/README.md @@ -7,7 +7,7 @@ The code is based on a python implementation that can be found [here](https://gi ## How to Install ``` -go get -d -u gobot.io/x/gobot/... +go get -d -u gobot.io/x/gobot/v2/... ``` ## How to Use @@ -16,8 +16,8 @@ go get -d -u gobot.io/x/gobot/... package main import ( - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/megapi" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/megapi" "time" ) diff --git a/platforms/megapi/doc.go b/platforms/megapi/doc.go index d25a9d80..8e191020 100644 --- a/platforms/megapi/doc.go +++ b/platforms/megapi/doc.go @@ -4,4 +4,4 @@ Package megapi provides the Gobot adaptor for MegaPi. For more information refer to the README: https://github.com/hybridgroup/gobot/blob/master/platforms/megapi/README.md */ -package megapi // import "gobot.io/x/gobot/platforms/megapi" +package megapi // import "gobot.io/x/gobot/v2/platforms/megapi" diff --git a/platforms/megapi/megapi_adaptor.go b/platforms/megapi/megapi_adaptor.go index 43b3c942..f2b6fdaa 100644 --- a/platforms/megapi/megapi_adaptor.go +++ b/platforms/megapi/megapi_adaptor.go @@ -5,7 +5,7 @@ import ( "time" "go.bug.st/serial" - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" ) var _ gobot.Adaptor = (*Adaptor)(nil) diff --git a/platforms/megapi/motor_driver.go b/platforms/megapi/motor_driver.go index be739872..47d08d7d 100644 --- a/platforms/megapi/motor_driver.go +++ b/platforms/megapi/motor_driver.go @@ -5,7 +5,7 @@ import ( "encoding/binary" "sync" - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" ) var _ gobot.Driver = (*MotorDriver)(nil) diff --git a/platforms/microbit/README.md b/platforms/microbit/README.md index f2927f0c..fd69ce01 100644 --- a/platforms/microbit/README.md +++ b/platforms/microbit/README.md @@ -4,7 +4,7 @@ The [Microbit](http://microbit.org/) is a tiny computer with built-in Bluetooth ## How to Install ``` -go get -d -u gobot.io/x/gobot/... +go get -d -u gobot.io/x/gobot/v2/... ``` You must install the Microbit firmware from [@sandeepmistry] located at [https://github.com/sandeepmistry/node-bbc-microbit](https://github.com/sandeepmistry/node-bbc-microbit) to use the Microbit with Gobot. This firmware is based on the micro:bit template, but with a few changes. @@ -44,9 +44,9 @@ import ( "os" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/ble" - "gobot.io/x/gobot/platforms/microbit" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/ble" + "gobot.io/x/gobot/v2/platforms/microbit" ) func main() { @@ -85,10 +85,10 @@ package main import ( "os" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/ble" - "gobot.io/x/gobot/platforms/microbit" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/ble" + "gobot.io/x/gobot/v2/platforms/microbit" ) func main() { diff --git a/platforms/microbit/accelerometer_driver.go b/platforms/microbit/accelerometer_driver.go index 542a7add..a8da0946 100644 --- a/platforms/microbit/accelerometer_driver.go +++ b/platforms/microbit/accelerometer_driver.go @@ -4,8 +4,8 @@ import ( "bytes" "encoding/binary" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/ble" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/ble" ) // AccelerometerDriver is the Gobot driver for the Microbit's built-in accelerometer diff --git a/platforms/microbit/accelerometer_driver_test.go b/platforms/microbit/accelerometer_driver_test.go index f664ec98..36db696e 100644 --- a/platforms/microbit/accelerometer_driver_test.go +++ b/platforms/microbit/accelerometer_driver_test.go @@ -5,8 +5,8 @@ import ( "testing" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) var _ gobot.Driver = (*AccelerometerDriver)(nil) diff --git a/platforms/microbit/button_driver.go b/platforms/microbit/button_driver.go index 2df5dde8..b91c6112 100644 --- a/platforms/microbit/button_driver.go +++ b/platforms/microbit/button_driver.go @@ -1,8 +1,8 @@ package microbit import ( - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/ble" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/ble" ) // ButtonDriver is the Gobot driver for the Microbit's built-in buttons diff --git a/platforms/microbit/button_driver_test.go b/platforms/microbit/button_driver_test.go index edadeeed..d2a488f6 100644 --- a/platforms/microbit/button_driver_test.go +++ b/platforms/microbit/button_driver_test.go @@ -5,8 +5,8 @@ import ( "testing" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) var _ gobot.Driver = (*ButtonDriver)(nil) diff --git a/platforms/microbit/doc.go b/platforms/microbit/doc.go index 471bb7ed..e97b9f95 100644 --- a/platforms/microbit/doc.go +++ b/platforms/microbit/doc.go @@ -4,4 +4,4 @@ Package microbit contains the Gobot drivers for the Microbit. For more information refer to the microbit README: https://github.com/hybridgroup/gobot/blob/master/platforms/microbit/README.md */ -package microbit // import "gobot.io/x/gobot/platforms/microbit" +package microbit // import "gobot.io/x/gobot/v2/platforms/microbit" diff --git a/platforms/microbit/helpers_test.go b/platforms/microbit/helpers_test.go index da5bc318..e056ebcc 100644 --- a/platforms/microbit/helpers_test.go +++ b/platforms/microbit/helpers_test.go @@ -3,7 +3,7 @@ package microbit import ( "sync" - "gobot.io/x/gobot/platforms/ble" + "gobot.io/x/gobot/v2/platforms/ble" ) var _ ble.BLEConnector = (*bleTestClientAdaptor)(nil) diff --git a/platforms/microbit/io_pin_driver.go b/platforms/microbit/io_pin_driver.go index 4e90804b..363bac78 100644 --- a/platforms/microbit/io_pin_driver.go +++ b/platforms/microbit/io_pin_driver.go @@ -6,8 +6,8 @@ import ( "errors" "strconv" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/ble" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/ble" ) // IOPinDriver is the Gobot driver for the Microbit's built-in digital and diff --git a/platforms/microbit/io_pin_driver_test.go b/platforms/microbit/io_pin_driver_test.go index dd1a3adf..ceda71d9 100644 --- a/platforms/microbit/io_pin_driver_test.go +++ b/platforms/microbit/io_pin_driver_test.go @@ -5,10 +5,10 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/aio" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/aio" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/gobottest" ) // the IOPinDriver is a Driver diff --git a/platforms/microbit/led_driver.go b/platforms/microbit/led_driver.go index 7d84fc02..877a5441 100644 --- a/platforms/microbit/led_driver.go +++ b/platforms/microbit/led_driver.go @@ -1,8 +1,8 @@ package microbit import ( - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/ble" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/ble" ) // LEDDriver is the Gobot driver for the Microbit's LED array diff --git a/platforms/microbit/led_driver_test.go b/platforms/microbit/led_driver_test.go index 54f97425..7e02da79 100644 --- a/platforms/microbit/led_driver_test.go +++ b/platforms/microbit/led_driver_test.go @@ -4,8 +4,8 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) var _ gobot.Driver = (*LEDDriver)(nil) diff --git a/platforms/microbit/magnetometer_driver.go b/platforms/microbit/magnetometer_driver.go index 92f59f97..148ceb5b 100644 --- a/platforms/microbit/magnetometer_driver.go +++ b/platforms/microbit/magnetometer_driver.go @@ -4,8 +4,8 @@ import ( "bytes" "encoding/binary" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/ble" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/ble" ) // MagnetometerDriver is the Gobot driver for the Microbit's built-in magnetometer diff --git a/platforms/microbit/magnetometer_driver_test.go b/platforms/microbit/magnetometer_driver_test.go index a8936056..8e5c59c9 100644 --- a/platforms/microbit/magnetometer_driver_test.go +++ b/platforms/microbit/magnetometer_driver_test.go @@ -5,8 +5,8 @@ import ( "testing" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) var _ gobot.Driver = (*MagnetometerDriver)(nil) diff --git a/platforms/microbit/temperature_driver.go b/platforms/microbit/temperature_driver.go index 0e1bbc34..c1442049 100644 --- a/platforms/microbit/temperature_driver.go +++ b/platforms/microbit/temperature_driver.go @@ -3,8 +3,8 @@ package microbit import ( "bytes" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/ble" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/ble" ) // TemperatureDriver is the Gobot driver for the Microbit's built-in thermometer diff --git a/platforms/microbit/temperature_driver_test.go b/platforms/microbit/temperature_driver_test.go index f039f9d2..6bd40ca4 100644 --- a/platforms/microbit/temperature_driver_test.go +++ b/platforms/microbit/temperature_driver_test.go @@ -5,8 +5,8 @@ import ( "testing" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) var _ gobot.Driver = (*TemperatureDriver)(nil) diff --git a/platforms/mqtt/README.md b/platforms/mqtt/README.md index ec41b7e8..1e23a946 100644 --- a/platforms/mqtt/README.md +++ b/platforms/mqtt/README.md @@ -1,17 +1,19 @@ # MQTT -MQTT is an Internet of Things connectivity protocol featuring a lightweight publish/subscribe messaging transport. It is useful for its small code footprint and minimal network bandwidth usage. +MQTT is an Internet of Things connectivity protocol featuring a lightweight publish/subscribe messaging transport. It is +useful for its small code footprint and minimal network bandwidth usage. -This repository contains the Gobot adaptor/driver to connect to MQTT servers. It uses the Paho MQTT Golang client package (https://eclipse.org/paho/) created and maintained by the Eclipse Foundation (https://github.com/eclipse) thank you! +This repository contains the Gobot adaptor/driver to connect to MQTT servers. It uses the Paho MQTT Golang client package +() created and maintained by the Eclipse Foundation () thank you! -For more info about the MQTT machine to machine messaging standard, go to http://mqtt.org/ +For more info about the MQTT machine to machine messaging standard, go to . ## How to Install Install running: -``` -go get -d -u gobot.io/x/gobot/... +```sh +go get -d -u gobot.io/x/gobot/v2/... ``` ## How to Use @@ -22,8 +24,8 @@ Before running the example, make sure you have an MQTT message broker running so package main import ( - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/mqtt" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/mqtt" "fmt" "time" ) @@ -61,10 +63,6 @@ func main() { * Publish messages * Respond to incoming message events -## Contributing - -For our contribution guidelines, please go to https://gobot.io/x/gobot/blob/master/CONTRIBUTING.md - ## License Copyright (c) 2013-2018 The Hybrid Group. Licensed under the Apache 2.0 license. diff --git a/platforms/mqtt/doc.go b/platforms/mqtt/doc.go index 730ac4bf..1e1785e5 100644 --- a/platforms/mqtt/doc.go +++ b/platforms/mqtt/doc.go @@ -3,9 +3,9 @@ Package mqtt provides Gobot adaptor for the mqtt message service. Installing: - go get gobot.io/x/gobot/platforms/mqtt + go get gobot.io/x/gobot/v2/platforms/mqtt For further information refer to mqtt README: https://github.com/hybridgroup/gobot/blob/master/platforms/mqtt/README.md */ -package mqtt // import "gobot.io/x/gobot/platforms/mqtt" +package mqtt // import "gobot.io/x/gobot/v2/platforms/mqtt" diff --git a/platforms/mqtt/mqtt_adaptor.go b/platforms/mqtt/mqtt_adaptor.go index 31c24dff..3056ab7d 100644 --- a/platforms/mqtt/mqtt_adaptor.go +++ b/platforms/mqtt/mqtt_adaptor.go @@ -5,7 +5,7 @@ import ( "crypto/x509" "io/ioutil" - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" paho "github.com/eclipse/paho.mqtt.golang" multierror "github.com/hashicorp/go-multierror" diff --git a/platforms/mqtt/mqtt_adaptor_test.go b/platforms/mqtt/mqtt_adaptor_test.go index 6ab8170c..638ad0bd 100644 --- a/platforms/mqtt/mqtt_adaptor_test.go +++ b/platforms/mqtt/mqtt_adaptor_test.go @@ -7,8 +7,8 @@ import ( "testing" multierror "github.com/hashicorp/go-multierror" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) var _ gobot.Adaptor = (*Adaptor)(nil) diff --git a/platforms/mqtt/mqtt_driver.go b/platforms/mqtt/mqtt_driver.go index d9070859..68335f95 100644 --- a/platforms/mqtt/mqtt_driver.go +++ b/platforms/mqtt/mqtt_driver.go @@ -1,6 +1,6 @@ package mqtt -import "gobot.io/x/gobot" +import "gobot.io/x/gobot/v2" const ( // Data event when data is available for Driver diff --git a/platforms/mqtt/mqtt_driver_test.go b/platforms/mqtt/mqtt_driver_test.go index 71cfbbeb..8f8fb778 100644 --- a/platforms/mqtt/mqtt_driver_test.go +++ b/platforms/mqtt/mqtt_driver_test.go @@ -4,8 +4,8 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) var _ gobot.Driver = (*Driver)(nil) diff --git a/platforms/nanopi/README.md b/platforms/nanopi/README.md index fb4522f8..f9bacc19 100644 --- a/platforms/nanopi/README.md +++ b/platforms/nanopi/README.md @@ -15,7 +15,7 @@ You would normally install Go and Gobot on your workstation. Once installed, cro workstation, transfer the final executable to your board, and run the program on the board as documented here. ```sh -go get -d -u gobot.io/x/gobot/... +go get -d -u gobot.io/x/gobot/v2/... ``` ### System access and configuration basics diff --git a/platforms/nanopi/doc.go b/platforms/nanopi/doc.go index 8b5bed17..9489524b 100644 --- a/platforms/nanopi/doc.go +++ b/platforms/nanopi/doc.go @@ -4,4 +4,4 @@ Package nanopi contains the Gobot adaptor for the FriendlyARM NanoPi Boards. For further information refer to nanopi README: https://github.com/hybridgroup/gobot/blob/master/platforms/nanopi/README.md */ -package nanopi // import "gobot.io/x/gobot/platforms/nanopi" +package nanopi // import "gobot.io/x/gobot/v2/platforms/nanopi" diff --git a/platforms/nanopi/nanopi_adaptor.go b/platforms/nanopi/nanopi_adaptor.go index 1b119a4f..65f244c9 100644 --- a/platforms/nanopi/nanopi_adaptor.go +++ b/platforms/nanopi/nanopi_adaptor.go @@ -5,9 +5,9 @@ import ( "sync" multierror "github.com/hashicorp/go-multierror" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/adaptors" - "gobot.io/x/gobot/system" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/adaptors" + "gobot.io/x/gobot/v2/system" ) const ( @@ -56,13 +56,14 @@ type Adaptor struct { // NewNeoAdaptor creates a board adaptor for NanoPi NEO // // Optional parameters: -// adaptors.WithGpiodAccess(): use character device gpiod driver instead of sysfs (still used by default) -// adaptors.WithSpiGpioAccess(sclk, nss, mosi, miso): use GPIO's instead of /dev/spidev#.# -// adaptors.WithGpiosActiveLow(pin's): invert the pin behavior -// adaptors.WithGpiosPullUp/Down(pin's): sets the internal pull resistor -// adaptors.WithGpiosOpenDrain/Source(pin's): sets the output behavior -// adaptors.WithGpioDebounce(pin, period): sets the input debouncer -// adaptors.WithGpioEventOnFallingEdge/RaisingEdge/BothEdges(pin, handler): activate edge detection +// +// adaptors.WithGpiodAccess(): use character device gpiod driver instead of sysfs (still used by default) +// adaptors.WithSpiGpioAccess(sclk, nss, mosi, miso): use GPIO's instead of /dev/spidev#.# +// adaptors.WithGpiosActiveLow(pin's): invert the pin behavior +// adaptors.WithGpiosPullUp/Down(pin's): sets the internal pull resistor +// adaptors.WithGpiosOpenDrain/Source(pin's): sets the output behavior +// adaptors.WithGpioDebounce(pin, period): sets the input debouncer +// adaptors.WithGpioEventOnFallingEdge/RaisingEdge/BothEdges(pin, handler): activate edge detection func NewNeoAdaptor(opts ...func(adaptors.Optioner)) *Adaptor { sys := system.NewAccesser(system.WithDigitalPinGpiodAccess()) c := &Adaptor{ diff --git a/platforms/nanopi/nanopi_adaptor_test.go b/platforms/nanopi/nanopi_adaptor_test.go index cd4ce274..e506ef67 100644 --- a/platforms/nanopi/nanopi_adaptor_test.go +++ b/platforms/nanopi/nanopi_adaptor_test.go @@ -5,11 +5,11 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/gobottest" - "gobot.io/x/gobot/system" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/gobottest" + "gobot.io/x/gobot/v2/system" ) const ( diff --git a/platforms/nats/README.md b/platforms/nats/README.md index 9e6e9b1c..91d25245 100644 --- a/platforms/nats/README.md +++ b/platforms/nats/README.md @@ -1,103 +1,115 @@ # NATS -NATS is a lightweight messaging protocol perfect for your IoT/Robotics projects. It operates over TCP, offers a great number of features but an incredibly simple Pub Sub style model of communicating broadcast messages. NATS is blazingly fast as it is written in Go. +NATS is a lightweight messaging protocol perfect for your IoT/Robotics projects. It operates over TCP, offers a great +number of features but an incredibly simple Pub Sub style model of communicating broadcast messages. NATS is blazingly +fast as it is written in Go. -This repository contains the Gobot adaptor/drivers to connect to NATS servers. It uses the NATS Go Client available at https://github.com/nats-io/nats. The NATS project is a project part of the [CNCF](https://www.cncf.io/). Find more information on setting up a NATS server and its capability at http://nats.io/. +This repository contains the Gobot adaptor/drivers to connect to NATS servers. It uses the NATS Go Client available at +. The NATS project is a project part of the [CNCF](https://www.cncf.io/). Find more +information on setting up a NATS server and its capability at . -The NATS messaging protocol (http://www.nats.io/documentation/internals/nats-protocol-demo/) is really easy to work with and can be practiced by setting up a NATS server using Go or Docker. For information on setting up a server using the source code, visit https://github.com/nats-io/gnatsd. For information on the Docker image up on Docker Hub, see https://hub.docker.com/_/nats/. Getting the server set up is very easy. The server itself is Golang, can be built for different architectures and installs in a small footprint. This is an excellent way to get communications going between your IoT and Robotics projects. +The NATS messaging protocol () is really easy to work +with and can be practiced by setting up a NATS server using Go or Docker. For information on setting up a server using +the source code, visit . For information on the Docker image up on Docker Hub, see +. Getting the server set up is very easy. The server itself is Golang, can be built for +different architectures and installs in a small footprint. This is an excellent way to get communications going between +your IoT and Robotics projects. ## How to Install Install running: -``` -go get -d -u gobot.io/x/gobot/... +```sh +go get -d -u gobot.io/x/gobot/v2/... ``` ## How to Use -Before running the example, make sure you have an NATS server running somewhere you can connect to (for demo purposes you could also use the public endpoint `demo.nats.io:4222`). +Before running the example, make sure you have an NATS server running somewhere you can connect to (for demo purposes +you could also use the public endpoint `demo.nats.io:4222`). ```go package main import ( - "fmt" - "time" + "fmt" + "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/nats" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/nats" ) func main() { - natsAdaptor := nats.NewAdaptor("nats://localhost:4222", 1234) + natsAdaptor := nats.NewAdaptor("nats://localhost:4222", 1234) - work := func() { - natsAdaptor.On("hello", func(msg nats.Message) { - fmt.Printf("[Received on %q] %s\n", msg.Subject, string(msg.Data)) - }) - natsAdaptor.On("hola", func(msg nats.Message) { - fmt.Printf("[Received on %q] %s\n", msg.Subject, string(msg.Data)) - }) + work := func() { + natsAdaptor.On("hello", func(msg nats.Message) { + fmt.Printf("[Received on %q] %s\n", msg.Subject, string(msg.Data)) + }) + natsAdaptor.On("hola", func(msg nats.Message) { + fmt.Printf("[Received on %q] %s\n", msg.Subject, string(msg.Data)) + }) - data := []byte("Hello Gobot!") - gobot.Every(1*time.Second, func() { - natsAdaptor.Publish("hello", data) - }) - gobot.Every(5*time.Second, func() { - natsAdaptor.Publish("hola", data) - }) - } + data := []byte("Hello Gobot!") + gobot.Every(1*time.Second, func() { + natsAdaptor.Publish("hello", data) + }) + gobot.Every(5*time.Second, func() { + natsAdaptor.Publish("hola", data) + }) + } - robot := gobot.NewRobot("natsBot", - []gobot.Connection{natsAdaptor}, - work, - ) + robot := gobot.NewRobot("natsBot", + []gobot.Connection{natsAdaptor}, + work, + ) - robot.Start() + robot.Start() } ``` -To run with TLS enabled, set the URL scheme prefix to `tls://`. Make sure the NATS server has TLS enabled and use the NATS option parameters to pass in the TLS settings to the adaptor. Refer to the [github.com/nats-io/go-nats](https://github.com/nats-io/go-nats) README for more TLS option parameters. +To run with TLS enabled, set the URL scheme prefix to `tls://`. Make sure the NATS server has TLS enabled and use the +NATS option parameters to pass in the TLS settings to the adaptor. Refer to the [github.com/nats-io/go-nats](https://github.com/nats-io/go-nats) +README for more TLS option parameters. ```go package main import ( - "fmt" - "time" + "fmt" + "time" - natsio "github.com/nats-io/go-nats" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/nats" + natsio "github.com/nats-io/go-nats" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/nats" ) func main() { - natsAdaptor := nats.NewAdaptor("tls://localhost:4222", 1234, natsio.RootCAs("certs/ca.pem")) + natsAdaptor := nats.NewAdaptor("tls://localhost:4222", 1234, natsio.RootCAs("certs/ca.pem")) - work := func() { - natsAdaptor.On("hello", func(msg nats.Message) { - fmt.Printf("[Received on %q] %s\n", msg.Subject, string(msg.Data)) - }) - natsAdaptor.On("hola", func(msg nats.Message) { - fmt.Printf("[Received on %q] %s\n", msg.Subject, string(msg.Data)) - }) + work := func() { + natsAdaptor.On("hello", func(msg nats.Message) { + fmt.Printf("[Received on %q] %s\n", msg.Subject, string(msg.Data)) + }) + natsAdaptor.On("hola", func(msg nats.Message) { + fmt.Printf("[Received on %q] %s\n", msg.Subject, string(msg.Data)) + }) - data := []byte("Hello Gobot!") - gobot.Every(1*time.Second, func() { - natsAdaptor.Publish("hello", data) - }) - gobot.Every(5*time.Second, func() { - natsAdaptor.Publish("hola", data) - }) - } + data := []byte("Hello Gobot!") + gobot.Every(1*time.Second, func() { + natsAdaptor.Publish("hello", data) + }) + gobot.Every(5*time.Second, func() { + natsAdaptor.Publish("hola", data) + }) + } - robot := gobot.NewRobot("natsBot", - []gobot.Connection{natsAdaptor}, - work, - ) + robot := gobot.NewRobot("natsBot", + []gobot.Connection{natsAdaptor}, + work, + ) - robot.Start() + robot.Start() } ``` @@ -114,10 +126,6 @@ func main() { * Exposing more NATS Features (tls) * Simplified tests -## Contributing - -For our contribution guidelines, please go to https://gobot.io/x/gobot/blob/master/CONTRIBUTING.md - ## License Copyright (c) 2013-2018 The Hybrid Group. Licensed under the Apache 2.0 license. diff --git a/platforms/nats/doc.go b/platforms/nats/doc.go index 8ec3824f..76dcac5c 100644 --- a/platforms/nats/doc.go +++ b/platforms/nats/doc.go @@ -1,8 +1,10 @@ /* Package nats provides Gobot adaptor for the nats message service. Installing: - go get gobot.io/x/gobot/platforms/nats + + go get gobot.io/x/gobot/v2/platforms/nats + For further information refer to nats README: https://github.com/hybridgroup/gobot/blob/master/platforms/nats/README.md */ -package nats // import "gobot.io/x/gobot/platforms/nats" +package nats // import "gobot.io/x/gobot/v2/platforms/nats" diff --git a/platforms/nats/nats_adaptor.go b/platforms/nats/nats_adaptor.go index 8152c77c..5099ef9a 100644 --- a/platforms/nats/nats_adaptor.go +++ b/platforms/nats/nats_adaptor.go @@ -5,7 +5,7 @@ import ( "strings" "github.com/nats-io/nats.go" - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" ) // Adaptor is a configuration struct for interacting with a NATS server. diff --git a/platforms/nats/nats_adaptor_test.go b/platforms/nats/nats_adaptor_test.go index d41b7598..502c552f 100644 --- a/platforms/nats/nats_adaptor_test.go +++ b/platforms/nats/nats_adaptor_test.go @@ -8,8 +8,8 @@ import ( "testing" "github.com/nats-io/nats.go" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) var _ gobot.Adaptor = (*Adaptor)(nil) diff --git a/platforms/nats/nats_driver.go b/platforms/nats/nats_driver.go index 811dda1f..36fab63a 100644 --- a/platforms/nats/nats_driver.go +++ b/platforms/nats/nats_driver.go @@ -1,6 +1,6 @@ package nats -import "gobot.io/x/gobot" +import "gobot.io/x/gobot/v2" const ( // Data event when data is available for Driver diff --git a/platforms/nats/nats_driver_test.go b/platforms/nats/nats_driver_test.go index 9479fb21..2725df02 100644 --- a/platforms/nats/nats_driver_test.go +++ b/platforms/nats/nats_driver_test.go @@ -4,8 +4,8 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) var _ gobot.Driver = (*Driver)(nil) diff --git a/platforms/neurosky/README.md b/platforms/neurosky/README.md index 92d9c441..95db0cd2 100644 --- a/platforms/neurosky/README.md +++ b/platforms/neurosky/README.md @@ -8,7 +8,7 @@ This package contains the Gobot adaptor and driver for the [Neurosky Mindwave Mo Installing Gobot with Neurosky support is pretty easy. ``` -go get -d -u gobot.io/x/gobot/... +go get -d -u gobot.io/x/gobot/v2/... ``` ## How To Connect @@ -52,8 +52,8 @@ package main import ( "fmt" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/neurosky" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/neurosky" ) func main() { diff --git a/platforms/neurosky/doc.go b/platforms/neurosky/doc.go index a6573e20..9270f69c 100644 --- a/platforms/neurosky/doc.go +++ b/platforms/neurosky/doc.go @@ -3,7 +3,7 @@ Package neurosky contains the Gobot adaptor and driver for the Neurosky Mindwave Installing: - go get gobot.io/x/gobot/platforms/neurosky + go get gobot.io/x/gobot/v2/platforms/neurosky Example: @@ -12,8 +12,8 @@ Example: import ( "fmt" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/neurosky" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/neurosky" ) func main() { @@ -65,4 +65,4 @@ Example: For further information refer to neuroky README: https://github.com/hybridgroup/gobot/blob/master/platforms/neurosky/README.md */ -package neurosky // import "gobot.io/x/gobot/platforms/neurosky" +package neurosky // import "gobot.io/x/gobot/v2/platforms/neurosky" diff --git a/platforms/neurosky/neurosky_adaptor_test.go b/platforms/neurosky/neurosky_adaptor_test.go index bf2d1f8f..fe1d8aa1 100644 --- a/platforms/neurosky/neurosky_adaptor_test.go +++ b/platforms/neurosky/neurosky_adaptor_test.go @@ -7,8 +7,8 @@ import ( "sync" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) var _ gobot.Adaptor = (*Adaptor)(nil) diff --git a/platforms/neurosky/neurosky_driver.go b/platforms/neurosky/neurosky_driver.go index d4ed0015..f08403ec 100644 --- a/platforms/neurosky/neurosky_driver.go +++ b/platforms/neurosky/neurosky_driver.go @@ -3,7 +3,7 @@ package neurosky import ( "bytes" - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" ) const ( @@ -78,13 +78,13 @@ type EEGData struct { // NewDriver creates a Neurosky Driver // and adds the following events: // -// extended - user's current extended level -// signal - shows signal strength -// attention - user's current attention level -// meditation - user's current meditation level -// blink - user's current blink level -// wave - shows wave data -// eeg - showing eeg data +// extended - user's current extended level +// signal - shows signal strength +// attention - user's current attention level +// meditation - user's current meditation level +// blink - user's current blink level +// wave - shows wave data +// eeg - showing eeg data func NewDriver(a *Adaptor) *Driver { n := &Driver{ name: "Neurosky", diff --git a/platforms/neurosky/neurosky_driver_test.go b/platforms/neurosky/neurosky_driver_test.go index 66619375..ab73215b 100644 --- a/platforms/neurosky/neurosky_driver_test.go +++ b/platforms/neurosky/neurosky_driver_test.go @@ -8,8 +8,8 @@ import ( "testing" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) var _ gobot.Driver = (*Driver)(nil) diff --git a/platforms/opencv/README.md b/platforms/opencv/README.md index 14011f9b..5b1fdff8 100644 --- a/platforms/opencv/README.md +++ b/platforms/opencv/README.md @@ -32,7 +32,7 @@ https://gocv.io/getting-started/windows/ Now you can install the Gobot package itself with ``` -go get -d -u gobot.io/x/gobot/... +go get -d -u gobot.io/x/gobot/v2/... ``` ## How to Use @@ -43,8 +43,8 @@ Here is an example using the camera: package main import ( - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/opencv" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/opencv" "gocv.io/x/gocv" ) diff --git a/platforms/opencv/camera_driver.go b/platforms/opencv/camera_driver.go index 3a7f8b11..e83aa5f8 100644 --- a/platforms/opencv/camera_driver.go +++ b/platforms/opencv/camera_driver.go @@ -3,7 +3,7 @@ package opencv import ( "errors" - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" "gocv.io/x/gocv" ) diff --git a/platforms/opencv/camera_driver_test.go b/platforms/opencv/camera_driver_test.go index 5eeed794..dd3ae7bf 100644 --- a/platforms/opencv/camera_driver_test.go +++ b/platforms/opencv/camera_driver_test.go @@ -5,8 +5,8 @@ import ( "testing" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) var _ gobot.Driver = (*CameraDriver)(nil) diff --git a/platforms/opencv/doc.go b/platforms/opencv/doc.go index 0c6b52c6..95e71d6f 100644 --- a/platforms/opencv/doc.go +++ b/platforms/opencv/doc.go @@ -3,11 +3,11 @@ Package opencv contains the Gobot drivers for opencv. Installing: -This package requires `opencv` to be installed on your system +# This package requires `opencv` to be installed on your system Then you can install the package with: - go get gobot.io/x/gobot && go install gobot.io/x/gobot/platforms/opencv + go get gobot.io/x/gobot/v2 && go install gobot.io/x/gobot/v2/platforms/opencv Example: @@ -15,8 +15,8 @@ Example: import ( cv "gobot.io/x/go-opencv/opencv" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/opencv" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/opencv" ) func main() { @@ -40,4 +40,4 @@ Example: For further information refer to opencv README: https://github.com/hybridgroup/gobot/blob/master/platforms/opencv/README.md */ -package opencv // import "gobot.io/x/gobot/platforms/opencv" +package opencv // import "gobot.io/x/gobot/v2/platforms/opencv" diff --git a/platforms/opencv/utils_test.go b/platforms/opencv/utils_test.go index e1e1a8e6..b89a95c0 100644 --- a/platforms/opencv/utils_test.go +++ b/platforms/opencv/utils_test.go @@ -5,7 +5,7 @@ import ( "runtime" "testing" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2/gobottest" "gocv.io/x/gocv" ) diff --git a/platforms/opencv/window_driver.go b/platforms/opencv/window_driver.go index 47a19cbb..7d6eb2fc 100644 --- a/platforms/opencv/window_driver.go +++ b/platforms/opencv/window_driver.go @@ -1,7 +1,7 @@ package opencv import ( - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" "gocv.io/x/gocv" ) diff --git a/platforms/opencv/window_driver_test.go b/platforms/opencv/window_driver_test.go index 734600b9..9a112774 100644 --- a/platforms/opencv/window_driver_test.go +++ b/platforms/opencv/window_driver_test.go @@ -6,8 +6,8 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" "gocv.io/x/gocv" ) diff --git a/platforms/parrot/ardrone/README.md b/platforms/parrot/ardrone/README.md index de418d79..81a112bb 100644 --- a/platforms/parrot/ardrone/README.md +++ b/platforms/parrot/ardrone/README.md @@ -6,7 +6,7 @@ For more info about the ARDrone platform click [here](http://ardrone2.parrot.com ## How to Install ``` -go get -d -u gobot.io/x/gobot/... +go get -d -u gobot.io/x/gobot/v2/... ``` ## How to Use @@ -16,8 +16,8 @@ package main import ( "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/parrot/ardrone" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/parrot/ardrone" ) func main() { diff --git a/platforms/parrot/ardrone/ardrone_adaptor.go b/platforms/parrot/ardrone/ardrone_adaptor.go index c962b0f8..336de7ff 100644 --- a/platforms/parrot/ardrone/ardrone_adaptor.go +++ b/platforms/parrot/ardrone/ardrone_adaptor.go @@ -2,7 +2,7 @@ package ardrone import ( client "github.com/hybridgroup/go-ardrone/client" - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" ) // drone defines expected drone behaviour @@ -30,8 +30,7 @@ type Adaptor struct { // NewAdaptor returns a new ardrone.Adaptor and optionally accepts: // -// string: The ardrones IP Address -// +// string: The ardrones IP Address func NewAdaptor(v ...string) *Adaptor { a := &Adaptor{ name: gobot.DefaultName("ARDrone"), diff --git a/platforms/parrot/ardrone/ardrone_adaptor_test.go b/platforms/parrot/ardrone/ardrone_adaptor_test.go index 02790233..beb8ffe8 100644 --- a/platforms/parrot/ardrone/ardrone_adaptor_test.go +++ b/platforms/parrot/ardrone/ardrone_adaptor_test.go @@ -5,8 +5,8 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) var _ gobot.Adaptor = (*Adaptor)(nil) diff --git a/platforms/parrot/ardrone/ardrone_driver.go b/platforms/parrot/ardrone/ardrone_driver.go index c63ce4e4..f5e27933 100644 --- a/platforms/parrot/ardrone/ardrone_driver.go +++ b/platforms/parrot/ardrone/ardrone_driver.go @@ -1,7 +1,7 @@ package ardrone import ( - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" ) const ( @@ -19,7 +19,8 @@ type Driver struct { // NewDriver creates an Driver for the ARDrone. // // It add the following events: -// 'flying' - Sent when the device has taken off. +// +// 'flying' - Sent when the device has taken off. func NewDriver(connection *Adaptor) *Driver { d := &Driver{ name: gobot.DefaultName("ARDrone"), diff --git a/platforms/parrot/ardrone/ardrone_driver_test.go b/platforms/parrot/ardrone/ardrone_driver_test.go index 99495565..ec1bf9c9 100644 --- a/platforms/parrot/ardrone/ardrone_driver_test.go +++ b/platforms/parrot/ardrone/ardrone_driver_test.go @@ -3,8 +3,8 @@ package ardrone import ( "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) var _ gobot.Driver = (*Driver)(nil) diff --git a/platforms/parrot/ardrone/doc.go b/platforms/parrot/ardrone/doc.go index 4b28b0da..62e7b37d 100644 --- a/platforms/parrot/ardrone/doc.go +++ b/platforms/parrot/ardrone/doc.go @@ -3,7 +3,7 @@ Package ardrone provides the Gobot adaptor and driver for the Parrot Ardrone. Installing: - go get -d -u gobot.io/x/gobot/... && go install gobot.io/x/gobot/platforms/parrot/ardrone + go get -d -u gobot.io/x/gobot/v2/... && go install gobot.io/x/gobot/v2/platforms/parrot/ardrone Example: @@ -12,8 +12,8 @@ Example: import ( "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/parrot/ardrone" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/parrot/ardrone" ) func main() { @@ -41,4 +41,4 @@ Example: For more information refer to the ardrone README: https://github.com/hybridgroup/gobot/tree/master/platforms/parrot/ardrone/README.md */ -package ardrone // import "gobot.io/x/gobot/platforms/parrot/ardrone" +package ardrone // import "gobot.io/x/gobot/v2/platforms/parrot/ardrone" diff --git a/platforms/parrot/ardrone/pitch_test.go b/platforms/parrot/ardrone/pitch_test.go index 5b1866e3..97e3ac9a 100644 --- a/platforms/parrot/ardrone/pitch_test.go +++ b/platforms/parrot/ardrone/pitch_test.go @@ -3,7 +3,7 @@ package ardrone import ( "testing" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2/gobottest" ) func TestArdroneValidatePitchWhenEqualOffset(t *testing.T) { diff --git a/platforms/parrot/bebop/README.md b/platforms/parrot/bebop/README.md index ea96ed5c..51d60cf8 100644 --- a/platforms/parrot/bebop/README.md +++ b/platforms/parrot/bebop/README.md @@ -4,7 +4,7 @@ The Parrot Bebop and Parrot Bebop 2 are inexpensive quadcopters that can be cont ## How to Install ``` -go get -d -u gobot.io/x/gobot/... +go get -d -u gobot.io/x/gobot/v2/... ``` ## How to Use @@ -14,8 +14,8 @@ package main import ( "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/parrot/bebop" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/parrot/bebop" ) func main() { diff --git a/platforms/parrot/bebop/bebop_adaptor.go b/platforms/parrot/bebop/bebop_adaptor.go index b2608f04..23716e1c 100644 --- a/platforms/parrot/bebop/bebop_adaptor.go +++ b/platforms/parrot/bebop/bebop_adaptor.go @@ -1,8 +1,8 @@ package bebop import ( - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/parrot/bebop/client" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/parrot/bebop/client" ) // drone defines expected drone behaviour diff --git a/platforms/parrot/bebop/bebop_adaptor_test.go b/platforms/parrot/bebop/bebop_adaptor_test.go index ac0aee79..65d818bb 100644 --- a/platforms/parrot/bebop/bebop_adaptor_test.go +++ b/platforms/parrot/bebop/bebop_adaptor_test.go @@ -5,8 +5,8 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) var _ gobot.Adaptor = (*Adaptor)(nil) diff --git a/platforms/parrot/bebop/bebop_driver.go b/platforms/parrot/bebop/bebop_driver.go index b89e4332..43d68512 100644 --- a/platforms/parrot/bebop/bebop_driver.go +++ b/platforms/parrot/bebop/bebop_driver.go @@ -1,7 +1,7 @@ package bebop import ( - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" ) const ( diff --git a/platforms/parrot/bebop/bebop_driver_test.go b/platforms/parrot/bebop/bebop_driver_test.go index 48cb8edb..0565114b 100644 --- a/platforms/parrot/bebop/bebop_driver_test.go +++ b/platforms/parrot/bebop/bebop_driver_test.go @@ -4,8 +4,8 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) var _ gobot.Driver = (*Driver)(nil) diff --git a/platforms/parrot/bebop/client/examples/takeoff.go b/platforms/parrot/bebop/client/examples/takeoff.go index 0176aed6..605b2ca3 100644 --- a/platforms/parrot/bebop/client/examples/takeoff.go +++ b/platforms/parrot/bebop/client/examples/takeoff.go @@ -1,4 +1,6 @@ +//go:build example // +build example + // // Do not build by default. @@ -8,7 +10,7 @@ import ( "fmt" "time" - "gobot.io/x/gobot/platforms/parrot/bebop/client" + "gobot.io/x/gobot/v2/platforms/parrot/bebop/client" ) func main() { diff --git a/platforms/parrot/bebop/client/examples/video.go b/platforms/parrot/bebop/client/examples/video.go index 28bf56fa..f9d0934a 100644 --- a/platforms/parrot/bebop/client/examples/video.go +++ b/platforms/parrot/bebop/client/examples/video.go @@ -1,21 +1,25 @@ +//go:build example // +build example + // // Do not build by default. /* - This example will connect to the Bebop and stream its video to a webpage - via ffserver. This requires you to have both ffmpeg and ffserver installed - on your computer. +This example will connect to the Bebop and stream its video to a webpage +via ffserver. This requires you to have both ffmpeg and ffserver installed +on your computer. - In order to run this example you will first need to start ffserver with: - $ ffserver -f ff.conf +In order to run this example you will first need to start ffserver with: - then in a separate terminal run this program: - $ go run video.go + $ ffserver -f ff.conf - You will then be able to view the video feed by navigation to - http://localhost:8090/bebop.mjpeg in a web browser. *NOTE* firefox works - best for viewing the video feed. +then in a separate terminal run this program: + + $ go run video.go + +You will then be able to view the video feed by navigation to +http://localhost:8090/bebop.mjpeg in a web browser. *NOTE* firefox works +best for viewing the video feed. */ package main @@ -25,7 +29,7 @@ import ( "os/exec" "time" - "gobot.io/x/gobot/platforms/parrot/bebop/client" + "gobot.io/x/gobot/v2/platforms/parrot/bebop/client" ) func main() { diff --git a/platforms/parrot/bebop/doc.go b/platforms/parrot/bebop/doc.go index 6bbdfecf..ada30303 100644 --- a/platforms/parrot/bebop/doc.go +++ b/platforms/parrot/bebop/doc.go @@ -3,9 +3,9 @@ Package bebop provides the Gobot adaptor and driver for the Parrot Bebop. Installing: - go get -d -u gobot.io/x/gobot/... && go install gobot.io/x/gobot/platforms/parrot/bebop + go get -d -u gobot.io/x/gobot/v2/... && go install gobot.io/x/gobot/v2/platforms/parrot/bebop For more information refer to the bebop README: https://github.com/hybridgroup/gobot/tree/master/platforms/parrot/bebop/README.md */ -package bebop // import "gobot.io/x/gobot/platforms/parrot/bebop" +package bebop // import "gobot.io/x/gobot/v2/platforms/parrot/bebop" diff --git a/platforms/parrot/bebop/pitch_test.go b/platforms/parrot/bebop/pitch_test.go index 83148f95..62dc1398 100644 --- a/platforms/parrot/bebop/pitch_test.go +++ b/platforms/parrot/bebop/pitch_test.go @@ -3,7 +3,7 @@ package bebop import ( "testing" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2/gobottest" ) func TestBebopValidatePitchWhenEqualOffset(t *testing.T) { diff --git a/platforms/parrot/minidrone/README.md b/platforms/parrot/minidrone/README.md index 980f0dbe..db415181 100644 --- a/platforms/parrot/minidrone/README.md +++ b/platforms/parrot/minidrone/README.md @@ -24,7 +24,7 @@ Models that will require additional work for compatibility: ## How to Install ``` -go get -d -u gobot.io/x/gobot/... +go get -d -u gobot.io/x/gobot/v2/... ``` ## How to Use @@ -37,9 +37,9 @@ import ( "os" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/ble" - "gobot.io/x/gobot/platforms/parrot/minidrone" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/ble" + "gobot.io/x/gobot/v2/platforms/parrot/minidrone" ) func main() { diff --git a/platforms/parrot/minidrone/doc.go b/platforms/parrot/minidrone/doc.go index 8e9ec2cd..bc5524ae 100644 --- a/platforms/parrot/minidrone/doc.go +++ b/platforms/parrot/minidrone/doc.go @@ -4,4 +4,4 @@ Package minidrone contains the Gobot driver for the Parrot Minidrone. For more information refer to the minidrone README: https://github.com/hybridgroup/gobot/blob/master/platforms/parrot/minidrone/README.md */ -package minidrone // import "gobot.io/x/gobot/platforms/parrot/minidrone" +package minidrone // import "gobot.io/x/gobot/v2/platforms/parrot/minidrone" diff --git a/platforms/parrot/minidrone/helpers_test.go b/platforms/parrot/minidrone/helpers_test.go index c2c719de..1f860b4e 100644 --- a/platforms/parrot/minidrone/helpers_test.go +++ b/platforms/parrot/minidrone/helpers_test.go @@ -3,7 +3,7 @@ package minidrone import ( "sync" - "gobot.io/x/gobot/platforms/ble" + "gobot.io/x/gobot/v2/platforms/ble" ) var _ ble.BLEConnector = (*bleTestClientAdaptor)(nil) diff --git a/platforms/parrot/minidrone/minidrone_driver.go b/platforms/parrot/minidrone/minidrone_driver.go index a939b179..812be61b 100644 --- a/platforms/parrot/minidrone/minidrone_driver.go +++ b/platforms/parrot/minidrone/minidrone_driver.go @@ -7,8 +7,8 @@ import ( "sync" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/ble" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/ble" ) // Driver is the Gobot interface to the Parrot Minidrone @@ -396,11 +396,11 @@ func (b *Driver) LeftFlip() (err error) { // LightControl controls lights on those Minidrone models which // have the correct hardware, such as the Maclane, Blaze, & Swat. // Params: -// id - always 0 -// mode - either LightFixed, LightBlinked, or LightOscillated -// intensity - Light intensity from 0 (OFF) to 100 (Max intensity). -// Only used in LightFixed mode. // +// id - always 0 +// mode - either LightFixed, LightBlinked, or LightOscillated +// intensity - Light intensity from 0 (OFF) to 100 (Max intensity). +// Only used in LightFixed mode. func (b *Driver) LightControl(id uint8, mode uint8, intensity uint8) (err error) { b.stepsfa0b++ buf := []byte{0x02, byte(b.stepsfa0b) & 0xff, 0x02, 0x10, 0x00, id, mode, intensity, 0x00} @@ -410,9 +410,9 @@ func (b *Driver) LightControl(id uint8, mode uint8, intensity uint8) (err error) // ClawControl controls the claw on the Parrot Mambo // Params: -// id - always 0 -// mode - either ClawOpen or ClawClosed // +// id - always 0 +// mode - either ClawOpen or ClawClosed func (b *Driver) ClawControl(id uint8, mode uint8) (err error) { b.stepsfa0b++ buf := []byte{0x02, byte(b.stepsfa0b) & 0xff, 0x02, 0x10, 0x01, id, mode, 0x00} @@ -422,8 +422,8 @@ func (b *Driver) ClawControl(id uint8, mode uint8) (err error) { // GunControl fires the gun on the Parrot Mambo // Params: -// id - always 0 // +// id - always 0 func (b *Driver) GunControl(id uint8) (err error) { b.stepsfa0b++ buf := []byte{0x02, byte(b.stepsfa0b) & 0xff, 0x02, 0x10, 0x02, id, 0x00} diff --git a/platforms/parrot/minidrone/minidrone_driver_test.go b/platforms/parrot/minidrone/minidrone_driver_test.go index 16b56a5b..d57a65ae 100644 --- a/platforms/parrot/minidrone/minidrone_driver_test.go +++ b/platforms/parrot/minidrone/minidrone_driver_test.go @@ -4,8 +4,8 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) var _ gobot.Driver = (*Driver)(nil) diff --git a/platforms/parrot/minidrone/pitch_test.go b/platforms/parrot/minidrone/pitch_test.go index 63327f9e..8b026171 100644 --- a/platforms/parrot/minidrone/pitch_test.go +++ b/platforms/parrot/minidrone/pitch_test.go @@ -3,7 +3,7 @@ package minidrone import ( "testing" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2/gobottest" ) func TestMinidroneValidatePitchWhenEqualOffset(t *testing.T) { diff --git a/platforms/parrot/parrot.go b/platforms/parrot/parrot.go index bdf2d0cb..11ba96ec 100644 --- a/platforms/parrot/parrot.go +++ b/platforms/parrot/parrot.go @@ -6,6 +6,6 @@ This package currently supports the following Parrot drones: - Intel Joule developer kit For further information refer to Parrot README: -https://gobot.io/x/gobot/blob/master/platforms/parrot/README.md +https://gobot.io/x/gobot/v2/blob/master/platforms/parrot/README.md */ package parrot diff --git a/platforms/particle/README.md b/platforms/particle/README.md index 5ba51fd5..f82ef4ab 100644 --- a/platforms/particle/README.md +++ b/platforms/particle/README.md @@ -9,7 +9,7 @@ For more info about the Particle platform go to https://www.particle.io/ Installing Gobot with Particle support is pretty easy. ``` -go get -d -u gobot.io/x/gobot/... +go get -d -u gobot.io/x/gobot/v2/... ``` ## How to Use @@ -20,9 +20,9 @@ package main import ( "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/particle" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/particle" ) func main() { diff --git a/platforms/particle/adaptor.go b/platforms/particle/adaptor.go index 3dbf81a0..a291efca 100644 --- a/platforms/particle/adaptor.go +++ b/platforms/particle/adaptor.go @@ -10,7 +10,7 @@ import ( "strconv" "github.com/donovanhide/eventsource" - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" ) // Adaptor is the Gobot Adaptor for Particle diff --git a/platforms/particle/adaptor_test.go b/platforms/particle/adaptor_test.go index bae692d8..b467606b 100644 --- a/platforms/particle/adaptor_test.go +++ b/platforms/particle/adaptor_test.go @@ -9,8 +9,8 @@ import ( "testing" "github.com/donovanhide/eventsource" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) // HELPERS diff --git a/platforms/particle/doc.go b/platforms/particle/doc.go index 2fcbf382..fd6dc2fd 100644 --- a/platforms/particle/doc.go +++ b/platforms/particle/doc.go @@ -3,7 +3,7 @@ Package particle provides the Gobot adaptor for the Particle Photon and Electron Installing: - go get gobot.io/x/gobot && go install gobot.io/x/gobot/platforms/particle + go get gobot.io/x/gobot/v2 && go install gobot.io/x/gobot/v2/platforms/particle Example: @@ -12,9 +12,9 @@ Example: import ( "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/particle" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/particle" ) func main() { @@ -39,4 +39,4 @@ Example: For further information refer to Particle readme: https://github.com/hybridgroup/gobot/blob/master/platforms/particle/README.md */ -package particle // import "gobot.io/x/gobot/platforms/particle" +package particle // import "gobot.io/x/gobot/v2/platforms/particle" diff --git a/platforms/pebble/README.md b/platforms/pebble/README.md index 4313c983..d5889713 100644 --- a/platforms/pebble/README.md +++ b/platforms/pebble/README.md @@ -7,7 +7,7 @@ It uses the Pebble 2.0 SDK, and requires the 2.0 iOS or Android app, and that th ## How to Install ``` -go get -d -u gobot.io/x/gobot/... +go get -d -u gobot.io/x/gobot/v2/... ``` * Install Pebble 2.0 iOS or Android app. (If you haven't already) @@ -23,9 +23,9 @@ package main import ( "fmt" - "gobot.io/x/gobot" - "gobot.io/x/gobot/api" - "gobot.io/x/gobot/platforms/pebble" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/api" + "gobot.io/x/gobot/v2/platforms/pebble" ) func main() { diff --git a/platforms/pebble/doc.go b/platforms/pebble/doc.go index 1e05b3de..784f9ef5 100644 --- a/platforms/pebble/doc.go +++ b/platforms/pebble/doc.go @@ -6,7 +6,7 @@ Installing: It requires the 2.x iOS or Android app, and "watchbot" app (https://gobot.io/x/watchbot) installed on Pebble watch. Then install running: - go get gobot.io/x/gobot/platforms/pebble + go get gobot.io/x/gobot/v2/platforms/pebble Example: @@ -17,9 +17,9 @@ Before running the example, make sure configuration settings match with your pro import ( "fmt" - "gobot.io/x/gobot" - "gobot.io/x/gobot/api" - "gobot.io/x/gobot/platforms/pebble" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/api" + "gobot.io/x/gobot/v2/platforms/pebble" ) func main() { @@ -54,4 +54,4 @@ Before running the example, make sure configuration settings match with your pro For more information refer to the pebble README: https://github.com/hybridgroup/gobot/blob/master/platforms/pebble/README.md */ -package pebble // import "gobot.io/x/gobot/platforms/pebble" +package pebble // import "gobot.io/x/gobot/v2/platforms/pebble" diff --git a/platforms/pebble/pebble_adaptor_test.go b/platforms/pebble/pebble_adaptor_test.go index e42cf824..2ae333ab 100644 --- a/platforms/pebble/pebble_adaptor_test.go +++ b/platforms/pebble/pebble_adaptor_test.go @@ -3,8 +3,8 @@ package pebble import ( "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) var _ gobot.Adaptor = (*Adaptor)(nil) diff --git a/platforms/pebble/pebble_driver.go b/platforms/pebble/pebble_driver.go index 658872e0..406a9511 100644 --- a/platforms/pebble/pebble_driver.go +++ b/platforms/pebble/pebble_driver.go @@ -1,7 +1,7 @@ package pebble import ( - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" ) type Driver struct { @@ -14,13 +14,16 @@ type Driver struct { // NewDriver creates a new pebble driver // Adds following events: -// button - Sent when a pebble button is pressed -// accel - Pebble watch acceleromenter data -// tab - When a pebble watch tap event is detected +// +// button - Sent when a pebble button is pressed +// accel - Pebble watch acceleromenter data +// tab - When a pebble watch tap event is detected +// // And the following API commands: -// "publish_event" -// "send_notification" -// "pending_message" +// +// "publish_event" +// "send_notification" +// "pending_message" func NewDriver(adaptor *Adaptor) *Driver { p := &Driver{ name: "Pebble", diff --git a/platforms/pebble/pebble_driver_test.go b/platforms/pebble/pebble_driver_test.go index abef18ef..40023fd9 100644 --- a/platforms/pebble/pebble_driver_test.go +++ b/platforms/pebble/pebble_driver_test.go @@ -4,8 +4,8 @@ import ( "testing" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) var _ gobot.Driver = (*Driver)(nil) diff --git a/platforms/raspi/README.md b/platforms/raspi/README.md index cece9865..3b1a89e6 100644 --- a/platforms/raspi/README.md +++ b/platforms/raspi/README.md @@ -13,7 +13,7 @@ We recommend updating to the latest Raspian Jessie OS when using the Raspberry P 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 Raspberry Pi, and run the program on the Raspberry Pi as documented here. ``` -go get -d -u gobot.io/x/gobot/... +go get -d -u gobot.io/x/gobot/v2/... ``` ## How to Use @@ -26,9 +26,9 @@ package main import ( "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/raspi" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/raspi" ) func main() { diff --git a/platforms/raspi/doc.go b/platforms/raspi/doc.go index 677c33f4..9c46a7fa 100644 --- a/platforms/raspi/doc.go +++ b/platforms/raspi/doc.go @@ -4,4 +4,4 @@ Package raspi contains the Gobot adaptor for the Raspberry Pi. For further information refer to raspi README: https://github.com/hybridgroup/gobot/blob/master/platforms/raspi/README.md */ -package raspi // import "gobot.io/x/gobot/platforms/raspi" +package raspi // import "gobot.io/x/gobot/v2/platforms/raspi" diff --git a/platforms/raspi/pwm_pin.go b/platforms/raspi/pwm_pin.go index bb27d15f..366ca698 100644 --- a/platforms/raspi/pwm_pin.go +++ b/platforms/raspi/pwm_pin.go @@ -5,8 +5,8 @@ import ( "fmt" "os" - "gobot.io/x/gobot" - "gobot.io/x/gobot/system" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/system" ) // PWMPin is the Raspberry Pi implementation of the PWMPinner interface. diff --git a/platforms/raspi/pwm_pin_test.go b/platforms/raspi/pwm_pin_test.go index a3c7d686..df0cc2f6 100644 --- a/platforms/raspi/pwm_pin_test.go +++ b/platforms/raspi/pwm_pin_test.go @@ -4,9 +4,9 @@ import ( "errors" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" - "gobot.io/x/gobot/system" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" + "gobot.io/x/gobot/v2/system" ) var _ gobot.PWMPinner = (*PWMPin)(nil) diff --git a/platforms/raspi/raspi_adaptor.go b/platforms/raspi/raspi_adaptor.go index 9ab60c8e..839f5409 100644 --- a/platforms/raspi/raspi_adaptor.go +++ b/platforms/raspi/raspi_adaptor.go @@ -9,9 +9,9 @@ import ( "sync" multierror "github.com/hashicorp/go-multierror" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/adaptors" - "gobot.io/x/gobot/system" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/adaptors" + "gobot.io/x/gobot/v2/system" ) const ( @@ -41,13 +41,14 @@ type Adaptor struct { // NewAdaptor creates a Raspi Adaptor // // Optional parameters: -// adaptors.WithGpiodAccess(): use character device gpiod driver instead of sysfs (still used by default) -// adaptors.WithSpiGpioAccess(sclk, nss, mosi, miso): use GPIO's instead of /dev/spidev#.# -// adaptors.WithGpiosActiveLow(pin's): invert the pin behavior -// adaptors.WithGpiosPullUp/Down(pin's): sets the internal pull resistor -// adaptors.WithGpiosOpenDrain/Source(pin's): sets the output behavior -// adaptors.WithGpioDebounce(pin, period): sets the input debouncer -// adaptors.WithGpioEventOnFallingEdge/RaisingEdge/BothEdges(pin, handler): activate edge detection +// +// adaptors.WithGpiodAccess(): use character device gpiod driver instead of sysfs (still used by default) +// adaptors.WithSpiGpioAccess(sclk, nss, mosi, miso): use GPIO's instead of /dev/spidev#.# +// adaptors.WithGpiosActiveLow(pin's): invert the pin behavior +// adaptors.WithGpiosPullUp/Down(pin's): sets the internal pull resistor +// adaptors.WithGpiosOpenDrain/Source(pin's): sets the output behavior +// adaptors.WithGpioDebounce(pin, period): sets the input debouncer +// adaptors.WithGpioEventOnFallingEdge/RaisingEdge/BothEdges(pin, handler): activate edge detection func NewAdaptor(opts ...func(adaptors.Optioner)) *Adaptor { sys := system.NewAccesser(system.WithDigitalPinGpiodAccess()) c := &Adaptor{ diff --git a/platforms/raspi/raspi_adaptor_test.go b/platforms/raspi/raspi_adaptor_test.go index 93f1199c..28e71c9b 100644 --- a/platforms/raspi/raspi_adaptor_test.go +++ b/platforms/raspi/raspi_adaptor_test.go @@ -10,12 +10,12 @@ import ( "strconv" "sync" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/drivers/spi" - "gobot.io/x/gobot/gobottest" - "gobot.io/x/gobot/system" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/drivers/spi" + "gobot.io/x/gobot/v2/gobottest" + "gobot.io/x/gobot/v2/system" ) // make sure that this Adaptor fulfills all the required interfaces diff --git a/platforms/rockpi/README.md b/platforms/rockpi/README.md index e2d7f7fa..42af4210 100644 --- a/platforms/rockpi/README.md +++ b/platforms/rockpi/README.md @@ -31,9 +31,9 @@ package main import ( "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/platforms/rockpi" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/platforms/rockpi" ) func main() { diff --git a/platforms/rockpi/doc.go b/platforms/rockpi/doc.go index 92525814..10a589cd 100644 --- a/platforms/rockpi/doc.go +++ b/platforms/rockpi/doc.go @@ -4,4 +4,4 @@ Package rockpi contains the Gobot adaptor for Radxa's Rock Pi Single Board Compu For further information refer to rockpi README: https://github.com/hybridgroup/gobot/blob/master/platforms/rockpi/README.md */ -package rockpi // import "gobot.io/x/gobot/platforms/rockpi" +package rockpi // import "gobot.io/x/gobot/v2/platforms/rockpi" diff --git a/platforms/rockpi/rockpi_adaptor.go b/platforms/rockpi/rockpi_adaptor.go index 8c7b7449..ae280030 100644 --- a/platforms/rockpi/rockpi_adaptor.go +++ b/platforms/rockpi/rockpi_adaptor.go @@ -6,9 +6,9 @@ import ( "sync" multierror "github.com/hashicorp/go-multierror" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/adaptors" - "gobot.io/x/gobot/system" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/adaptors" + "gobot.io/x/gobot/v2/system" ) const ( diff --git a/platforms/rockpi/rockpi_adaptor_test.go b/platforms/rockpi/rockpi_adaptor_test.go index 9e045374..7ce572ab 100644 --- a/platforms/rockpi/rockpi_adaptor_test.go +++ b/platforms/rockpi/rockpi_adaptor_test.go @@ -2,9 +2,10 @@ package rockpi import ( "fmt" - "gobot.io/x/gobot/gobottest" - "gobot.io/x/gobot/system" "testing" + + "gobot.io/x/gobot/v2/gobottest" + "gobot.io/x/gobot/v2/system" ) func initTestAdaptorWithMockedFilesystem(mockPaths []string) (*Adaptor, *system.MockFilesystem) { diff --git a/platforms/sphero/README.md b/platforms/sphero/README.md index cde03205..f46c9740 100644 --- a/platforms/sphero/README.md +++ b/platforms/sphero/README.md @@ -8,7 +8,7 @@ Learn more about the Sphero robot go here: http://www.gosphero.com/ ## How to Install ``` -go get -d -u gobot.io/x/gobot/... +go get -d -u gobot.io/x/gobot/v2/... ``` ## How To Connect @@ -53,8 +53,8 @@ import ( "fmt" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/sphero" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/sphero" ) func main() { diff --git a/platforms/sphero/bb8/README.md b/platforms/sphero/bb8/README.md index 62049a97..3ddc0ed3 100644 --- a/platforms/sphero/bb8/README.md +++ b/platforms/sphero/bb8/README.md @@ -5,7 +5,7 @@ The Sphero BB-8 is a toy robot from Sphero that is controlled using Bluetooth LE ## How to Install ``` -go get -d -u gobot.io/x/gobot/... +go get -d -u gobot.io/x/gobot/v2/... ``` ## How to Use @@ -17,9 +17,9 @@ import ( "os" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/ble" - "gobot.io/x/gobot/platforms/sphero/bb8" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/ble" + "gobot.io/x/gobot/v2/platforms/sphero/bb8" ) func main() { diff --git a/platforms/sphero/bb8/bb8_driver.go b/platforms/sphero/bb8/bb8_driver.go index 09ead69c..8e411583 100644 --- a/platforms/sphero/bb8/bb8_driver.go +++ b/platforms/sphero/bb8/bb8_driver.go @@ -1,9 +1,9 @@ package bb8 import ( - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/ble" - "gobot.io/x/gobot/platforms/sphero/ollie" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/ble" + "gobot.io/x/gobot/v2/platforms/sphero/ollie" ) // Driver represents a Sphero BB-8 diff --git a/platforms/sphero/bb8/bb8_driver_test.go b/platforms/sphero/bb8/bb8_driver_test.go index 50aed039..a56ed515 100644 --- a/platforms/sphero/bb8/bb8_driver_test.go +++ b/platforms/sphero/bb8/bb8_driver_test.go @@ -4,8 +4,8 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) var _ gobot.Driver = (*BB8Driver)(nil) diff --git a/platforms/sphero/bb8/bb8_packets.go b/platforms/sphero/bb8/bb8_packets.go index 0dac0624..d28d4d85 100644 --- a/platforms/sphero/bb8/bb8_packets.go +++ b/platforms/sphero/bb8/bb8_packets.go @@ -1,6 +1,6 @@ package bb8 -import "gobot.io/x/gobot/platforms/sphero" +import "gobot.io/x/gobot/v2/platforms/sphero" // DefaultCollisionConfig returns a CollisionConfig with sensible collision defaults func DefaultCollisionConfig() sphero.CollisionConfig { diff --git a/platforms/sphero/bb8/doc.go b/platforms/sphero/bb8/doc.go index 2fb47626..80aca8fe 100644 --- a/platforms/sphero/bb8/doc.go +++ b/platforms/sphero/bb8/doc.go @@ -4,4 +4,4 @@ Package bb8 contains the Gobot driver for the Sphero BB-8. For more information refer to the BB-8 README: https://github.com/hybridgroup/gobot/blob/master/platforms/sphero/bb8/README.md */ -package bb8 // import "gobot.io/x/gobot/platforms/sphero/bb8" +package bb8 // import "gobot.io/x/gobot/v2/platforms/sphero/bb8" diff --git a/platforms/sphero/bb8/helpers_test.go b/platforms/sphero/bb8/helpers_test.go index 07380dcf..da6f5824 100644 --- a/platforms/sphero/bb8/helpers_test.go +++ b/platforms/sphero/bb8/helpers_test.go @@ -3,7 +3,7 @@ package bb8 import ( "sync" - "gobot.io/x/gobot/platforms/ble" + "gobot.io/x/gobot/v2/platforms/ble" ) var _ ble.BLEConnector = (*bleTestClientAdaptor)(nil) diff --git a/platforms/sphero/doc.go b/platforms/sphero/doc.go index 3f9e7f5d..e9d2d1b7 100644 --- a/platforms/sphero/doc.go +++ b/platforms/sphero/doc.go @@ -3,7 +3,7 @@ Package sphero provides the Gobot adaptor and driver for the Sphero. Installing: - go get gobot.io/x/gobot/platforms/sphero + go get gobot.io/x/gobot/v2/platforms/sphero Example: @@ -13,8 +13,8 @@ Example: "fmt" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/sphero" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/sphero" ) func main() { @@ -39,4 +39,4 @@ Example: For further information refer to sphero readme: https://github.com/hybridgroup/gobot/blob/master/platforms/sphero/README.md */ -package sphero // import "gobot.io/x/gobot/platforms/sphero" +package sphero // import "gobot.io/x/gobot/v2/platforms/sphero" diff --git a/platforms/sphero/ollie/README.md b/platforms/sphero/ollie/README.md index 50cc1013..57eea66c 100644 --- a/platforms/sphero/ollie/README.md +++ b/platforms/sphero/ollie/README.md @@ -5,7 +5,7 @@ The Sphero Ollie is a toy robot from Sphero that is controlled using Bluetooth L ## How to Install ``` -go get -d -u gobot.io/x/gobot/... +go get -d -u gobot.io/x/gobot/v2/... ``` ## How to Use @@ -17,9 +17,9 @@ import ( "os" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/ble" - "gobot.io/x/gobot/platforms/sphero/ollie" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/ble" + "gobot.io/x/gobot/v2/platforms/sphero/ollie" ) func main() { diff --git a/platforms/sphero/ollie/doc.go b/platforms/sphero/ollie/doc.go index 15b406e4..e848ccba 100644 --- a/platforms/sphero/ollie/doc.go +++ b/platforms/sphero/ollie/doc.go @@ -4,4 +4,4 @@ Package ollie contains the Gobot driver for the Sphero Ollie. For more information refer to the Ollie README: https://github.com/hybridgroup/gobot/blob/master/platforms/sphero/ollie/README.md */ -package ollie // import "gobot.io/x/gobot/platforms/sphero/ollie" +package ollie // import "gobot.io/x/gobot/v2/platforms/sphero/ollie" diff --git a/platforms/sphero/ollie/helpers_test.go b/platforms/sphero/ollie/helpers_test.go index 244d1312..e78091a0 100644 --- a/platforms/sphero/ollie/helpers_test.go +++ b/platforms/sphero/ollie/helpers_test.go @@ -3,7 +3,7 @@ package ollie import ( "sync" - "gobot.io/x/gobot/platforms/ble" + "gobot.io/x/gobot/v2/platforms/ble" ) var _ ble.BLEConnector = (*bleTestClientAdaptor)(nil) diff --git a/platforms/sphero/ollie/ollie_driver.go b/platforms/sphero/ollie/ollie_driver.go index 307c9475..e8c406d9 100644 --- a/platforms/sphero/ollie/ollie_driver.go +++ b/platforms/sphero/ollie/ollie_driver.go @@ -7,9 +7,9 @@ import ( "sync" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/ble" - "gobot.io/x/gobot/platforms/sphero" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/ble" + "gobot.io/x/gobot/v2/platforms/sphero" ) // Driver is the Gobot driver for the Sphero Ollie robot @@ -343,7 +343,7 @@ func (b *Driver) ConfigureCollisionDetection(cc sphero.CollisionConfig) { b.packetChannel <- b.craftPacket([]uint8{cc.Method, cc.Xt, cc.Yt, cc.Xs, cc.Ys, cc.Dead}, 0x02, 0x12) } -//SetDataStreamingConfig passes the config to the sphero to stream sensor data +// SetDataStreamingConfig passes the config to the sphero to stream sensor data func (b *Driver) SetDataStreamingConfig(d sphero.DataStreamingConfig) { buf := new(bytes.Buffer) binary.Write(buf, binary.BigEndian, d) diff --git a/platforms/sphero/ollie/ollie_driver_test.go b/platforms/sphero/ollie/ollie_driver_test.go index b1ec7048..de020a7a 100644 --- a/platforms/sphero/ollie/ollie_driver_test.go +++ b/platforms/sphero/ollie/ollie_driver_test.go @@ -7,9 +7,9 @@ import ( "testing" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" - "gobot.io/x/gobot/platforms/sphero" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" + "gobot.io/x/gobot/v2/platforms/sphero" ) var _ gobot.Driver = (*Driver)(nil) diff --git a/platforms/sphero/ollie/ollie_packets.go b/platforms/sphero/ollie/ollie_packets.go index 74169cde..06c43e34 100644 --- a/platforms/sphero/ollie/ollie_packets.go +++ b/platforms/sphero/ollie/ollie_packets.go @@ -1,6 +1,6 @@ package ollie -import "gobot.io/x/gobot/platforms/sphero" +import "gobot.io/x/gobot/v2/platforms/sphero" // DefaultCollisionConfig returns a CollisionConfig with sensible collision defaults func DefaultCollisionConfig() sphero.CollisionConfig { diff --git a/platforms/sphero/sphero_adaptor.go b/platforms/sphero/sphero_adaptor.go index f0ca7563..51dc380f 100644 --- a/platforms/sphero/sphero_adaptor.go +++ b/platforms/sphero/sphero_adaptor.go @@ -3,7 +3,7 @@ package sphero import ( "io" - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" "go.bug.st/serial" ) diff --git a/platforms/sphero/sphero_adaptor_test.go b/platforms/sphero/sphero_adaptor_test.go index 5172d0e0..56a1b01c 100644 --- a/platforms/sphero/sphero_adaptor_test.go +++ b/platforms/sphero/sphero_adaptor_test.go @@ -6,8 +6,8 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) var _ gobot.Adaptor = (*Adaptor)(nil) diff --git a/platforms/sphero/sphero_driver.go b/platforms/sphero/sphero_driver.go index dc5e9baf..fb2bc270 100644 --- a/platforms/sphero/sphero_driver.go +++ b/platforms/sphero/sphero_driver.go @@ -7,7 +7,7 @@ import ( "sync" "time" - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" ) const ( @@ -44,16 +44,17 @@ type SpheroDriver struct { // NewSpheroDriver returns a new SpheroDriver given a Sphero Adaptor. // // Adds the following API Commands: -// "ConfigureLocator" - See SpheroDriver.ConfigureLocator -// "Roll" - See SpheroDriver.Roll -// "Stop" - See SpheroDriver.Stop -// "GetRGB" - See SpheroDriver.GetRGB -// "ReadLocator" - See SpheroDriver.ReadLocator -// "SetBackLED" - See SpheroDriver.SetBackLED -// "SetHeading" - See SpheroDriver.SetHeading -// "SetStabilization" - See SpheroDriver.SetStabilization -// "SetDataStreaming" - See SpheroDriver.SetDataStreaming -// "SetRotationRate" - See SpheroDriver.SetRotationRate +// +// "ConfigureLocator" - See SpheroDriver.ConfigureLocator +// "Roll" - See SpheroDriver.Roll +// "Stop" - See SpheroDriver.Stop +// "GetRGB" - See SpheroDriver.GetRGB +// "ReadLocator" - See SpheroDriver.ReadLocator +// "SetBackLED" - See SpheroDriver.SetBackLED +// "SetHeading" - See SpheroDriver.SetHeading +// "SetStabilization" - See SpheroDriver.SetStabilization +// "SetDataStreaming" - See SpheroDriver.SetDataStreaming +// "SetRotationRate" - See SpheroDriver.SetRotationRate func NewSpheroDriver(a *Adaptor) *SpheroDriver { s := &SpheroDriver{ name: gobot.DefaultName("Sphero"), @@ -161,9 +162,10 @@ func (s *SpheroDriver) adaptor() *Adaptor { // Returns true on successful start. // // Emits the Events: -// Collision sphero.CollisionPacket - On Collision Detected -// SensorData sphero.DataStreamingPacket - On Data Streaming event -// Error error- On error while processing asynchronous response +// +// Collision sphero.CollisionPacket - On Collision Detected +// SensorData sphero.DataStreamingPacket - On Data Streaming event +// Error error- On error while processing asynchronous response func (s *SpheroDriver) Start() (err error) { go func() { for { diff --git a/platforms/sphero/sphero_driver_test.go b/platforms/sphero/sphero_driver_test.go index 901ec754..f115afa4 100644 --- a/platforms/sphero/sphero_driver_test.go +++ b/platforms/sphero/sphero_driver_test.go @@ -6,8 +6,8 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) var _ gobot.Driver = (*SpheroDriver)(nil) diff --git a/platforms/sphero/sprkplus/README.md b/platforms/sphero/sprkplus/README.md index 302771b8..7a00ccc0 100644 --- a/platforms/sphero/sprkplus/README.md +++ b/platforms/sphero/sprkplus/README.md @@ -5,7 +5,7 @@ The Sphero SPRK+ is a toy robot from Sphero that is controlled using Bluetooth L ## How to Install ``` -go get -d -u gobot.io/x/gobot/... +go get -d -u gobot.io/x/gobot/v2/... ``` ## How to Use @@ -17,9 +17,9 @@ import ( "os" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/ble" - "gobot.io/x/gobot/platforms/sphero/sprkplus" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/ble" + "gobot.io/x/gobot/v2/platforms/sphero/sprkplus" ) func main() { diff --git a/platforms/sphero/sprkplus/doc.go b/platforms/sphero/sprkplus/doc.go index 7e7a0e56..93ed883d 100644 --- a/platforms/sphero/sprkplus/doc.go +++ b/platforms/sphero/sprkplus/doc.go @@ -4,4 +4,4 @@ Package sprkplus contains the Gobot driver for the Sphero SPRK+. For more information refer to the sprkplus README: https://github.com/hybridgroup/gobot/blob/master/platforms/sphero/sprkplus/README.md */ -package sprkplus // import "gobot.io/x/gobot/platforms/sphero/sprkplus" +package sprkplus // import "gobot.io/x/gobot/v2/platforms/sphero/sprkplus" diff --git a/platforms/sphero/sprkplus/helpers_test.go b/platforms/sphero/sprkplus/helpers_test.go index 33bd19cc..af6455f8 100644 --- a/platforms/sphero/sprkplus/helpers_test.go +++ b/platforms/sphero/sprkplus/helpers_test.go @@ -3,7 +3,7 @@ package sprkplus import ( "sync" - "gobot.io/x/gobot/platforms/ble" + "gobot.io/x/gobot/v2/platforms/ble" ) var _ ble.BLEConnector = (*bleTestClientAdaptor)(nil) diff --git a/platforms/sphero/sprkplus/sprkplus_driver.go b/platforms/sphero/sprkplus/sprkplus_driver.go index 8316e04b..3f30bb89 100644 --- a/platforms/sphero/sprkplus/sprkplus_driver.go +++ b/platforms/sphero/sprkplus/sprkplus_driver.go @@ -1,9 +1,9 @@ package sprkplus import ( - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/ble" - "gobot.io/x/gobot/platforms/sphero/ollie" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/ble" + "gobot.io/x/gobot/v2/platforms/sphero/ollie" ) // Driver represents a Sphero SPRK+ diff --git a/platforms/sphero/sprkplus/sprkplus_driver_test.go b/platforms/sphero/sprkplus/sprkplus_driver_test.go index b863c06e..6bb1ed2d 100644 --- a/platforms/sphero/sprkplus/sprkplus_driver_test.go +++ b/platforms/sphero/sprkplus/sprkplus_driver_test.go @@ -4,8 +4,8 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) var _ gobot.Driver = (*SPRKPlusDriver)(nil) diff --git a/platforms/sphero/sprkplus/sprkplus_packets.go b/platforms/sphero/sprkplus/sprkplus_packets.go index e5e1c3b7..7ffeb53a 100644 --- a/platforms/sphero/sprkplus/sprkplus_packets.go +++ b/platforms/sphero/sprkplus/sprkplus_packets.go @@ -1,6 +1,6 @@ package sprkplus -import "gobot.io/x/gobot/platforms/sphero" +import "gobot.io/x/gobot/v2/platforms/sphero" // DefaultCollisionConfig returns a CollisionConfig with sensible collision defaults func DefaultCollisionConfig() sphero.CollisionConfig { diff --git a/platforms/tinkerboard/README.md b/platforms/tinkerboard/README.md index 140568ec..8cb22310 100644 --- a/platforms/tinkerboard/README.md +++ b/platforms/tinkerboard/README.md @@ -19,7 +19,7 @@ You would normally install Go and Gobot on your workstation. Once installed, cro workstation, transfer the final executable to your Tinker Board, and run the program on the Tinker Board as documented here. ```sh -go get -d -u gobot.io/x/gobot/... +go get -d -u gobot.io/x/gobot/v2/... ``` ### System access and configuration basics diff --git a/platforms/tinkerboard/adaptor.go b/platforms/tinkerboard/adaptor.go index f05b6b1c..1a5e182f 100644 --- a/platforms/tinkerboard/adaptor.go +++ b/platforms/tinkerboard/adaptor.go @@ -5,9 +5,9 @@ import ( "sync" multierror "github.com/hashicorp/go-multierror" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/adaptors" - "gobot.io/x/gobot/system" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/adaptors" + "gobot.io/x/gobot/v2/system" ) const ( @@ -44,10 +44,12 @@ type Adaptor struct { // NewAdaptor creates a Tinkerboard Adaptor // // Optional parameters: -// adaptors.WithGpiodAccess(): use character device gpiod driver instead of sysfs (still used by default) -// adaptors.WithSpiGpioAccess(sclk, nss, mosi, miso): use GPIO's instead of /dev/spidev#.# -// adaptors.WithGpiosActiveLow(pin's): invert the pin behavior -// adaptors.WithGpiosPullUp/Down(pin's): sets the internal pull resistor +// +// adaptors.WithGpiodAccess(): use character device gpiod driver instead of sysfs (still used by default) +// adaptors.WithSpiGpioAccess(sclk, nss, mosi, miso): use GPIO's instead of /dev/spidev#.# +// adaptors.WithGpiosActiveLow(pin's): invert the pin behavior +// adaptors.WithGpiosPullUp/Down(pin's): sets the internal pull resistor +// // note from RK3288 datasheet: "The pull direction (pullup or pulldown) for all of GPIOs are software-programmable", but // the latter is not working for any pin (armbian 22.08.7) func NewAdaptor(opts ...func(adaptors.Optioner)) *Adaptor { diff --git a/platforms/tinkerboard/adaptor_test.go b/platforms/tinkerboard/adaptor_test.go index 0a131c4d..2bbb4ab0 100644 --- a/platforms/tinkerboard/adaptor_test.go +++ b/platforms/tinkerboard/adaptor_test.go @@ -5,11 +5,11 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/gobottest" - "gobot.io/x/gobot/system" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/gobottest" + "gobot.io/x/gobot/v2/system" ) const ( diff --git a/platforms/tinkerboard/doc.go b/platforms/tinkerboard/doc.go index 37303119..574fc490 100644 --- a/platforms/tinkerboard/doc.go +++ b/platforms/tinkerboard/doc.go @@ -4,4 +4,4 @@ Package tinkerboard contains the Gobot adaptor for the ASUS Tinker Board. For further information refer to tinkerboard README: https://github.com/hybridgroup/gobot/blob/master/platforms/tinkerboard/README.md */ -package tinkerboard // import "gobot.io/x/gobot/platforms/tinkerboard" +package tinkerboard // import "gobot.io/x/gobot/v2/platforms/tinkerboard" diff --git a/platforms/upboard/up2/README.md b/platforms/upboard/up2/README.md index 590dce00..72e28323 100644 --- a/platforms/upboard/up2/README.md +++ b/platforms/upboard/up2/README.md @@ -78,7 +78,7 @@ The current UP2 firmware is not able to scan for I2C devices using the `i2cdetec You would normally install Go and Gobot on your local workstation. Once installed, cross compile your program on your workstation, transfer the final executable to your UP2, and run the program on the UP2 as documented below. ``` -go get -d -u gobot.io/x/gobot/... +go get -d -u gobot.io/x/gobot/v2/... ``` ## How to Use diff --git a/platforms/upboard/up2/adaptor.go b/platforms/upboard/up2/adaptor.go index 59a00fd6..19478ab2 100644 --- a/platforms/upboard/up2/adaptor.go +++ b/platforms/upboard/up2/adaptor.go @@ -7,9 +7,9 @@ import ( "sync" multierror "github.com/hashicorp/go-multierror" - "gobot.io/x/gobot" - "gobot.io/x/gobot/platforms/adaptors" - "gobot.io/x/gobot/system" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/platforms/adaptors" + "gobot.io/x/gobot/v2/system" ) const ( diff --git a/platforms/upboard/up2/adaptor_test.go b/platforms/upboard/up2/adaptor_test.go index ab69dde4..ce93c8af 100644 --- a/platforms/upboard/up2/adaptor_test.go +++ b/platforms/upboard/up2/adaptor_test.go @@ -6,12 +6,12 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/drivers/gpio" - "gobot.io/x/gobot/drivers/i2c" - "gobot.io/x/gobot/drivers/spi" - "gobot.io/x/gobot/gobottest" - "gobot.io/x/gobot/system" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/drivers/gpio" + "gobot.io/x/gobot/v2/drivers/i2c" + "gobot.io/x/gobot/v2/drivers/spi" + "gobot.io/x/gobot/v2/gobottest" + "gobot.io/x/gobot/v2/system" ) // make sure that this Adaptor fulfills all the required interfaces diff --git a/platforms/upboard/up2/doc.go b/platforms/upboard/up2/doc.go index e15ce8b1..23852a04 100644 --- a/platforms/upboard/up2/doc.go +++ b/platforms/upboard/up2/doc.go @@ -4,4 +4,4 @@ Package up2 contains the Gobot adaptor for the Upboard UP2. For further information refer to the UP2 README: https://github.com/hybridgroup/gobot/blob/master/platforms/upboard/up2/README.md */ -package up2 // import "gobot.io/x/gobot/platforms/upboard/up2" +package up2 // import "gobot.io/x/gobot/v2/platforms/upboard/up2" diff --git a/platforms/upboard/upboard.go b/platforms/upboard/upboard.go index 30af0bf1..746d9858 100644 --- a/platforms/upboard/upboard.go +++ b/platforms/upboard/upboard.go @@ -5,6 +5,6 @@ This package currently supports the following hardware: - UP2 (Squared) For further information refer to the Upboard README: -https://gobot.io/x/gobot/blob/master/platforms/upboard/README.md +https://gobot.io/x/gobot/v2/blob/master/platforms/upboard/README.md */ package upboard diff --git a/robot_test.go b/robot_test.go index f7ab368c..7bee3324 100644 --- a/robot_test.go +++ b/robot_test.go @@ -4,7 +4,7 @@ import ( "testing" "time" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2/gobottest" ) func TestRobotConnectionEach(t *testing.T) { diff --git a/snapcraft.yaml b/snapcraft.yaml index 80c2c6a5..ce395fa4 100644 --- a/snapcraft.yaml +++ b/snapcraft.yaml @@ -19,8 +19,8 @@ parts: gobot: source: . plugin: go - go-packages: [gobot.io/x/gobot/cli] - go-importpath: gobot.io/x/gobot + go-packages: [gobot.io/x/gobot/v2/cli] + go-importpath: gobot.io/x/gobot/v2 organize: bin/cli: bin/gobot after: [go] diff --git a/system/digitalpin_access.go b/system/digitalpin_access.go index 4d4eef6a..f5d29bef 100644 --- a/system/digitalpin_access.go +++ b/system/digitalpin_access.go @@ -3,7 +3,7 @@ package system import ( "strconv" - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" ) // sysfsDitalPinHandler represents the sysfs implementation diff --git a/system/digitalpin_access_test.go b/system/digitalpin_access_test.go index 2d026edb..ef822a85 100644 --- a/system/digitalpin_access_test.go +++ b/system/digitalpin_access_test.go @@ -3,7 +3,7 @@ package system import ( "testing" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2/gobottest" ) func Test_isSupportedSysfs(t *testing.T) { diff --git a/system/digitalpin_config.go b/system/digitalpin_config.go index bbf4d34e..c576eabd 100644 --- a/system/digitalpin_config.go +++ b/system/digitalpin_config.go @@ -3,7 +3,7 @@ package system import ( "time" - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" ) const ( diff --git a/system/digitalpin_config_test.go b/system/digitalpin_config_test.go index 9d0d437f..96154383 100644 --- a/system/digitalpin_config_test.go +++ b/system/digitalpin_config_test.go @@ -4,8 +4,8 @@ import ( "testing" "time" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) var _ gobot.DigitalPinOptioner = (*digitalPinConfig)(nil) diff --git a/system/digitalpin_gpiod.go b/system/digitalpin_gpiod.go index f3cb07ad..1c5497b5 100644 --- a/system/digitalpin_gpiod.go +++ b/system/digitalpin_gpiod.go @@ -8,7 +8,7 @@ import ( "time" "github.com/warthog618/gpiod" - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" ) const systemGpiodDebug = false diff --git a/system/digitalpin_gpiod_test.go b/system/digitalpin_gpiod_test.go index 6e24c5a7..6ed07746 100644 --- a/system/digitalpin_gpiod_test.go +++ b/system/digitalpin_gpiod_test.go @@ -5,8 +5,8 @@ import ( "strings" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) var _ gobot.DigitalPinner = (*digitalPinGpiod)(nil) diff --git a/system/digitalpin_mock.go b/system/digitalpin_mock.go index 9698721e..c2e8d2fd 100644 --- a/system/digitalpin_mock.go +++ b/system/digitalpin_mock.go @@ -1,7 +1,7 @@ package system import ( - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" ) type mockDigitalPinAccess struct { diff --git a/system/digitalpin_sysfs.go b/system/digitalpin_sysfs.go index 82a094c7..c4170d5b 100644 --- a/system/digitalpin_sysfs.go +++ b/system/digitalpin_sysfs.go @@ -10,7 +10,7 @@ import ( "syscall" "time" - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" ) const ( diff --git a/system/digitalpin_sysfs_test.go b/system/digitalpin_sysfs_test.go index 9a39adc4..ba169984 100644 --- a/system/digitalpin_sysfs_test.go +++ b/system/digitalpin_sysfs_test.go @@ -6,8 +6,8 @@ import ( "syscall" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) var _ gobot.DigitalPinner = (*digitalPinSysfs)(nil) diff --git a/system/doc.go b/system/doc.go index 138bd624..df141b22 100644 --- a/system/doc.go +++ b/system/doc.go @@ -3,4 +3,4 @@ Package system provides generic access to Linux gpio, i2c and filesystem. It is intended to be used while implementing support for a single board Linux computer */ -package system // import "gobot.io/x/gobot/system" +package system // import "gobot.io/x/gobot/v2/system" diff --git a/system/fs_mock_test.go b/system/fs_mock_test.go index 0f988016..afc39c51 100644 --- a/system/fs_mock_test.go +++ b/system/fs_mock_test.go @@ -4,7 +4,7 @@ import ( "sort" "testing" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2/gobottest" ) func TestMockFilesystemOpen(t *testing.T) { diff --git a/system/fs_test.go b/system/fs_test.go index 369a1882..ebcbfd8b 100644 --- a/system/fs_test.go +++ b/system/fs_test.go @@ -4,7 +4,7 @@ import ( "os" "testing" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2/gobottest" ) func TestFilesystemOpen(t *testing.T) { diff --git a/system/i2c_device_test.go b/system/i2c_device_test.go index 94354080..deeacb34 100644 --- a/system/i2c_device_test.go +++ b/system/i2c_device_test.go @@ -7,8 +7,8 @@ import ( "testing" "unsafe" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) const dev = "/dev/i2c-1" diff --git a/system/pwmpin_sysfs_test.go b/system/pwmpin_sysfs_test.go index eaf589ae..986fc43a 100644 --- a/system/pwmpin_sysfs_test.go +++ b/system/pwmpin_sysfs_test.go @@ -5,8 +5,8 @@ import ( "syscall" "testing" - "gobot.io/x/gobot" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2" + "gobot.io/x/gobot/v2/gobottest" ) var _ gobot.PWMPinner = (*pwmPinSysFs)(nil) diff --git a/system/spi_access.go b/system/spi_access.go index 6cd13e13..5b1feb48 100644 --- a/system/spi_access.go +++ b/system/spi_access.go @@ -1,7 +1,7 @@ package system import ( - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" ) type periphioSpiAccess struct { diff --git a/system/spi_access_test.go b/system/spi_access_test.go index 7ac08341..6f087ae4 100644 --- a/system/spi_access_test.go +++ b/system/spi_access_test.go @@ -3,7 +3,7 @@ package system import ( "testing" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2/gobottest" ) func TestGpioSpi_isSupported(t *testing.T) { diff --git a/system/spi_gpio.go b/system/spi_gpio.go index 68ad91a8..ab0af789 100644 --- a/system/spi_gpio.go +++ b/system/spi_gpio.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" ) type spiGpioConfig struct { diff --git a/system/spi_mock.go b/system/spi_mock.go index 8a10eeb6..f78bb41a 100644 --- a/system/spi_mock.go +++ b/system/spi_mock.go @@ -3,7 +3,7 @@ package system import ( "fmt" - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" ) // MockSpiAccess contains parameters of mocked SPI access diff --git a/system/system.go b/system/system.go index 5bedb89f..06111acd 100644 --- a/system/system.go +++ b/system/system.go @@ -5,7 +5,7 @@ import ( "syscall" "unsafe" - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" ) const systemDebug = false diff --git a/system/system_options.go b/system/system_options.go index 70c05e8b..302e4462 100644 --- a/system/system_options.go +++ b/system/system_options.go @@ -3,7 +3,7 @@ package system import ( "fmt" - "gobot.io/x/gobot" + "gobot.io/x/gobot/v2" ) // Optioner is the interface for system options. This provides the possibility for change the systems behavior by the diff --git a/system/system_test.go b/system/system_test.go index d1e24c14..54eb8748 100644 --- a/system/system_test.go +++ b/system/system_test.go @@ -3,7 +3,7 @@ package system import ( "testing" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2/gobottest" ) func TestNewAccesser(t *testing.T) { diff --git a/utils_test.go b/utils_test.go index 8689602d..383baa57 100644 --- a/utils_test.go +++ b/utils_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - "gobot.io/x/gobot/gobottest" + "gobot.io/x/gobot/v2/gobottest" ) func TestEvery(t *testing.T) {