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的更多相关文章

  1. 张高兴的 Windows 10 IoT 开发笔记:红外温度传感器 MLX90614

    GitHub : https://github.com/ZhangGaoxing/windows-iot-demo/tree/master/MLX90614

  2. 张高兴的 Windows 10 IoT 开发笔记:使用 ADS1115 读取模拟信号

    考虑到 Raspberry Pi 读取模拟信号是很烦人的事情,更何况是在没人玩的 Windows 10 IoT 下,所以准备正儿八经的写点东西. 需求:使用 Raspberry Pi 读取输出模拟信号 ...

  3. 张高兴的 Windows 10 IoT 开发笔记:使用 Lightning 中的软件 PWM 驱动 RGB LED

    感觉又帮 Windows 10 IoT 开荒了,所以呢,正儿八经的写篇博客吧.其实大概半年前就想写的,那时候想做个基于 Windows 10 IoT 的小车,但树莓派原生不支持 PWM 啊.百度也搜不 ...

  4. 张高兴的 Windows 10 IoT 开发笔记:HC-SR04 超声波测距模块

    HC-SR04 采用 IO 触发测距.下面介绍一下其在 Windows 10 IoT Core 环境下的用法. 项目运行在 Raspberry Pi 2/3 上,使用 C# 进行编码. 1. 准备 H ...

  5. 张高兴的 Windows 10 IoT 开发笔记:BH1750FVI 光照度传感器

    BH1750FVI 是一款 IIC 接口的数字型光强度传感器集成电路.下面介绍一下其在 Windows 10 IoT Core 环境下的用法. 项目运行在 Raspberry Pi 2/3 上,使用 ...

  6. 张高兴的 Windows 10 IoT 开发笔记:部署 ASP.NET Core 2 应用

    今天是大年初二,都去走亲戚了吧,享受一下这难得的能和亲友相聚的时光.而我就不一样了,今天一回到家就又开始瞎折腾了,哈哈哈. 问题背景 最近花了点时间用 ASP.NET Core 2 写了个个人博客,中 ...

  7. 张高兴的 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 ...

  8. 张高兴的 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 ...

  9. 张高兴的 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 ...

随机推荐

  1. [C#网络应用编程]1、对进程的操作

    在.net中,Process类提供了对进程进行管理的各种方法. 一.获取进程集合的方法: Process[] myProcesses = Process.GetProcesses();  //获取本地 ...

  2. 精彩源于起点——2018年潍坊市首次青少年Python编程公开课

    有一种语言叫计算机语言 I want to talk with Computer 春遇到冬,有了岁月 天遇到地,有了永恒 我们拥有的, 不止是长大, 还有那份长大的悲欢经历. 未来会有很多可能, 但一 ...

  3. JMeter——简单的接口测试实例(一)

    场景:使用JMeter来实现接口测试 基本流程:添加线程组->添加http信息头管理器->添加http请求->添加断言->添加监听器->执行,查看结果 案例分析:下面以办 ...

  4. windows10上pip install channels

    之前一直在MBP上做开发,在windows偶尔改一次代码,最近在windows上Pipi nstall了一次Django Channels,其中到twisted那步出现数坑 1. Microsoft  ...

  5. Scala编程入门---数组操作之Array.ArrayBuffer以及遍历数组

    在Scala中,Array代表的含义与Java类似,也是长度不可改变的数组.此外,由于Scala与java都是运行在JVM中,双方可以互相调用,因此Scala数组底层实际上是java数组.列如字符串数 ...

  6. Dubbo分布式服务框架入门使用

    概念: Provider 暴露服务方称之为"服务提供者". Consumer 调用远程服务方称之为"服务消费者". Registry 服务注册与发现的中心目录服 ...

  7. OpenCASCADE Texture Mapping

    OpenCASCADE Texture Mapping eryar@163.com Abstract. 纹理贴图技术的出现和流行是图形显示技术的一个非常重要的里程碑,直接影响3D技术从工业进入娱乐领域 ...

  8. D3中的each() 以及svg defs元素 clipPath的使用

    each() 方法允许我们定制对选择集中DOM元素的处理行为: selection . each ( func ) 参数 func 是调用者定义的函数,在d3中被称为 访问器/accessor . d ...

  9. linux系统下安装tomcat服务器

    一.首先需要关闭linux防火墙(重启后生效) chkconfig iptables off 二.从官网上下载Linux合适版本的tomcat,我现在下来的文件为apache-tomcat-8.5.3 ...

  10. css绝对底部的实现方法

    最近发现公司做的好多管理系统也存在这样的问题,当页面不够长的时候,页尾也跟着跑到了页面中部,这样确实感觉视觉体验不太好,没有研究之前还真不知道还能用css实现,主要利用min-height;paddi ...