From 6d4aed4ddaebe362116785c965744a16eebaf796 Mon Sep 17 00:00:00 2001 From: realraum Date: Tue, 13 Dec 2011 00:16:55 +0000 Subject: [PATCH] changed time base to 8kHz added binary output to decoder --- rf433rcv/pc/decode.pl | 14 +++++++++++++- rf433rcv/teensy/example.c | 2 +- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/rf433rcv/pc/decode.pl b/rf433rcv/pc/decode.pl index c5822e5..fc7f92e 100755 --- a/rf433rcv/pc/decode.pl +++ b/rf433rcv/pc/decode.pl @@ -52,5 +52,17 @@ if (my $delemiter = $ARGV[0]) } } chop $seq; - print STDERR "$seq\n"; + # print "$seq\n"; + my $bitcount=0; + my @binarydata; + for my $bits (split /,/,$seq) + { + $binarydata[int($bitcount/8)]<<=1; + $binarydata[int($bitcount/8)]|=$bits; + $bitcount++; + } + $binarydata[int($bitcount/8)]<<= 7 - ($bitcount % 8); + my @chars = map { chr($_) } @binarydata; + print STDERR join '',@chars; } + diff --git a/rf433rcv/teensy/example.c b/rf433rcv/teensy/example.c index ab7026c..ad07cda 100644 --- a/rf433rcv/teensy/example.c +++ b/rf433rcv/teensy/example.c @@ -45,7 +45,7 @@ int main(void) // 200*8 clock cycles, 100us TCCR0A = 1<