查看“The Use of OLED”的源代码
←
The Use of OLED
跳转至:
导航
、
搜索
因为以下原因,您没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
{{Language| The Use of OLED }} {| style="width: 800px;" |- | ==Objective== To know Microduino-OlED and learn how to use libraries to drive the OLED screen. ==Equipment== {|class="wikitable" |- |Module||Number||Function |- |[[Microduino-CoreUSB]]||1||Core board |- |[[Microduino-OLED]]||1||OLED display screen |- |} [[File:ble_OLED.jpg|600px|center]] ==Program== Program download: [https://github.com/Microduino/Microduino_Tutorials/tree/master/Microduino_Advanced/Microduino_OLED Microduino_OLED] ==Experiment One== *Display characters including specified and data changed characters. Open OLED_Text test program, select the right board(CoreUSB) and download via the serial port. Result: *The specified character "*_*Microduino*_*" is displayed on the first line; * The specified character "Time:"is displayed on the second line; *The third shows mills() function. Here we adopt millisecond as the time unit and keep two decimal fractions. *Grammar: **u8g.setFont(XXX) function is used for setting font. If there is no default font, you have to define one. **u8g.setPrintPos(X,Y) is used for specified coordinate. "X" means horizontal coordinate and "Y" means vertical coordinate. The Y values on the top line cannot be "0" and must bigger than the height of the display font; **u8g.print(XXX) is for displaying characters. Static characters have to be noted with””and the changed data needn't; **u8g.drawStr(X, Y,XXX) can be used for displaying specified characters and can't be adopted for displaying changed data; **u8g.setRot180() is for font rotation. You can change the rotation angle from 180 to 90 or 270. The default is 0. **If you want to change the font or coordinate, you need to re-add font or coordinate functions before the displayed functions. **Changing font can refer to the file u8g.h under U8glib\utility. [[File:OLED_TEXT.jpg|600px|center|Microduino-OLED]] ==Experiment Two== *Drawing picture Open OLED_Paint test program. (A straight line, a solid round, round, rectangular hollow, hollow rectangular or a rectangular angle as well as apex angle bending rectangular can be achieved here.) We adopt system timing to simulate the second pointer of the pointer meter. *Grammar: **u8g.drawLine(X,Y,M,N) is used for drawing straight line; ***X:Starting horizontal coordinate. Y:Starting vertical coordinate. M:End vertical coordinate. **u8g.drawDisc(X,Y,D) is used for drawing solid round. ***X:Horizontal coordinate. Y: Vertical coordinate. D: Diameter. **u8g.drawCircle(X,Y,D) is for drawing hollow round; *** X:Horizontal coordinate. Y: Vertical coordinate. D: Diameter. **u8g.drawFrame(X,Y,I,W) is for drawing hollow rectangular; *** X:Horizontal coordinate. Y: Vertical coordinate. D: Diameter. L: Length. W: Width. **u8g.drawBox(X,Y,I,W) is for drawing solid rectangular; *** X:Horizontal coordinate. Y: Vertical coordinate. D: Diameter. L: Length. W: Width. **u8g.drawRFrame(X,Y,I,W,B) is for drawing apex angle bending rectangular; *** X:Horizontal coordinate. Y: Vertical coordinate. D: Diameter. L: Length. W: Width. [[File: OLED_Paint.jpg|800px|thumb|center|Microduino-OLED]] ==Experiment Three== *Display of Chinese characters, pictures and dynamic text: **Character display can be printed by calling the library and the pictures and Chinese characters have to be printed out by modulus operation Modulus operation will need the Windows: '''[[File:PCtolCD.zip]]''' *Take Chinese character as an example: **Make Chinese character modulus code: Step1: Open modulus software and choose character mode: [[File:set_1.jpg|800px|center|Microduino-OLED]] Step 2: Set 32*32 font; [[File:set_2.jpg|800px|center|Microduino-OLED]] Step 3: Enter Chinese character and you can select font; [[File:set_3.jpg|800px|center|Microduino-OLED]] Step 4: Set modulus format; [[File:set_4.jpg|800px|center|Microduino-OLED]] [[File:set_5.jpg|800px|center|Microduino-OLED]] Step 5: Generate code after setting. [[File:set_6.jpg|800px|center|Microduino-OLED]] Step6: Change the original Chinese character code to the generated code. Grammar: *u8g.drawXBMP( X, Y, I, W, XXXX); ** X:Horizontal coordinate. Y: Vertical coordinate. D: Diameter. L: Length. W: Width. XXXX: Array name of Chinese character code. [[File: OLED_Writing.jpg|800px|thumb|center|Microduino-OLED]] ==Video== |}
该页面使用的模板:
模板:Language
(
查看源代码
)
模板:Nmbox
(
查看源代码
)
返回至
The Use of OLED
。
导航菜单
个人工具
创建账户
登录
名字空间
页面
讨论
变种
视图
阅读
查看源代码
查看历史
更多
搜索
Welcome
首页
创客大赛
大赛详情
3D打印
安装月球车
图形化编程
操控月球车
升级月球车
编程工具下载
软件下载
Arduino
Processing
Mixly
Scratch
模块套件
Microduino 102
mCookie 102
mCookie 202
mCookie 302
IBC
其他
应用套件
四轴飞行器
平衡车
小车CUBE
音乐播放器
刷卡音乐播放器
wifi气象站
彩虹音乐触摸灯
分贝检测仪
迎门汇报
LED点阵时钟
LED点阵屏幕
硬件
mCookie
Sensor
Microduino
MicroWrt
MicroNux
MicroRobot-Core
MicroRobot-CoreESP
ideaBoard
ideaBox
MicroMV
MicroAI
帮助
常见问题
帮助
工具
链入页面
相关更改
特殊页面
页面信息