TOF雷达串口库
规范
- uart节点 确保可访问
功能
基础功能
- 设置uart
Example:
SerialManager.getInstance().initDevice(TOF_SERIAL,TOF_BAUDRATE);
- 获取雷达数据
Example:
SendTOFDistance command = new SendTOFDistance();
SerialManager.getInstance().openTOF(command, new Callback<RecvTOFDistance>() {
@Override
public void onSuccess(RecvTOFDistance recvTOFDistance) {
showToast("距离 = "+recvTOFDistance.getDistance());
}
@Override
public void onFailure(Throwable tr) {
Log.w("onError", tr);
showToast(tr.getMessage());
}
});
- 释放uart节点
Example:
SerialManager.getInstance().release();