Taiga Develop 2 週間 前
親
コミット
c232d8b9a9
1 ファイル変更、3 行追加、2 行削除
  1. 3 2
      sources/hd44780_shift_register.c

+ 3 - 2
sources/hd44780_shift_register.c

@@ -13,10 +13,11 @@ static chlcd_error_t __chlcd_hd44780_shift_register_set_byte(
     self->last_state = content; 
     
     for (uint8_t count = 0; count < 8; ++count) {
-        bool current = (content & 0b1) != 0x00;
-        content = content >> 1;
+        bool current = (content & 0b10000000) != 0x00;
+        content = content << 1;
 
         __R(chlcd_pin_write(self->register_data, current));
+        __R(chlcd_sleep_us(200));
         __R(chlcd_pin_write(self->register_clock, true));
         __R(chlcd_sleep_us(200));
         __R(chlcd_pin_write(self->register_clock, false));