对射式红外传感器计数器实现

This commit is contained in:
2026-08-13 22:32:24 +08:00
parent 1c18eebc4a
commit 72d07a8077
4 changed files with 57 additions and 13 deletions

View File

@@ -1,21 +1,13 @@
#include "stm32f10x.h"
#include "Delay.h"
#include "OLED.h"
#include "CountSensor.h"
int main(void) {
OLED_Init();
OLED_ShowChar(1,1, 'A');
OLED_ShowString(1,3, "Hello World!12");
OLED_ShowNum(2, 1, 12345, 5);
OLED_ShowSignedNum(2, 7, 12, 2);
OLED_ShowSignedNum(2, 11, -34, 2);
OLED_ShowHexNum(3,1,0xaa55,4);
OLED_ShowBinNum(4,1,0xaa55,16);
Delay_ms(1000);
OLED_Clear();
CountSensor_Init();
OLED_ShowString(1,1, "Count:");
while (1) {
OLED_ShowNum(1,7, CountSensor_GetCount(), 5);
}
}