【示例】Windows 10 IoT使用HD44780 LCD模块进行显示
本帖最后由 士官长 于 2016-3-18 18:19 编辑
***附件停止解析***
通过本文的操作,你就应该能够加强动手能力,同时学会如何对一些 LCD 显示模块进行使用和操作。本文的方法很简单,重在动手,如果你看不懂代码,这后面肯定要加强学习的。
首先,你需要以下东西:
[list]
[*]HD44780 LCD模块(或其它)
[*]74HC595移位寄存器
[*]220欧姆电阻
[*]10K欧姆微调电位计(22K或者47K皆可)
[/list]
原理图
***附件停止解析***
***附件停止解析***
两个演示示例(代码)
演示一(英国BBC的RSS)
[mw_shl_code=cpp,true] class RssDemo { public async Task RunAsync() { //write a static string DriverHD44780.Instance.DrawString( "Getting RSS...", new Point(0, 0) ); //get the latest news using a normal HTTP GET request var http = new HttpClient(); var endpoint = new Uri("***链接停止解析***); var srss = await http.GetStringAsync(endpoint); var xrss = XDocument.Parse(srss); //extract the news items, and sort them by date-time descending var xnews = xrss.Root .Element("channel") .Elements("item") .OrderByDescending(_ => (DateTime)_.Element("pubDate")) .ToList(); int n = 0; while (true) { /** * Loop the news as one per page **/ //the first row is for the publication date-time var dt = (DateTime)xnews[n].Element("pubDate"); DriverHD44780.Instance.DrawString( dt.ToString("g"), new Point(0, 0) ); //the three other rows are for the title var title = (string)xnews[n].Element("title"); title = title + new string(' ', 60); for (int row = 0; row < 3; row++) { DriverHD44780.Instance.DrawString( title.Substring(row * 20, 20), new Point(0, row + 1) ); } //wait some seconds before flipping page n = (n + 1) % xnews.Count; await Task.Delay(3000); } } }[/mw_shl_code]
***附件停止解析***
演示二(Basic Demo)
Quote class BasicDemo { public async Task RunAsync() { //write a static string DriverHD44780.Instance.DrawString( "This is a basic demo", new Point(0, 0) ); int n = 0; while (true) { //display a simple counter DriverHD44780.Instance.DrawString( $"Counting...{n}", new Point(0, 1) ); //display current time and date var now = DateTime.Now; DriverHD44780.Instance.DrawString( now.ToString("T") + " ", new Point(0, 2) ); DriverHD44780.Instance.DrawString( now.ToString("M") + " ", new Point(0, 3) ); n++; await Task.Delay(1000); } } }
***附件停止解析***
简单讲解
基于 SPI 的应用。LCD 在显示处理经过两个阶段:从主程序驱动;物理数据传输。其中,太高的SPI时钟速率可能面临由于导线长度的信号而弱化。(***链接停止解析***)
点击附件下载用于 Windows 10 IoT Core 的 LCD 模块驱动
***附件停止解析***
标签: Windows
为防止不可控的内容风险,本站已关闭新用户注册,新贴的发表及评论;
你现在看到的内容只是互联网用户曾经发表的言论快照,仅用于老用户留存纪念,且仅与科技行业相关,全部内容不代表本站观点及立场;
本站重新开放前已针对包括用户隐私、版权保护、信息安全、国家政策在内的各种互联网法律法规要求,执行了隐患内容的自查、屏蔽和删除;
本站目前所属个人主体,未有任何盈利安排与计划,且与原WFUN.COM所属公司不存在任何关联关系;
如果本帖内容或者相关资源侵犯到您的合法权益,或者您认为存在问题,那么请您务必点此举报或投诉!