前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >张高兴的 Windows 10 IoT 开发笔记:0.96 寸 I2C OLED

张高兴的 Windows 10 IoT 开发笔记:0.96 寸 I2C OLED

作者头像
张高兴
发布2018-05-18 15:43:44
7350
发布2018-05-18 15:43:44
举报
文章被收录于专栏:张高兴的博客张高兴的博客

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/OLED

Image

Connect

  • SDA - Pin3
  • SCL - Pin5
  • VCC - 5V
  • GND - GND

Reference

https://github.com/ZhangGaoxing/windows-iot-demo/tree/master/OLED/Reference

What Contains

In OLED.cs file

代码语言:javascript
复制
/// <summary>
/// Initialize the OLED
/// </summary>
public async Task InitializeAsync();

/// <summary>
/// Show character on OLED
/// </summary>
/// <param name="x">x-coordinate</param>
/// <param name="y">y-coordinate / 8 !!!</param>
/// <param name="width">Character Width</param>
/// <param name="height">Character Height</param>
/// <param name="charData">Character Data (common-cathode, column-row, and reverse ou
public void ShowChar(int x, int y, byte width, byte height, byte[] charData);

/// <summary>
/// Send command
/// </summary>
/// <param name="command">Command</param>
private void WriteCommand(byte command);

/// <summary>
/// Send the data which you want to show on the OLED
/// </summary>
/// <param name="data">Data</param>
public void WriteData(byte data);

/// <summary>
/// Set start point (cursor)
/// </summary>
/// <param name="x">x-coordinate</param>
/// <param name="y">y-coordinate / 8 !!!</param>
public void SetPoint(int x, int y);

/// <summary>
/// Fill the OLED with data (input 0xFF to fill, 0x00 to clear)
/// </summary>
public void FillScreen(byte data1, byte data2);

/// <summary>
/// Cleanup
/// </summary>
public void Dispose();

/// <summary>
/// Init command
/// </summary>
private void InitCommand();

How to Use

  • First, you need to create a OLED object. After that you should call InitializeAsync() to initialize. OLED oled = new OLED(); await oled.InitializeAsync();
  • Secondly oled.ShowChar(0, 0, 16, 16, bytes);
  • If you want to close the sensor, call Dispose(). oled.Dispose();
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2018-01-10 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • Image
  • Connect
  • Reference
  • What Contains
  • How to Use
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档