张高兴的 Windows 10 IoT 开发笔记:串口红外编解码模块 YS-IRTM
This is a Windows 10 IoT Core project on the Raspberry Pi 2/3, coded by C#.
GitHub: https://github.com/ZhangGaoxing/windows-iot-demo/tree/master/IRTM
Image
Reference
https://github.com/ZhangGaoxing/windows-iot-demo/tree/master/IRTM/Reference
Connect
- RXD - UART0 TX (PIN 8)
- TXD - UART0 RX (PIN 10)
- VCC - 5V
- GND - GND
Note
There is one Serial UART available on the RPi2/3: UART0
- Pin 8 - UART0 TX
- Pin 10 - UART0 RX
You need add the following capability to the Package.appxmanifest file to use Serial UART.
<Capabilities>
<DeviceCapability Name="serialcommunication">
<Device Id="any">
<Function Type="name:serialPort" />
</Device>
</DeviceCapability>
</Capabilities>
What Contains
In IRTM.cs file
/// <summary>
/// Initialize YS-IRTM
/// </summary>
public async Task InitializeAsync();
/// <summary>
/// Send Order
/// </summary>
/// <param name="code">Order</param>
public async Task SendAsync(byte[] code);
/// <summary>
/// Read Order
/// </summary>
public async Task<byte[]> ReadAsync();
/// <summary>
/// Set YS-IRTM Address
/// </summary>
/// <param name="address">Address from 1 to FF</param>
public async Task SetAddressAsync(byte address);
/// <summary>
/// Set YS-IRTM Baud Rate
/// </summary>
/// <param name="rate">Baud Rate</param>
public async Task SetBaudRateAsync(IrtmBaudRate rate);
/// <summary>
/// Return YS-IRTM
/// </summary>
/// <returns>YS-IRTM</returns>
public SerialDevice GetDevice();
/// <summary>
/// Cleanup
/// </summary>
public void Dispose();
How to Use
- First, you need to create a IRTM object. After that you should call InitializeAsync() to initialize.
IRTM irtm = new IRTM();
await irtm.InitializeAsync();
- Second, SendAsync().
irtm.SendAsync(new byte[] { 0x01, 0x02, 0x03 });
- If you want to close the sensor, call Dispose().
irtm.Dispose();
张高兴的 Windows 10 IoT 开发笔记:串口红外编解码模块 YS-IRTM的更多相关文章
- 张高兴的 Windows 10 IoT 开发笔记:红外温度传感器 MLX90614
GitHub : https://github.com/ZhangGaoxing/windows-iot-demo/tree/master/MLX90614
- 张高兴的 Windows 10 IoT 开发笔记:使用 ADS1115 读取模拟信号
考虑到 Raspberry Pi 读取模拟信号是很烦人的事情,更何况是在没人玩的 Windows 10 IoT 下,所以准备正儿八经的写点东西. 需求:使用 Raspberry Pi 读取输出模拟信号 ...
- 张高兴的 Windows 10 IoT 开发笔记:使用 Lightning 中的软件 PWM 驱动 RGB LED
感觉又帮 Windows 10 IoT 开荒了,所以呢,正儿八经的写篇博客吧.其实大概半年前就想写的,那时候想做个基于 Windows 10 IoT 的小车,但树莓派原生不支持 PWM 啊.百度也搜不 ...
- 张高兴的 Windows 10 IoT 开发笔记:HC-SR04 超声波测距模块
HC-SR04 采用 IO 触发测距.下面介绍一下其在 Windows 10 IoT Core 环境下的用法. 项目运行在 Raspberry Pi 2/3 上,使用 C# 进行编码. 1. 准备 H ...
- 张高兴的 Windows 10 IoT 开发笔记:BH1750FVI 光照度传感器
BH1750FVI 是一款 IIC 接口的数字型光强度传感器集成电路.下面介绍一下其在 Windows 10 IoT Core 环境下的用法. 项目运行在 Raspberry Pi 2/3 上,使用 ...
- 张高兴的 Windows 10 IoT 开发笔记:部署 ASP.NET Core 2 应用
今天是大年初二,都去走亲戚了吧,享受一下这难得的能和亲友相聚的时光.而我就不一样了,今天一回到家就又开始瞎折腾了,哈哈哈. 问题背景 最近花了点时间用 ASP.NET Core 2 写了个个人博客,中 ...
- 张高兴的 Windows 10 IoT 开发笔记:无线收发芯片 nRF24L01
This is a Windows 10 IoT Core project on the Raspberry Pi 2/3, coded by C#. GitHub:https://github.co ...
- 张高兴的 Windows 10 IoT 开发笔记:FM 电台模块 KT0803L
This is a Windows 10 IoT Core project on the Raspberry Pi 2/3, coded by C#. GitHub:https://github.co ...
- 张高兴的 Windows 10 IoT 开发笔记:0.96 寸 I2C OLED
This is a Windows 10 IoT Core project on the Raspberry Pi 2/3, coded by C#. GitHub:https://github.co ...
随机推荐
- SQL SERVER 锁资源问题
1204: cannot obtain a LOCK resource 在sql server 锁资源的限制基本是自动优化调整.如果调整过参数,可能在系统大批量查询的时候出现以上错误,或者是 alwa ...
- python---购物车---更新
购物车程序更新: 更新商家入口,实现以下功能: 1. 商家能够修改商品价格: 2. 商家能够下线商品: 3. 商家能够增加商品: 4. 商品信息存在文件中 # -*- coding:utf-8 -*- ...
- IEEE发布2017年编程语言排行榜:Python高居首位
https://news.cnblogs.com/n/574248 编者按:本文由微信公众号“机器之心”(ID:almosthuman2014)编译,机器之心专注生产 AI 领域专业性内容.本文作者: ...
- 在Web中获取MAC地址
很多时候都很难琢磨客户在想什么,也许是自己业务经验不足,也许是客户要显示出他在软件方面也非常的专业.记得以前听过一个故事,说一个富人想娶个媳妇,然后他比较钟意的有三个女人,然后就想从三个女人中选一个, ...
- Java 核心卷学习笔记(一)
Java基程序设计结构 1.注释 三种注释方式: // 注释单行 /* 内容 */ 注释单行 /** * 内容 */
- Page_Load不要忘了if (!IsPostBack)
Page_Load不要忘了if (!IsPostBack) 问题:在DropDownList的SelectedIndexChanged事件中绑定数据,运行时,DropDownList控件的Select ...
- table中的一些另类标签
thead/tbody/tfoot/caption/colgroup 注意:thead/tbody/tfoot三部分内容不受编辑顺序影响只和标签本身含义从头到脚显示不能把两个tbody的内容进行合并单 ...
- 基于elk 实现nginx日志收集与数据分析。
一.背景 前端web服务器为nginx,采用filebeat + logstash + elasticsearch + granfa 进行数据采集与展示,对客户端ip进行地域统计,监控服务器响应时间等 ...
- Java 8 Documentation Download
Java API 下载方法 https://www.oracle.com/index.html https://www.oracle.com/java/technologies/java-se.htm ...
- 使用Spring Boot Actuator、Jolokia和Grafana实现准实时监控
由于最近在做监控方面的工作,因此也读了不少相关的经验分享.其中有这样一篇文章总结了一些基于Spring Boot的监控方案,因此翻译了一下,希望可以对大家有所帮助. 原文:Near real-time ...