-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
2 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
idf_component_register(SRCS "jy901.c" | ||
INCLUDE_DIRS ".") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
## example | ||
```c | ||
// 主函数 | ||
void app_main() | ||
{ | ||
printf("1"); | ||
// 初始化UART | ||
jy901_init(); | ||
printf("2"); | ||
// 循环执行 | ||
while (1) | ||
{ | ||
printf("1"); | ||
// 读取JY901的数据 | ||
jy901_read(); | ||
// 打印JY901的数据 | ||
jy901_print(); | ||
// 延时100毫秒 | ||
vTaskDelay(100 / portTICK_PERIOD_MS); | ||
} | ||
} | ||
``` |