nucleo +1602 +mbed 显示实验

Dependencies:   TextLCD mbed

Files at this revision

API Documentation at this revision

Comitter:
anywill
Date:
Sun Oct 23 12:36:35 2016 +0000
Commit message:
nucleo +1602 +mbed ????

Changed in this revision

TextLCD.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r 239b59d7fd5f TextLCD.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TextLCD.lib	Sun Oct 23 12:36:35 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/simon/code/TextLCD/#308d188a2d3a
diff -r 000000000000 -r 239b59d7fd5f main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sun Oct 23 12:36:35 2016 +0000
@@ -0,0 +1,36 @@
+//名称:nucleo +1602 +mbed 显示实验
+//1602库
+//
+#include "mbed.h"
+#include "TextLCD.h"
+
+TextLCD lcd{A0,A1,A2,A3,A4,A5,TextLCD::LCD16x2};//初始化接口
+/* 1602接口定义
+1 VSS
+2 VDD
+3 VL液晶偏压信号,调节对比度
+4 RS数据/命令选择端H/L         ---接A0
+5 读/写选择端 H/L              ---L接地 
+6 E使能信号                   ---接A1
+7~10                        ---NC
+11 I/O                       ---A2
+12 I/O                       ---A3    
+13 I/O                       ---A4   
+14 I/O                       ---A5    
+15 I/O                       ---背光+       
+16 I/O                       ---背光-         
+*/
+int main()
+{
+    lcd.cls();//clean screen
+    wait(0.001);
+    for (int i=8;i>=0;i--)//倒计时
+      {
+      lcd.cls();
+      lcd.printf("%d",i);
+      wait(1);     
+      }
+    lcd.cls();
+    lcd.printf("Hello World");//打印到1602
+    
+}
diff -r 000000000000 -r 239b59d7fd5f mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sun Oct 23 12:36:35 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/25aea2a3f4e3
\ No newline at end of file