V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
爱意满满的作品展示区。
gleport
V2EX  ›  分享创造

发布一个玩具:在软件上模拟 led 风扇

  •  1
     
  •   gleport · 2015-03-25 22:03:56 +08:00 · 3117 次点击
    这是一个创建于 3291 天前的主题,其中的信息可能已经有所发展或是发生改变。

    缺省跑 nyancat.
    Github repo: https://github.com/hmgle/led_fan
    8 条回复    2015-03-31 22:18:10 +08:00
    wdongxv
        1
    wdongxv  
       2015-03-25 22:13:49 +08:00 via iPhone
    太尼玛好玩了,马上玩一下
    imeoer
        2
    imeoer  
       2015-03-26 19:04:35 +08:00
    好好玩 要是能直接在terminal跑就更酷了
    gleport
        3
    gleport  
    OP
       2015-03-26 19:53:00 +08:00
    @imeoer 嗯, 不过直接在 termina 上模拟 led 风扇有两个难点呢: 一是很难精确控制每个像素, 二是渲染的时钟不能精确控制.
    直接在 termina 上运行的彩虹猫是有的: https://github.com/klange/nyancat
    led_fan 里面的 nyancat.h 也是由此修改衍生的~
    imeoer
        4
    imeoer  
       2015-03-28 13:50:33 +08:00
    @gleport 效果很赞,不过我跑了一会风扇真的开始转了 233
    gleport
        5
    gleport  
    OP
       2015-03-28 17:09:51 +08:00
    @imeoer haha~ 现在为了显示效果好一点默认用了 200 fps 的帧率呢, 所以 CPU 占用率高.
    不过不要紧, 接下来考虑接受一些常用的传入的参数, 比如帧率, 起始角度, 旋转周期, 扇叶数等 233
    tobyxdd
        6
    tobyxdd  
       2015-03-29 23:30:54 +08:00
    https://github.com/tobyxdd/led_fan
    做了个粗糙的Windows移植= =
    Solitudechn
        7
    Solitudechn  
       2015-03-31 13:42:05 +08:00 via Android
    什么终端?很好看的样子?还是程序界面?
    gleport
        8
    gleport  
    OP
       2015-03-31 22:18:10 +08:00
    @Solitudechn 界面是用 SDL2 渲染的.
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3545 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 04:53 · PVG 12:53 · LAX 21:53 · JFK 00:53
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.