Skip to content

Commit

Permalink
docs: update README with more complete instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
deadprogram committed Apr 29, 2021
1 parent 54e36ba commit d5d5d73
Showing 1 changed file with 47 additions and 2 deletions.
49 changes: 47 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,17 @@ For information about this sensor contact Mitsubishi Electric.

## API

The API is meant to be used in Go programs. You would normally add it to your own project using Go modules like this:

```shell
go get github.com/northvolt/go-kd6rmx
```

```go
import "github.com/northvolt/go-kd6rmx"

...

// initialize sensor
cis := kd6rmx.Sensor{Port: "/dev/your-port-here"}

Expand All @@ -28,10 +38,19 @@ cis.SaveSettings(2)

`kd6ctl` is a command line interface tool to allow for user configuration.

### How to build
### How to install

First you must obtain the git repo, and change into the new directory:

```shell
go build -o build/kd6ctl ./cmd/kd6ctl
git clone https://github.com/northvolt/go-kd6rmx.git
cd go-kd6rmx
```

Now you can install the CLI

```shell
go install ./cmd/kd6ctl
```

### How to use
Expand Down Expand Up @@ -69,3 +88,29 @@ kd6ctl interpolation on
kd6ctl dark on
kd6ctl white on
```

### How to build binaries for different platforms

#### Windows

```shell
env GOOS=windows GOARCH=amd64 go build -o build/kd6ctl.exe ./cmd/kd6ctl
```

#### Linux

```shell
env GOOS=linux GOARCH=amd64 go build -o build/kd6ctl ./cmd/kd6ctl
```

#### macOS - Intel

```shell
env GOOS=darwin GOARCH=amd64 go build -o build/kd6ctl ./cmd/kd6ctl
```

#### macOS - M1

```shell
env GOOS=darwin GOARCH=arm64 go build -o build/kd6ctl ./cmd/kd6ctl
```

0 comments on commit d5d5d73

Please sign in to comment.