xr806上自带两个i2c接口功能~~~~
接口名称 | TW00 | TWI1 |
---|---|---|
SCL | PA12 | PB14 |
SDA | PA13 | PB15 |
这里使用的是模拟I2C方式。
创建工程
拷贝wlan_demo为oled_demo,并同步修改ohosdemo和oled_demo目录下的BUILD.gn
- device/xradio/xr806/ohosdemo/BUILD.gn
`group("ohosdemo") {
deps = [
#"hello_demo:app_hello",
#"iot_peripheral:app_peripheral",
#"wlan_demo:app_WlanTest",
"oled_demo:app_oled",
]
}` device/xradio/xr806/ohosdemo/oled_demo/BUILD.gn
`static_library("app_oled") {
configs = []sources = [
"main.c",
]cflags = board_cflags
include_dirs = board_include_dirs
include_dirs += [
".",
"thirdparty/ssd1306/ssd1306",
"//utils/native/lite/include",
]deps = [
"thirdparty/ssd1306/ssd1306:oled_ssd1306",
]
}`- 执行编译
hb build
- 下载程序
下一试用内容:将通过获取网络天气数据,然后显示在ssd1306屏幕上。
参考资料:
xr806引脚功能及原理图