my $registers = {
'switch' => 0,
'adjust' => 1,
- 'Vin' => 2,
- 'Cin' => 3,
+ 'vin' => 2,
+ 'cin' => 3,
'temp' => 4,
'info' => 5,
- 'Ioffset' => 6,
- 'Vout' => 7
+ 'ioffset' => 6,
+ 'vout' => 7
};
Getopt::Long::Configure(qw(gnu_getopt pass_through));
$SEL_board = 0xff if $SEL_board == -1;
$SEL_output = 0 unless defined $SEL_output && $SEL_output =~ /^\d$/;
-die "Group number too high (0..3)" if $SEL_output > 3;
+die "Group number too high (0..3,4)" if $SEL_output > 4;
$SEL_channel = 0 unless defined $SEL_channel && $SEL_channel =~ /^\d$/;
die "Channel number too high (0..1)" if $SEL_channel > 1;
-if(defined $registers->{$SEL_register}) {$SEL_register = $registers->{$SEL_register};}
+if(defined $registers->{lc($SEL_register)}) {$SEL_register = $registers->{lc($SEL_register)};}
$SEL_register //= -1;
die "Undefined register" unless ($SEL_register >= 0 && $SEL_register <= 7);
printf "measured Voltage @ Input : %.3f Volt (RAW: 0x%x)\n", ($calc) , ($answ);
}
if ($command == 3) { # Current
- my $calc = ($answ&0xFFF)/800.*2.5; # 800mV/A
+ my $calc = ($answ&0xFFF)/500.*2.5; # 500mV/A
printf "measured Current @ Input : %.3f Ampere (RAW: 0x%x)\n", ($calc) , ($answ);
}
if ($command == 4) { # Temperature