#include <Arduino.h>
#include <Servo.h>
#include <Microduino_Matrix.h>
Servo servo_6;
uint8_t Addr[MatrixPix_X][MatrixPix_Y] =
{
{
64
}
}
;
Matrix display = Matrix(Addr, TYPE_COLOR);
uint8_t rgbArray_64_839259120_1[8][8][3]=
{
{
{184,184,184},{184,184,184},{184,184,184},{184,184,184},{184,184,184},{184,184,184},{184,184,184},{184,184,184}},{{184,184,184},{184,184,184},{184,184,184},{184,184,184},{184,184,184},{184,184,184},{184,184,184},{184,184,184}},{{184,184,184},{184,184,184},{255,0,0},{184,184,184},{184,184,184},{255,0,0},{184,184,184},{184,184,184}},{{184,184,184},{255,0,0},{255,0,0},{255,0,0},{255,0,0},{255,0,0},{255,0,0},{184,184,184}},{{184,184,184},{184,184,184},{255,0,0},{255,0,0},{255,0,0},{255,0,0},{184,184,184},{184,184,184}},{{184,184,184},{184,184,184},{184,184,184},{255,0,0},{255,0,0},{184,184,184},{184,184,184},{184,184,184}},{{184,184,184},{184,184,184},{184,184,184},{184,184,184},{184,184,184},{184,184,184},{184,184,184},{184,184,184}},{{184,184,184},{184,184,184},{184,184,184},{184,184,184},{184,184,184},{184,184,184},{184,184,184},{184,184,184}
}
}
;
uint8_t rgbArray_64_670693842_2[8][8][3]=
{
{
{184,184,184},{184,184,184},{184,184,184},{184,184,184},{184,184,184},{184,184,184},{184,184,184},{184,184,184}},{{184,184,184},{184,184,184},{0,255,255},{184,184,184},{184,184,184},{0,255,255},{184,184,184},{184,184,184}},{{184,184,184},{0,255,255},{255,0,0},{0,255,255},{0,255,255},{255,0,0},{0,255,255},{184,184,184}},{{0,255,255},{255,0,0},{255,0,0},{255,0,0},{255,0,0},{255,0,0},{255,0,0},{0,255,255}},{{184,184,184},{0,255,255},{255,0,0},{255,0,0},{255,0,0},{255,0,0},{0,255,255},{184,184,184}},{{184,184,184},{184,184,184},{0,255,255},{255,0,0},{255,0,0},{0,255,255},{184,184,184},{184,184,184}},{{184,184,184},{184,184,184},{184,184,184},{0,255,255},{0,255,255},{184,184,184},{184,184,184},{184,184,184}},{{184,184,184},{184,184,184},{184,184,184},{184,184,184},{184,184,184},{184,184,184},{184,184,184},{184,184,184}
}
}
;
void setup()
{
Serial.begin(9600);
servo_6.attach(6);
Wire.begin();
}
void loop()
{
Serial.println(analogRead(A0));
if(((analogRead(A0)) > 100))
{
var_delay=0.1;
servo_6.write(0);
}
else
{
var_delay=1;
servo_6.write(90);
}
for (int y = 0; y < 8; y++)
{
for (int x = 0; x <8; x++)
{
display.setLedColor(x, y, rgbArray_64_839259120_1[y][x][0], rgbArray_64_839259120_1[y][x][1],rgbArray_64_839259120_1[y][x][2]);
}
}
delay((var_delay)*1000);
for (int y = 0; y < 8; y++)
{
for (int x = 0; x <8; x++)
{
display.setLedColor(x, y, rgbArray_64_670693842_2[y][x][0], rgbArray_64_670693842_2[y][x][1],rgbArray_64_670693842_2[y][x][2]);
}
}
delay((var_delay)*1000);
}
创建时间:2018/12/15
作者: |
立即注册