From c0345eafbfa4c7f5d4b045e318feef0576af9fe2 Mon Sep 17 00:00:00 2001 From: Nguyen Hong Thiet Date: Thu, 14 Feb 2019 19:11:08 +0700 Subject: [PATCH] fix missing the first bit in HC589 shift in (#2448) --- cores/esp32/wiring_shift.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cores/esp32/wiring_shift.c b/cores/esp32/wiring_shift.c index 44c13700..c6c279aa 100644 --- a/cores/esp32/wiring_shift.c +++ b/cores/esp32/wiring_shift.c @@ -25,11 +25,12 @@ uint8_t shiftIn(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder) { uint8_t i; for(i = 0; i < 8; ++i) { - digitalWrite(clockPin, HIGH); + //digitalWrite(clockPin, HIGH); if(bitOrder == LSBFIRST) value |= digitalRead(dataPin) << i; else value |= digitalRead(dataPin) << (7 - i); + digitalWrite(clockPin, HIGH); digitalWrite(clockPin, LOW); } return value;