Skip to content

Commit

Permalink
fix missing the first bit in HC589 shift in (#2448)
Browse files Browse the repository at this point in the history
  • Loading branch information
hongthiet1994 authored and me-no-dev committed Feb 14, 2019
1 parent 71ec3c3 commit c0345ea
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cores/esp32/wiring_shift.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c0345ea

Please sign in to comment.