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-kd6rmximport "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-kd6rmxNow you can install the CLI
go install ./cmd/kd6ctlkd6ctl --helpWill 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 useHow to set params:
kd6ctl frequency 60.0
kd6ctl format 10 serial base
kd6ctl interpolation on
kd6ctl dark on
kd6ctl white on
kd6ctl led ab onmake build-windowsmake build-linuxmake build-macosmake build-macos-m1make build-allmake buildbuild binaries for other Operating Systems and architectures
env GOOS=<OS> GOARCH=<ARCH> go build -o build/kd6ctl-<OS>-<ARCH> ./cmd/kd6ctlreplace 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=minorBump relase tag to major
make release bump=majorif bump argument is not mentiond, then the release will be bumped with tag patch
make release