Go language command interface to the Mitsubishi Electric KD-MX series of contact image sensors.
http://www.mitsubishielectric.com/bu/contact_image/general/lineup/index.html
For information about this sensor contact Mitsubishi Electric.
The API is meant to be used in Go programs. You would normally add it to your own project using Go modules like this:
go get github.com/northvolt/go-kd6rmx
import "github.com/northvolt/go-kd6rmx"
...
// initialize sensor
cis := kd6rmx.Sensor{Port: "/dev/your-port-here"}
// load settings from user preset 1
return cis.LoadSettings(1)
// change some values
cis.PixelOverlap(true)
cis.PixelInterpolation(true)
cis.PixelResolution(600)
// save current settings to user preset 2
cis.SaveSettings(2)
kd6ctl
is a command line interface tool to allow for user configuration.
First you must obtain the git repo, and change into the new directory:
git clone https://github.com/northvolt/go-kd6rmx.git
cd go-kd6rmx
Now you can install the CLI
go install ./cmd/kd6ctl
kd6ctl --help
Will output a list of commands:
USAGE
kd6ctl [flags] <subcommand>
SUBCOMMANDS
version Show version of kd6ctl API.
dumpreg Dump the register values of CIS.
gain Enables the gain control and sets the specified value
load Load user settings.
save Save current settings into a user preset.
pattern Decide test pattern.
frequency Change output frequency (in Mhz).
format Change output format.
interpolation Set interpolation on/off.
dark Dark correction on/off/adjust.
white White correction on/off/adjust/target.
led Turn sensor LEDs on or off.
duty Set LED duty illumination period register value. Valid range 0 to 4095.
illum Set effective LED illumination period register value. Valid range 0 to 4095.
cmd Sends the specified command to sensor
FLAGS
-log=false turn on debug logging
-p /dev/corser/XtiumCLMX41_s0 port of KD6RMX sensor to use
How to set params:
kd6ctl frequency 60.0
kd6ctl format 10 serial base
kd6ctl interpolation on
kd6ctl dark on
kd6ctl white on
kd6ctl led ab on
make build-windows
make build-linux
make build-macos
make build-macos-m1
make build-all
make build
build binaries for other Operating Systems and architectures
env GOOS=<OS> GOARCH=<ARCH> go build -o build/kd6ctl-<OS>-<ARCH> ./cmd/kd6ctl
replace the OS
by operating system and ARCH
by architecture supported by go cross-compiler.
Following commands build binaries for Windows (amd64), Linux (amd64), macOS (amd64) and macOS M1 (arm64).
Bump release tag to minor
make release bump=minor
Bump relase tag to major
make release bump=major
if bump argument is not mentiond, then the release will be bumped with tag patch
make release