6 # Author : Nathael Pajani
7 # Copyright 2016 Nathael Pajani <nathael.pajani@techno-innov.fr>
9 # This program is free software: you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation, either version 2 of the License, or
12 # (at your option) any later version.
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with this program. If not, see <http://www.gnu.org/licenses/>.
25 print "Need file name as first argument\n";
32 open(LOGFILE, "<", $file);
33 open(TEMP, ">", "data_temp.log") or die $!;
34 open(CAP, ">", "data_cap.log") or die $!;
35 open(RES, ">", "data_res.log") or die $!;
38 foreach my $line (<LOGFILE>) {
43 chomp($line); # remove the newline from $line.
45 if ($line =~ m/Temp read: $w - raw/) {
48 print TEMP "$count $temp\n";
51 } elsif ($line =~ m/ADC9: $w, ADC10: (.+)/) {
52 print CAP "$count $1\n";
53 print RES "$count $2\n";
58 print "Got $count values\n";