1、Source文件下添加ds18b20驱动代码并添加到项目中
2、SampleApp.c添加头文件
3、SampleApp.c中初级传感器io口
4、SampleApp.c读取温度数据代码添加到点播函数中
5、SampleApp.c接收数据函数,修改标识并添加接收位
6、DS18B20.c将协议栈延迟函数头文件添加到文件中,并将原延迟函数修改为协议栈自带的延迟函数,以确保时间顺序正确。
最后,将程序下载到协调器和终端设备,通过串口和屏幕查看传感器收集到的温度值。调试过程中的问题: 1、Error while running Linker 2、Failed to load debugee: G:\STM32\zigbee\CC2530-201906\1.代码练习\5-6-ZStack-2.5.1a\Projects\zstack\Samples\SampleApp\CC2530DB\CoordinatorEB\Exe\SampleApp.a51 3、Warning[w69]: Address translation (-M, -b# or -b@) has no effect on the output format ‘debug’. The output file will be generated but noaddress translation will be performed.
百度上的问题3解决方案如下:
但我已经删除了这个注释,不明白为什么要再次发出警告。另外两个问题有太多的参考方法,不知道为什么。经过半天的调试,我发现以前配置的操作没有问题。