The time at the start of each row is the nominal host computer time when an event (at least one signal changed state) happened.
The following (Perl) code:
use strict;
use warnings;
my $path = 'D:\Scratch~~\digital.csv';
open my $fIn, '<', $path or die "Can't open '$path': $!";
<$fIn>; # Skip column header row
my $lastLED;
my $lastI2C;
my $lastFallingLED;
while (my $line = <$fIn>) {
chomp $line;
my ($time, $led, $i2c) = split ',', $line;
$lastLED //= $led;
$lastI2C //= $i2c;
my $fallingLED = $lastLED && !$led;
my $risingI2C = !$lastI2C && $i2c;
$lastLED = $led;
$lastI2C = $i2c;
# Record time if this is a falling LED edge
$lastFallingLED = $time if $fallingLED;
next if !$risingI2C || !$lastFallingLED;
# have a I2C rising edge following or synchronous with a LED rising edge
my $ledSeconds = ExtractSeconds($lastFallingLED);
my $i2cSeconds = ExtractSeconds($time);
my $delta = $i2cSeconds - $ledSeconds;
$delta += 60.0 if $delta < 0;
print "$lastFallingLED: delta $delta\n";
$lastFallingLED = undef;
}
sub ExtractSeconds {
my ($timeStamp) = @_;
my ($seconds) = $timeStamp =~ /(\d+\.\d+)/;
return $seconds;
}
run against the data:
Time [s],GRNLed,I2C-0
2022-06-08T02:26:50.443047700+00:00,1,0
2022-06-08T02:26:50.591667628+00:00,0,0
2022-06-08T02:26:50.591946212+00:00,0,1
2022-06-08T02:26:50.616669900+00:00,1,1
2022-06-08T02:26:50.616948764+00:00,1,0
2022-06-08T02:26:51.091749972+00:00,0,0
2022-06-08T02:26:51.092027940+00:00,0,1
2022-06-08T02:26:51.116758444+00:00,1,1
2022-06-08T02:26:51.117036492+00:00,1,0
2022-06-08T02:26:51.591834684+00:00,0,0
2022-06-08T02:26:51.592113260+00:00,0,1
generates:
2022-06-08T02:26:50.591667628+00:00: delta 0.000278584000000137
2022-06-08T02:26:51.091749972+00:00: delta 0.000277967999998907
2022-06-08T02:26:51.591834684+00:00: delta 0.000278575999999475
which is a list of the times between falling edges on the GRNLed line and the next rising edge on the I2C-0 line. The time stamp is the time of the GRNLed falling edge. I should note that Perl is my “go to” scripting language so I could knock up the example code more quickly than I would with Python.