<一一巛 发表于 2013-3-4 16:51
void setup() {
for(int n=1;n - void setup()
- {
- pinMode(13,OUTPUT);
- for(int n=2; n<=9; n++)
- {
- pinMode(n,OUTPUT);
- }
- }
- void loop()
- {
- digitalWrite(13,HIGH);
-
- int n[10][8] = { 0,0,0,0,0,0,1,0,
- 1,0,0,1,1,1,1,0,
- 0,0,1,0,0,1,0,0, // 2
- 0,0,0,0,1,1,0,0, // 3
- 1,0,0,1,1,0,0,0, // 4
- 0,1,0,0,1,0,0,0, // 5
- 0,1,0,0,0,0,0,0, // 6
- 0,0,0,1,1,1,1,0, // 7
- 0,0,0,0,0,0,0,0, // 8
- 0,0,0,0,1,0,0,0 // 9
- };
-
- for(int i = 0; i<=9; i++){
- for(int j = 2; j<=9;j++)
- digitalWrite(j,n[i][j-2]);
- delay(1000);
- }
- }
复制代码
针对楼主的程序,对9楼牛人的程序稍加修改,可原封不动使用! |