From 17c26286f1e87ee8683011746ff1ad1f811204dd Mon Sep 17 00:00:00 2001 From: Daniel Ledda Date: Sat, 31 Oct 2020 16:36:15 +0100 Subject: [PATCH] finding a bug --- main.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 18cee4a..4463a92 100644 --- a/main.go +++ b/main.go @@ -104,9 +104,10 @@ func storeCycleCountsAsBinarySequence(cycles *[80]int) ([5]byte, error) { for i := 0; i < 40; i++ { lowCycles := cycles[2 * i] highCycles := cycles[2 * i + 1] - //if (lowCycles == Timeout) || (highCycles == Timeout) { - // return [5]byte{}, errors.New("timed out waiting for sensor pulse") - //} + if (lowCycles == Timeout) || (highCycles == Timeout) { + fmt.Println(lowCycles, highCycles) + //return [5]byte{}, errors.New("timed out waiting for sensor pulse") + } data[i / 8] <<= 1 if highCycles > lowCycles { data[i / 8] |= 1