arduino练习答案

92 Views

7/24

/**

* Copyright(C), 2018-2038, KenRobot.com

* FileName: led_matrix.ino

* Author: 啃萝卜

* Create: 2019/07/23

* Modify: 2019/07/23

*/

 

#include <LedControl.h>

 

LedControl ledControl_0 = LedControl(5, 4, 3, 1);

 

uint8_t led_array[2][8] =

{

{

B00000000,

B01100110,

B11111111,

B11111111,

B01111110,

B00111100,

B00011000,

B00000000

},

{

B00000000,

B00000000,

B00100100,

B01111110,

B00111100,

B00011000,

B00000000,

B00000000

}

};

 

void setup() {

ledControl_0.shutdown(0, false);

ledControl_0.setIntensity(0, 8);

ledControl_0.clearDisplay(0);

}

 

void loop() {

for(int j = 0; j <= 1; j +=1)//j是张数

{

for(int i = 0; i <= 7; i += 1)//i是行数

{

ledControl_0.setRow(0, i, led_array[j][i]);

}

delay(200);

}

 

}

PPAP(生产件批准程序)规范

88 Views