From: Othmar Gsenger Date: Thu, 30 Jun 2011 00:20:09 +0000 (+0000) Subject: working dart shit first version X-Git-Url: https://git.realraum.at/?p=svn42.git;a=commitdiff_plain;h=babbfc434be940bacf7f00de6503c2c57e1e455e working dart shit first version --- diff --git a/dart/dart.pde b/dart/dart.pde index 2e5223e..52a2063 100644 --- a/dart/dart.pde +++ b/dart/dart.pde @@ -24,6 +24,8 @@ union union16 { uint16_t uint16; }; +uint8_t zahlen[] = {115,110,46,78,51,83,82,68,99,105,41,73,35,67,50,36,113,108,44,76,49,81,114,100,98,101,37,69,34,66,102,109,111,116,52,84,47,79,57,89,106,97,33,65,42,74,38,45,112,104,40,72,48,80,0,0,103,107,43,75,39,71,70,77} ; + union union32 { byte uint8[4]; uint16_t uint16[2]; @@ -85,7 +87,14 @@ static void PCint() { value<<=3; while(output>>=1) value++; - Serial.println(value,HEX); + //Serial.println(value,HEX); + byte zahl = zahlen[value]; + + byte multi = zahl >> 5; + byte base = zahl & B11111; + Serial.print(0+multi); + Serial.print("\t"); + Serial.println(0+base); PCICR&= ~ B111; // Disable Interrupt start_timer(); } diff --git a/dart/perl_shit.pl b/dart/perl_shit.pl index cb544ba..213d949 100755 --- a/dart/perl_shit.pl +++ b/dart/perl_shit.pl @@ -13,16 +13,21 @@ while( my $line =<$fh>) chomp $line; my $zahl = (int($pos / 3)) +1 ; my $mult =( $pos % 3 )+1; + $zahl = 25 if $zahl == 21; $shit{hex $line} = [ $mult, $zahl]; $pos++; } close ($fh); +for my $foobar ( sort { $a <=> $b } keys %shit) +{ + + print sprintf "%d,", $shit{$foobar}[0]<<5|$shit{$foobar}[1]; +} while(my $foobar = ) { chomp $foobar; print join "\t",$foobar , $shit{hex $foobar}[0],$shit{hex $foobar}[1],"\n"; - }