定时器写了一点

This commit is contained in:
2026-08-14 01:10:21 +08:00
parent ce876f0ff0
commit a6cb521d71
4 changed files with 9 additions and 8 deletions

View File

@@ -7,15 +7,9 @@ int16_t Num = 0;
int main(void) {
OLED_Init();
Encoder_Init();
OLED_ShowString(1, 1, "Num:");
OLED_ShowString(1, 1, "Hello World");
while (1) {
OLED_ShowNum(2, 1, GPIO_ReadInputDataBit(GPIOB, GPIO_Pin_0), 1); // 显示 PB0 电平
OLED_ShowNum(3, 1, GPIO_ReadInputDataBit(GPIOB, GPIO_Pin_1), 1); // 显示 PB1 电平
Num += GetEncoder_Counter();
OLED_ShowSignedNum(1, 5, Num, 5);
}
}