Git Product home page Git Product logo

hc14-at-rs's Introduction

hc14-at-rs 驱动

No Std

[English]

用于 hc-14 无线电收发器串行模块的驱动程序。

当 SET 引脚被拉低时,可以使用 AT 指令对该模块进行配置。该驱动程序从 embedded-hal 中获取输出引脚、串行端口和延迟时间,提供了一个与 hc14 模块交互的简便接口。

hc14 的运行状态:正常模式、AT配置配置。

更多详情,请参阅此处提供的官方文档

barafael/hc12-at-rs基础上对hc14模块进行重构,不得不说,相比hc12,hc14模块被很多功能有没有了,文档对模块的介绍也就停留在介绍而已,例程也没有,我暂时只使用了STM32F103进行了测试,使用默认设置,在城市中,发送模块放在7楼的情况下,通信距离大约:600-700米的。

示例

let hc14 = Hc14::new(serial, key, delay).unwrap();

// 重置模式参数
let mut hc14_configure = hc14.into_configuration_mode().unwrap();
hc14_configure.reset_settings();

// 获取 Hc14 的参数
hc14_configure.get_parameters().unwrap();

// 设置信道
let mut buffer = [0u8; 32];
hc14_configure.wirte_set_channel(28, &mut buffer);

// 切换至普通模式
let mut hc14_normal = hc14_configure.into_normal_mode().unwrap();

// 发送缓冲区
let buf = b"hc14";
hc14_normal.send_buffer(buf).unwrap();

// 发送str
let buf_str = "hc14";
hc14_normal.send_string(buf_str);

IMG_20231107_152253

hc14-at-rs's People

Contributors

auroots avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.