极客工坊

 找回密码
 注册

QQ登录

只需一步,快速开始

楼主: 迷你强

Arduino入门教程--第十八课--Arduino驱动数码管

  [复制链接]
发表于 2017-5-17 14:53:27 | 显示全部楼层
謝謝大大分享,受益良多。
回复 支持 反对

使用道具 举报

发表于 2017-7-19 21:36:16 | 显示全部楼层
<一一巛 发表于 2013-3-4 16:51
交作业
精炼代码循环显示0~9

借楼谢谢
各位大神看看哪里不对

int n5[8]={0,1,0,0,1,0,0,1};
  z=0;
  for(int x=2;x<=9;x++)
  {
    digitalWrite(x,n5[z]);
    z++;
    if (z>=9)
    z=0;
  }
delay(1000);
}

int n6[8]={0,1,0,0,0,0,0,1};
  z=0;
  for(int x=2;x<=9;x++)
  {
    digitalWrite(x,n6[z]);
    z++;
    if (z>=9)
    z=0;
  }
delay(1000);
}

int n7[8]={0,0,0,1,1,1,1,1};
  z=0;
  for(int x=2;x<=9;x++)
  {
    digitalWrite(x,n5[z]);
    z++;
    if (z>=9)
    z=0;
  }
delay(1000);
}

int n8[8]={0,0,0,0,0,0,0,1};
  z=0;
  for(int x=2;x<=9;x++)
  {
    digitalWrite(x,n5[z]);
    z++;
    if (z>=9)
    z=0;
  }
delay(1000);
}

int n9[8]={0,0,0,0,1,0,0,1};
  z=0;
  for(int x=2;x<=9;x++)
  {
    digitalWrite(x,n5[z]);
    z++;
    if (z>=9)
    z=0;
  }
delay(1000);
}
回复 支持 反对

使用道具 举报

发表于 2018-3-14 10:05:33 | 显示全部楼层

都是牛人,我 一直努力学习中,点个赞
回复 支持 反对

使用道具 举报

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

本版积分规则 需要先绑定手机号

Archiver|联系我们|极客工坊

GMT+8, 2024-4-20 07:21 , Processed in 0.052480 second(s), 19 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2021, Tencent Cloud.

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