testing bugs
This commit is contained in:
15
main.go
15
main.go
@@ -63,13 +63,14 @@ func readDataFromDHT(pin *gpio.Pin) ([4]byte, error) {
|
||||
time.Sleep(40 * time.Microsecond)
|
||||
|
||||
// Get Data
|
||||
fmt.Println(pin.Read())
|
||||
if cyclesForReading(pin, gpio.Low) == Timeout {
|
||||
return receivedInput, errors.New(fmt.Sprintf(TimeoutErrInitial, "low"))
|
||||
}
|
||||
if cyclesForReading(pin, gpio.High) == Timeout {
|
||||
return receivedInput, errors.New(fmt.Sprintf(TimeoutErrInitial, "high"))
|
||||
}
|
||||
time.Sleep(80 * time.Microsecond)
|
||||
time.Sleep(80 * time.Microsecond)
|
||||
//if cyclesForReading(pin, gpio.Low) == Timeout {
|
||||
// return receivedInput, errors.New(fmt.Sprintf(TimeoutErrInitial, "low"))
|
||||
//}
|
||||
//if cyclesForReading(pin, gpio.High) == Timeout {
|
||||
// return receivedInput, errors.New(fmt.Sprintf(TimeoutErrInitial, "high"))
|
||||
//}
|
||||
|
||||
// Store cycle number for each low and high pulse
|
||||
cycles := [80]int{}
|
||||
|
||||
Reference in New Issue
Block a user