Espruino中文社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 3262|回复: 4

这个代码执行完,你猜会显示什么?

[复制链接]

6

主题

21

帖子

110

积分

注册会员

Rank: 2

积分
110
发表于 2014-7-11 00:58:39 | 显示全部楼层 |阅读模式
Nano JS Board+Sharp Memory LCD 这个代码执行完,你猜会显示什么?
by qq:20437023

[mw_shl_code=javascript,true]
/*
Nano JS Board+Sharp Memory LCD 这个代码执行完,你猜会显示什么?
by qq:20437023
*/

SPI1.setup({ sck:B3, mosi:B5, order: "lsb", baud: 1000000 });

var g = require("MemoryLCD").connect(SPI1, B4/*SCS*/, C12/*EXTCOMIN*/,128/*宽*/, 128/*高*/);
g.clear();
g.setFontVector(20);

var img1 = {width : 32, height : 32, bpp : 1,  transparent : 0,  buffer : new Uint8Array([
0b00000000,0b00000000,0b00000000,0b00000000,0b00000000,0b00000000,0b00000000,0b00000000,
0b00000000,0b00000001,0b10000000,0b00000000,0b00000000,0b00000001,0b10000000,0b00000000,
0b00000000,0b00000001,0b10000000,0b00000000,0b00000000,0b00000001,0b10000000,0b00000000,
0b00000000,0b00000001,0b10000000,0b00000000,0b00000000,0b00000001,0b10000000,0b00000000,
0b00000000,0b00000001,0b10000000,0b00000000,0b00000111,0b11111111,0b11111111,0b11100000,
0b00000111,0b11111111,0b11111111,0b11100000,0b00000100,0b00000001,0b10000000,0b00100000,
0b00000100,0b00000001,0b10000000,0b00100000,0b00000100,0b00000001,0b10000000,0b00100000,
0b00000100,0b00000001,0b10000000,0b00100000,0b00000100,0b00000001,0b10000000,0b00100000,
0b00000100,0b00000001,0b10000000,0b00100000,0b00000100,0b00000001,0b10000000,0b00100000,
0b00000111,0b11111111,0b11111111,0b11100000,0b00000111,0b11111111,0b11111111,0b11100000,
0b00000100,0b00000001,0b10000000,0b00100000,0b00000100,0b00000001,0b10000000,0b00100000,
0b00000000,0b00000001,0b10000000,0b00000000,0b00000000,0b00000001,0b10000000,0b00000000,
0b00000000,0b00000001,0b10000000,0b00000000,0b00000000,0b00000001,0b10000000,0b00000000,
0b00000000,0b00000001,0b10000000,0b00000000,0b00000000,0b00000001,0b10000000,0b00000000,
0b00000000,0b00000001,0b10000000,0b00000000,0b00000000,0b00000001,0b10000000,0b00000000,
0b00000000,0b00000001,0b10000000,0b00000000,0b00000000,0b00000000,0b00000000,0b00000000,
]).buffer};

var img2 = {width : 32, height : 32, bpp : 1,  transparent : 0,  buffer : new Uint8Array([
0b00000000,0b00000000,0b00000000,0b00000000,0b00000000,0b00000000,0b00000000,0b00000000,
0b00000000,0b00000000,0b00000000,0b00000000,0b00000000,0b00000110,0b00000000,0b00000000,
0b00000000,0b00000010,0b00000000,0b00000000,0b00000000,0b00000011,0b00000000,0b00000000,
0b00000000,0b00000001,0b00000000,0b00000000,0b00000000,0b00000000,0b00000000,0b00000000,
0b00111111,0b11111111,0b11111111,0b11111000,0b00111111,0b11111111,0b11111111,0b11111000,
0b00111111,0b11111111,0b11111111,0b11111000,0b00000000,0b10000000,0b00000100,0b00000000,
0b00000000,0b01000000,0b00000100,0b00000000,0b00000000,0b01000000,0b00000100,0b00000000,
0b00000000,0b01000000,0b00001100,0b00000000,0b00000000,0b00100000,0b00001000,0b00000000,
0b00000000,0b00100000,0b00001000,0b00000000,0b00000000,0b00100000,0b00010000,0b00000000,
0b00000000,0b00010000,0b00010000,0b00000000,0b00000000,0b00011000,0b00100000,0b00000000,
0b00000000,0b00001000,0b01100000,0b00000000,0b00000000,0b00000100,0b01000000,0b00000000,
0b00000000,0b00000111,0b10000000,0b00000000,0b00000000,0b00000011,0b10000000,0b00000000,
0b00000000,0b00000111,0b11000000,0b00000000,0b00000000,0b00001100,0b01110000,0b00000000,
0b00000000,0b00111000,0b00111100,0b00000000,0b00000000,0b11110000,0b00001111,0b10000000,
0b00001111,0b11000000,0b00000011,0b11111100,0b00011111,0b00000000,0b00000000,0b11111000,
0b00001000,0b00000000,0b00000000,0b00010000,0b00000000,0b00000000,0b00000000,0b00000000,
]).buffer};

