Skip to content

Commit

Permalink
add option to adjust gain
Browse files Browse the repository at this point in the history
  • Loading branch information
julian59189 committed Aug 20, 2021
1 parent 33dc163 commit b1c6cc0
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion cmd/kd6ctl/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,26 @@ func main() {
},
}

adjustgain := &ffcli.Command{
Name: "adjustgain",
ShortUsage: "kd6ctl adjustgain <preset>",
ShortHelp: "adjustgain user settings.",
Exec: func(_ context.Context, args []string) error {
if n := len(args); n != 1 {
return fmt.Errorf("adjustthe gain number")
}

gain, err := strconv.Atoi(args[0])
if err != nil {
return err
}

cis := kd6rmx.Sensor{Port: *port}
cis.GainAmplifierEnabled(true)
return cis.GainAmplifierLevel(gain)
},
}

dumpreg := &ffcli.Command{
Name: "dumpreg",
ShortUsage: "kd6ctl dumpreg",
Expand Down Expand Up @@ -315,7 +335,7 @@ func main() {
ShortUsage: "kd6ctl [flags] <subcommand>",
ShortHelp: "kd6ctl is a command line utility to change config on the KD6RMX contact image sensor.",
FlagSet: rootFlagSet,
Subcommands: []*ffcli.Command{version, dumpreg, load, save, outputfreq, outputfmt, interp, dark, white, leds, duty},
Subcommands: []*ffcli.Command{version, dumpreg, adjustgain, load, save, outputfreq, outputfmt, interp, dark, white, leds, duty},
Exec: func(context.Context, []string) error {
return flag.ErrHelp
},
Expand Down

0 comments on commit b1c6cc0

Please sign in to comment.