张高兴的 Windows 10 IoT 开发笔记:0.96 寸 I2C OLED
2020-01-15 09:33
876 查看
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
/// <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();
转载于:https://www.cnblogs.com/zhanggaoxing/p/8259026.html
- 点赞
- 收藏
- 分享
- 文章举报
相关文章推荐
- 张高兴的 Windows 10 IoT 开发笔记:0.96 寸 I2C OLED
- 张高兴的 Windows 10 IoT 开发笔记:无线收发芯片 nRF24L01
- 张高兴的 Windows 10 IoT 开发笔记:FM 电台模块 KT0803L
- 张高兴的 Windows 10 IoT 开发笔记:使用 MAX7219 驱动数码管
- 张高兴的 Windows 10 IoT 开发笔记:串口红外编解码模块 YS-IRTM
- 张高兴的 Windows 10 IoT 开发笔记:ToF Sensor VL53L0X
- 张高兴的 Windows 10 IoT 开发笔记:部署 ASP.NET Core 2 应用
- 张高兴的 Windows 10 IoT 开发笔记:三轴数字罗盘 HMC5883L
- 张高兴的 Windows 10 IoT 开发笔记:DHT11 温湿度传感器
- 张高兴的 Windows 10 IoT 开发笔记:BH1750FVI 光照度传感器
- 张高兴的 Windows 10 IoT 开发笔记:红外温度传感器 MLX90614
- 张高兴的 Windows 10 IoT 开发笔记:RTC 时钟模块 DS3231
- 张高兴的 Windows 10 IoT 开发笔记:HC-SR04 超声波测距模块
- 张高兴的 Windows 10 IoT 开发笔记:ADXL345 加速度传感器
- 张高兴的 Windows 10 IoT 开发笔记:FM 电台模块 KT0803L
- 张高兴的 Windows 10 IoT 开发笔记:使用 ADS1115 读取模拟信号
- 张高兴的 Windows 10 IoT 开发笔记:ADXL345 加速度传感器
- 张高兴的 Windows 10 IoT 开发笔记:BMP180 气压传感器
- 张高兴的 Windows 10 IoT 开发笔记:DHT11 温湿度传感器
- 张高兴的 Windows 10 IoT 开发笔记:部署 ASP.NET Core 2 应用