var img3 = {width : 32, height : 32, bpp : 1,  transparent : 0,  buffer : new Uint8Array([
0b00000000,0b00000000,0b00000000,0b00000000,0b00000000,0b00000000,0b00000000,0b00000000,
0b00000000,0b10000000,0b00000100,0b00000000,0b00000001,0b10000000,0b00000100,0b00000000,
0b00000000,0b10000000,0b00000100,0b00000000,0b00000000,0b11000000,0b00000100,0b00000000,
0b00000000,0b00000000,0b00000100,0b00000000,0b00000000,0b00000000,0b00000100,0b00000000,
0b00000000,0b00000000,0b00000100,0b00000000,0b00000000,0b00000000,0b00000100,0b00000000,
0b00111111,0b11110000,0b00000100,0b00000000,0b00111111,0b11100001,0b11111111,0b11110000,
0b00000000,0b01100001,0b11111111,0b11110000,0b00000000,0b01000001,0b11111111,0b11110000,
0b00000000,0b11000000,0b00000100,0b00000000,0b00000000,0b10000000,0b00000100,0b00000000,
0b00000001,0b10000000,0b00000100,0b00000000,0b00000011,0b10110000,0b00000100,0b00000000,
0b00000111,0b10011000,0b00000100,0b00000000,0b00001100,0b10001000,0b00000100,0b00000000,
0b00111000,0b10000100,0b00000100,0b00000000,0b00110000,0b10000000,0b00000100,0b00000000,
0b00000000,0b10000000,0b00000100,0b00000000,0b00000000,0b10000000,0b00000100,0b00000000,
0b00000000,0b10000000,0b00000100,0b00000000,0b00000000,0b10000000,0b00000100,0b00000000,
0b00000000,0b10000000,0b00000100,0b00000000,0b00000000,0b10000111,0b11111111,0b11111100,
0b00000000,0b10000111,0b11111111,0b11111100,0b00000000,0b10000000,0b00000000,0b00000000,
0b00000000,0b10000000,0b00000000,0b00000000,0b00000000,0b00000000,0b00000000,0b00000000,
]).buffer};

var img4 = {width : 32, height : 32, bpp : 1,  transparent : 0,  buffer : new Uint8Array([
0b00000000,0b00000000,0b00000000,0b00000000,0b00000000,0b00000000,0b00000000,0b00000000,
0b00000000,0b00000000,0b00000000,0b00000000,0b00001111,0b11111111,0b11111111,0b11111000,
0b00001111,0b11111111,0b11111111,0b11111000,0b00001000,0b00000000,0b00000000,0b00000000,
0b00001000,0b00000000,0b00000000,0b00000000,0b00001000,0b00000000,0b00000000,0b00000000,
0b00001000,0b00000000,0b00000000,0b00000000,0b00001000,0b00000000,0b00000001,0b11000000,
0b00001000,0b00011000,0b00000001,0b10000000,0b00001000,0b00001110,0b00000011,0b00000000,
0b00001000,0b00000111,0b00000110,0b00000000,0b00001000,0b00000011,0b10000100,0b00000000,
0b00001000,0b00000000,0b11111100,0b00000000,0b00001000,0b00000000,0b01111000,0b00000000,
0b00001000,0b00000000,0b00111000,0b00000000,0b00001000,0b00000000,0b01111100,0b00000000,
0b00001000,0b00000000,0b11001110,0b00000000,0b00001000,0b00000001,0b10000111,0b00000000,
0b00001000,0b00000011,0b00000001,0b10000000,0b00001000,0b00000110,0b00000000,0b11000000,
0b00001000,0b00001100,0b00000000,0b01100000,0b00001000,0b00111000,0b00000000,0b01100000,
0b00001000,0b01110000,0b00000000,0b00000000,0b00001000,0b00000000,0b00000000,0b00000000,
0b00001000,0b00000000,0b00000000,0b00000000,0b00001000,0b00000000,0b00000000,0b00000000,
0b00001111,0b11111111,0b11111111,0b11111000,0b00001111,0b11111111,0b11111111,0b11111000,
0b00000000,0b00000000,0b00000000,0b00000000,0b00000000,0b00000000,0b00000000,0b00000000,
]).buffer};

g.drawString("Espruino",0,0);
g.drawImage(img1, 0, 50);
g.drawImage(img2, 33, 50);
g.drawImage(img3, 66, 50);
g.drawImage(img4, 99, 50);

g.flip();
save();[/mw_shl_code]






26

主题

92

帖子

4万

积分

论坛元老

Rank: 8Rank: 8

积分
40603

最佳新人活跃会员突出贡献论坛元老

发表于 2014-7-23 21:48:16 | 显示全部楼层
中文社区  四个大字:lol

26

主题

92

帖子

4万

积分

论坛元老

Rank: 8Rank: 8

积分
40603

最佳新人活跃会员突出贡献论坛元老

发表于 2014-8-2 23:10:41 | 显示全部楼层
手里的lcd没了,只能拿这个试试了,看看结果哈 QQ图片20140802230827.jpg

10

主题

43

帖子

525

积分

高级会员

Rank: 4

积分
525
发表于 2014-8-3 03:10:47 | 显示全部楼层
这板子应该也能控制类似街上的招牌那样,几米长的LED吧?
Learning & Sharing

26

主题

92

帖子

4万

积分

论坛元老

Rank: 8Rank: 8

积分
40603

最佳新人活跃会员突出贡献论坛元老

发表于 2014-8-3 15:01:52 | 显示全部楼层
JaVaScRiPt 发表于 2014-8-3 03:10
这板子应该也能控制类似街上的招牌那样,几米长的LED吧?

控制是肯定可以的,
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|手机版|Archiver|Espruino中文社区 ( 苏14007051 )

GMT+8, 2019-7-19 13:56 , Processed in 0.233923 second(s), 24 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表