2018-10-5 11:20:32 [显示全部楼层]
4572浏览
查看: 4572|回复: 0

[入门教程] [掌控]循环语句编写--创新中国有你有我

[复制链接]
本帖最后由 rzegkly 于 2018-10-5 14:05 编辑

假期里,在大圣老师的帮助下,掌控的第一作品完成后,创客的步伐就停不下来了

     在掌控板上循环交替播放:二高logo和掌控图标

一、OLED屏点阵
[掌控]循环语句编写--创新中国有你有我图1
1、OLED显示技术具有自发光的特性,采用非常薄的有机材料涂层和玻璃基板,当有电流通过时,这些有机材料就会发光,而且OLED显示屏幕可视角度大,并且能够节省电能,以OLED使用的有机发光材料来看,
2、以染料及颜料为材料的小分子器件系统,同时由于有机电致发光器件具有发光二极管整流与发光的特性,因此小分子有机电致发光器件亦被称为OLED(Organic Light Emitting Diode),
3、OLED的基本结构是由一薄而透明具半导体特性之铟锡氧化物(ITO),与电力之正极相连,再加上另一个金属阴极,包成如三明治的结构。整个结构层中包括了:空穴传输层(HTL)、发光层(EL)与电子传输层(ETL)。
4、当电力供应至适当电压时,正极空穴与阴极电荷就会在发光层中结合,产生光亮,依其配方不同产生红、绿和蓝RGB三基色,构成基本色彩。
5、OLED的特性是自己发光,不像TFT LCD需要背光,因此可视度和亮度均高,其次是电压需求低且省电效率高,加上反应快、重量轻、厚度薄,构造简单,成本低等,被视为 21世纪最具前途的产品之一.
6、一行显示不到12个汉字,即占点阵11*11,中文标点占11*11点阵  ,数字约6*9点阵。小写字母约点6*12点阵。大写字母约占8*9点阵。(仅供参考)
二、 处理图片:
1、利用美图秀秀分别将校徽分辨率图片处理成54*54(校徽),掌控板图片分辨率:128*32.[掌控]循环语句编写--创新中国有你有我图2
2、利用取模工具对图片进行取模。网上有PCtoLCDlcd image converter等取模软件,可根据自己喜好自行选择。以下使用的是Img2Lcd工具。
l 步骤1.导入刚才修改后的图片
[掌控]循环语句编写--创新中国有你有我图3
步骤2.选择参数,输出数据类型[C语言数组]、扫描模式[水平扫描]、输出灰度[单色]、宽高[128*64](注意:一定要根据实际图片效果来调整亮度和对比度,已达到最佳显示效果)
l 步骤3.保存数据:点击保存,填写好文件名,自动会弹出图像的取模值。但是我们在使用的时候一定要注意:前面的注释部分(下图中的蓝色部分)不能写入一会儿的程序中。

0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X40,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0XC8,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X01,0X98,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X63,0X30,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X80,0X20,0X40,0X40,0X00,
0X00,0XC6,0X64,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X08,0X90,0X20,0X40,0X43,0XE0,
0X00,0XC6,0X64,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X08,0X90,0X20,0X40,0X43,0XE0,
0X01,0X8C,0XCC,0X00,0X07,0X80,0X0C,0XC0,0X00,0X00,0X1F,0XFC,0X23,0XF8,0X44,0X00,
0X03,0X19,0X98,0X00,0X07,0XC0,0X0C,0XC0,0X00,0X00,0X20,0X02,0XFC,0X09,0XF8,0X00,
0X06,0X13,0X30,0X00,0X04,0X60,0X0C,0XC0,0X00,0X00,0X2F,0XF2,0X24,0XA8,0X4F,0XE0,
0X04,0X10,0X60,0XFD,0XE4,0X78,0X5E,0XFC,0X7C,0XF8,0X08,0X08,0X21,0X30,0XC8,0X00,
0X0C,0X98,0XCC,0XC6,0X24,0XC8,0XCC,0XC4,0XC4,0XCC,0X07,0XF0,0X22,0X18,0X6A,0X20,
0X0B,0XCC,0X18,0XC6,0X37,0XCC,0X8C,0XC6,0X86,0X84,0X00,0X00,0X24,0X09,0X69,0X20,
0X08,0X86,0X30,0XC6,0X34,0X05,0X8C,0XC6,0X86,0X84,0X00,0X80,0X71,0XF1,0X79,0X40,
0X08,0X03,0X60,0XC6,0X34,0X07,0X8C,0XC6,0X86,0X84,0X1F,0XF8,0X20,0X41,0X58,0XC0,
0X0C,0X01,0XC0,0XC6,0X34,0X07,0X0C,0XC6,0XEC,0X84,0X00,0X80,0X20,0X41,0X48,0XC0,
0X04,0XCD,0X80,0X46,0X34,0X03,0X06,0XC4,0X38,0X84,0X3F,0XFE,0X20,0X41,0X49,0X60,
0X06,0X73,0X00,0X00,0X00,0X02,0X00,0X00,0X00,0X00,0X00,0X80,0X20,0X40,0X4A,0X20,
0X03,0X06,0X00,0X00,0X00,0X06,0X00,0X00,0X00,0X00,0X07,0X00,0XC7,0XF8,0X48,0X10,
0X01,0XFC,0X00,0X00,0X00,0X06,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
三、编程
1、显示“创新中国 有你有我 ”程序如下:
第一部分:调用库文件
from mpython import * #导入库文件
import framebuf

import time  
第二部分:设置图片的数组,该部分数组来自图像取模工具,就是刚才我们生成的校徽和掌控两个c文件,
[掌控]循环语句编写--创新中国有你有我图4

第三部分:创建缓存,读取图片
fb2 = framebuf.FrameBuffer(bmp2,128,32, framebuf.MONO_HLSB)   #创建128x64大小帧缓存区储存图片帧,水平扫描      #oled

第四部分:主程序部分
[掌控]循环语句编写--创新中国有你有我图5

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

为本项目制作心愿单
购买心愿单
心愿单 编辑
[[wsData.name]]

硬件清单

  • [[d.name]]
btnicon
我也要做!
点击进入购买页面
上海智位机器人股份有限公司 沪ICP备09038501号-4 备案 沪公网安备31011502402448

© 2013-2024 Comsenz Inc. Powered by Discuz! X3.4 Licensed

mail