From: ian Date: Thu, 20 Mar 2008 01:51:49 +0000 (+0000) Subject: use CV 5 to control speed X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ijackson/git?a=commitdiff_plain;h=f939401f8cd1bc8fba83041394c294edb8faa35a;p=trains.git use CV 5 to control speed --- diff --git a/hostside/.cvsignore b/hostside/.cvsignore index 325f7ff..024a957 100644 --- a/hostside/.cvsignore +++ b/hostside/.cvsignore @@ -25,4 +25,3 @@ persist.data.new persist.conv.old persist.conv persist.conv.new -shinkansen-motor.cv-s diff --git a/hostside/shinkansen-motor.cv-s b/hostside/shinkansen-motor.cv-s new file mode 100644 index 0000000..e5f71d2 --- /dev/null +++ b/hostside/shinkansen-motor.cv-s @@ -0,0 +1,5 @@ +addr 1 +5 9 +29 0x06 +51 0x07 +57 0x06 diff --git a/hostside/shinkansen-motor.cv-s.gen b/hostside/shinkansen-motor.cv-s.gen deleted file mode 100755 index 716e24e..0000000 --- a/hostside/shinkansen-motor.cv-s.gen +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/perl - -$nmax= 126; - -#$max= 117; -#$max= 50; -$max= 108.9; - -@steps= 67..94; - -$doublings= 0; -$vmin= 40; -$vmax= 255; - -for ($i=0; $i<@steps; $i++) { - push @vals, $i + @steps * (exp($i/@steps * log(2) * $doublings) - 1.0); -} -$maxval= $vals[$#val]; -grep { $_ *= ($vmax-$vmin)/$maxval * $max/$nmax; $_ += $vmin; } @vals; - -printf "# autogenerated!\n" or die $!; -while () { print or die $!; } - -for ($i=0; $i<@steps; $i++) { - printf "%d %d\n", $steps[$i], $vals[$i] - or die $!; -} - -__END__ -addr 1 -#2 1 -29 0x16 -51 0x07 -57 0x06 - -# speed curve: