定时器写了一点
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user