I used esp32, max4466 and a 16x16 dot matrix to output letters normally, but when sound is detected, I wrote a code so that the screen appears on the matrix. The letters are normally output, but the screen breaks when sound is detected. I think it's because of a data conflict, but I'm not sure how to solve this. This is the schematic and code I used.
int A = 25;
int B = 17;
int C = 26;
int D = 16;
int Data_Red = 27;
int Data_Green = 2;
int Clk = 14;
int LE = 15;
int OE = 12;
int MicVal;
int Mic_data = 1850;
int Past_Mic_data = 0;
int Mic_data_control = 0;
int Mic_data_control2 = 0;
unsigned char Dot_char_cnt = 0; //도트매트릭스에 표시 될 문자 카운팅!
unsigned char flag_cnt = 0; //도트매트릭스에 표시 될 색상 카운팅!
unsigned char move_motion = 0;
unsigned int Move_cnt = 16;
unsigned int Move_cnt2 = 0;
unsigned int up_cnt = 0;
unsigned int up_cnt2 = 16;
unsigned int str_speed_cnt = 0;
bool flag_Oe = 0;
unsigned int speed_control = 300; // 도트매트릭스 속도조절
unsigned int procession_control = 3; // 행의 사용선택
unsigned int procession_control2 = 8; // 행의 개수
unsigned int move_motion_control = 0; // 도트매트릭스 동작 컨트롤
unsigned int Reset_control = 0;
int Sound_level = 0;
unsigned int MicVal_speed_control = 0;
int Sound_level_Maximum_control = 0;
unsigned int Sound_level_control = 100;
int procession_control1_timer = 100;
int Mic_data_control_timer = 0;
int Mic_data_control_timer2 = 0;
int Rack_protection = 0;
hw_timer_t *timer = NULL;
portMUX_TYPE timerMux = portMUX_INITIALIZER_UNLOCKED;
void IRAM_ATTR onTimer() { //Timer Interrupt
portENTER_CRITICAL_ISR(&timerMux);
static bool output = HIGH;
digitalWrite(1, output);
output = !output;
static unsigned int string_moving_speed_value = 500;
static unsigned int cnt = 0;
if (flag_Oe)
{
digitalWrite(OE, LOW);
cnt++;
if (cnt >= 5)
{
flag_Oe = 0;
cnt = 0;
digitalWrite(OE, HIGH);
}
}
str_speed_cnt++;
if (str_speed_cnt > string_moving_speed_value) //문자가 머문 후 시프트 시작!
{
str_speed_cnt = speed_control;
Move_cnt--;
Move_cnt2++;
if (Move_cnt == 0 || Move_cnt2 == 16) {
Move_cnt = 16;
Move_cnt2 = 0;
move_motion++;
if (move_motion > 0) {
move_motion = 0;
Dot_char_cnt += 1;
flag_cnt++;
if (flag_cnt == 3)
{
flag_cnt = 0;
}
}
}
}
portEXIT_CRITICAL_ISR(&timerMux);
}
void setup() {
Serial.begin(115200); // pc와 아두이노간 통신라인
pinMode(A, OUTPUT);
pinMode(B, OUTPUT);
pinMode(C, OUTPUT);
pinMode(D, OUTPUT);
pinMode(Data_Red, OUTPUT);
pinMode(Data_Green, OUTPUT);
pinMode(Clk, OUTPUT);
pinMode(LE, OUTPUT);
pinMode(OE, OUTPUT);
pinMode(1, OUTPUT);
timer = timerBegin(0, 80, true);
timerAttachInterrupt(timer, &onTimer, true);
timerAlarmWrite(timer, 100, true);
timerAlarmEnable(timer);
}
void row_dynamic()
{
static unsigned int str_cnt = 0;
switch (str_cnt) //ROW SHIFT!
{
case 0: digitalWrite(A, LOW); digitalWrite(B, LOW); digitalWrite(C, LOW); digitalWrite(D, LOW); break; //1행 LED
case 1: digitalWrite(A, HIGH); digitalWrite(B, LOW); digitalWrite(C, LOW); digitalWrite(D, LOW); break; //2행 LED
case 2: digitalWrite(A, LOW); digitalWrite(B, HIGH); digitalWrite(C, LOW); digitalWrite(D, LOW); break; //3행 LED
case 3: digitalWrite(A, HIGH); digitalWrite(B, HIGH); digitalWrite(C, LOW); digitalWrite(D, LOW); break; //4행 LED
case 4: digitalWrite(A, LOW); digitalWrite(B, LOW); digitalWrite(C, HIGH); digitalWrite(D, LOW); break; //5행 LED
case 5: digitalWrite(A, HIGH); digitalWrite(B, LOW); digitalWrite(C, HIGH); digitalWrite(D, LOW); break; //6행 LED
case 6: digitalWrite(A, LOW); digitalWrite(B, HIGH); digitalWrite(C, HIGH); digitalWrite(D, LOW); break; //7행 LED
case 7: digitalWrite(A, HIGH); digitalWrite(B, HIGH); digitalWrite(C, HIGH); digitalWrite(D, LOW); break; //8행 LED
case 8: digitalWrite(A, LOW); digitalWrite(B, LOW); digitalWrite(C, LOW); digitalWrite(D, HIGH); break; //9행 LED
case 9: digitalWrite(A, HIGH); digitalWrite(B, LOW); digitalWrite(C, LOW); digitalWrite(D, HIGH); break; //10행 LED
case 10: digitalWrite(A, LOW); digitalWrite(B, HIGH); digitalWrite(C, LOW); digitalWrite(D, HIGH); break; //11행 LED
case 11: digitalWrite(A, HIGH); digitalWrite(B, HIGH); digitalWrite(C, LOW); digitalWrite(D, HIGH); break; //12행 LED
case 12: digitalWrite(A, LOW); digitalWrite(B, LOW); digitalWrite(C, HIGH); digitalWrite(D, HIGH); break; //13행 LED
case 13: digitalWrite(A, HIGH); digitalWrite(B, LOW); digitalWrite(C, HIGH); digitalWrite(D, HIGH); break; //14행 LED
case 14: digitalWrite(A, LOW); digitalWrite(B, HIGH); digitalWrite(C, HIGH); digitalWrite(D, HIGH); break; //15행 LED
case 15: digitalWrite(A, HIGH); digitalWrite(B, HIGH); digitalWrite(C, HIGH); digitalWrite(D, HIGH); break; //16행 LED
}
str_cnt++;
if (str_cnt == 16)
{
str_cnt = 0;
}
}
void shift_Register(unsigned char out)
{
unsigned char clk = 0;
for (clk = 0; clk < 8; clk++) { //8비트 데이터를 1비트씩 시프트 레지스터에 입력
if (out & (0x80 >> clk))
{
switch (flag_cnt) {
case 0: digitalWrite(Data_Green, LOW); digitalWrite(Data_Red, HIGH); break; //Red
case 1: digitalWrite(Data_Green, HIGH); digitalWrite(Data_Red, LOW); break; //Green
case 2: digitalWrite(Data_Green, HIGH); digitalWrite(Data_Red, HIGH); break; //Orange
}
}
else
{
digitalWrite(Data_Green, LOW); digitalWrite(Data_Red, LOW);
}
digitalWrite(Clk, HIGH);
digitalWrite(Clk, LOW);
}
}
void ActivePulse()
{
digitalWrite(LE, HIGH);
digitalWrite(LE, LOW); //래치 출력
digitalWrite(OE, LOW);
flag_Oe = 1;
}
void Dot_procession_control()
{
MicVal = analogRead(36);
MicVal_speed_control++;
if (MicVal > 1800 && MicVal_speed_control >= 54) {
Mic_data = MicVal;
MicVal_speed_control = 0;
Dot_Sound_level_control();
Past_Mic_data = Mic_data;
}
}
void Dot_Sound_level_control() // 도트가 순차적으로 점등.
{
Serial.print("Mic_data_control ");
Serial.println(Mic_data_control);
if(Mic_data <= 1925) Sound_level = 1;
if(Mic_data >= 1950 && Mic_data < 1975) Sound_level = 2;
if(Mic_data >= 1975 && Mic_data < 2000) Sound_level = 3;
if(Mic_data >= 2000 && Mic_data < 2025) Sound_level = 4;
if(Mic_data >= 2025 && Mic_data < 2050) Sound_level = 5;
if(Mic_data >= 2050 && Mic_data < 2075) Sound_level = 6;
if(Mic_data >= 2075 && Mic_data < 2100) Sound_level = 7;
if(Mic_data >= 2100 && Mic_data < 2125) Sound_level = 8;
if(Mic_data >= 2125 && Mic_data < 2150) Sound_level = 9;
if(Mic_data >= 2150 && Mic_data < 2175) Sound_level = 10;
if(Mic_data >= 2175 && Mic_data < 2200) Sound_level = 11;
if(Mic_data >= 2200 && Mic_data < 2225) Sound_level = 12;
if(Mic_data >= 2225 && Mic_data < 2250) Sound_level = 13;
if(Mic_data >= 2250 && Mic_data < 2275) Sound_level = 14;
if(Mic_data >= 2275) Sound_level = 15;
Serial.print("Sound_level ");
Serial.println(Sound_level);
}
void Dot_Mic_data_control()
{
if (Mic_data_control_timer > 4) Mic_data_control--, Mic_data_control_timer = 0;
if(Mic_data_control < 0) Mic_data_control = 0;
if(Mic_data_control < 800) procession_control = 0;
if(Mic_data_control >= 800 && Mic_data_control < 1900) procession_control = 1;
if(Mic_data_control > 2000 && Rack_protection == 12)
{
if(Mic_data_control > 12000) Mic_data_control = 12000;
procession_control = 3;
}
if(Mic_data > 1950) Mic_data_control++;
Mic_data_control_timer++;
}
void dot1_display_shift(unsigned char first, unsigned char second)
{
static unsigned int i_cnt = 0;
unsigned int buff1[16] = {0}; //Dot1 in
unsigned int buff2[16] = {0}; //Dot2 in
unsigned int buff5[16] = {0}; //Dot1 out
unsigned int buff6[16] = {0}; //Dot2 out
unsigned char high1 = 0; //Dot1
unsigned char low1 = 0; //Dot1
unsigned char high2 = 0; //Dot2
unsigned char low2 = 0; //Dot2
register unsigned int i = 0;
Dot_procession_control();
Dot_Mic_data_control();
if (procession_control == 0){
const int __attribute__((progmem)) string[][16] = {
0x00, 0x1800, 0x18fe, 0x1980, 0x1980, 0x1980, 0x7980, 0x1980, 0x18c0, 0x18c0, 0x1860, 0x1838, 0x180e, 0x1800, 0x00, 0x00, //가
0x00, 0x1800, 0x1806, 0x1806, 0x1806, 0x1806, 0x7806, 0x1806, 0x1806, 0x1806, 0x1806, 0x1806, 0x1bfc, 0x1800, 0x00, 0x00, //나
0x00, 0x1800, 0x19fc, 0x1806, 0x1806, 0x1806, 0x7806, 0x1806, 0x1806, 0x1806, 0x1806, 0x1806, 0x1bfc, 0x1800, 0x00, 0x00, //다
0x00, 0x1800, 0x18fe, 0x1980, 0x1980, 0x1980, 0x7980, 0x18fc, 0x1806, 0x1806, 0x1806, 0x1806, 0x1ffc, 0x1800, 0x00, 0x00, //라
0x00, 0x1800, 0x19fe, 0x1986, 0x1986, 0x1986, 0x7986, 0x1986, 0x1986, 0x1986, 0x1986, 0x1986, 0x19fe, 0x1800, 0x00, 0x00, //마
0x00, 0x1800, 0x1986, 0x1986, 0x1986, 0x1986, 0x79fe, 0x1986, 0x1986, 0x1986, 0x1986, 0x1986, 0x18fc, 0x1800, 0x00, 0x00, //바
0x00, 0x1800, 0x1860, 0x1860, 0x1860, 0x1860, 0x7860, 0x18f0, 0x18f0, 0x1998, 0x1998, 0x1b0c, 0x1b06, 0x1800, 0x00, 0x00, //사
0x00, 0x1800, 0x1878, 0x18cc, 0x1986, 0x1986, 0x7986, 0x1986, 0x1986, 0x1986, 0x1986, 0x18cc, 0x1878, 0x1800, 0x00, 0x00, //아
0x00, 0x1800, 0x1bfc, 0x1860, 0x1860, 0x1860, 0x7870, 0x18f0, 0x18f0, 0x1998, 0x1998, 0x1b0c, 0x1b06, 0x1800, 0x00, 0x00, //자
};
for (i_cnt = 0; i_cnt < 16; i_cnt++) { //우에서 좌로 시프트
if (move_motion == 0 )
{
buff2[i_cnt] = pgm_read_word(&string[first][i_cnt]) << Move_cnt; // 1st String Dot2 in
}
if (move_motion == 1 )
{
buff6[i_cnt] = pgm_read_word(&string[first][i_cnt]) << Move_cnt2; // 1st String Dot2 Out
buff2[i_cnt] = pgm_read_word(&string[second][i_cnt]) << Move_cnt; // 2st String Dot2 in
buff1[i_cnt] = pgm_read_word(&string[first][i_cnt]) << Move_cnt; // 1st String Dot1 in
}
}
speed_control = 0;
procession_control2 = 8;
}
if (procession_control == 1){
const int __attribute__((progmem)) string[][16] = {
0x0000,0x0000,0x07E0,0x0810,0x1008,0x2004,0x2184,0x2184,0x2004,0x2004,0x2004,0x1008,0x0810,0x07E0,0x0000,0x0000,
0x0000,0x0000,0x07E0,0x0810,0x1108,0x2104,0x2104,0x2184,0x2184,0x2004,0x2004,0x1008,0x0810,0x07E0,0x0000,0x0000, //1
0x0000,0x0000,0x07E0,0x0810,0x1008,0x2404,0x2204,0x2184,0x2184,0x2004,0x2004,0x1008,0x0810,0x07E0,0x0000,0x0000, //2
0x0000,0x0000,0x07E0,0x0810,0x1008,0x2004,0x2004,0x2F84,0x2184,0x2004,0x2004,0x1008,0x0810,0x07E0,0x0000,0x0000, //3
0x0000,0x0000,0x07E0,0x0810,0x1008,0x2004,0x2004,0x2184,0x2F84,0x2004,0x2004,0x1008,0x0810,0x07E0,0x0000,0x0000, //4
0x0000,0x0000,0x07E0,0x0810,0x1008,0x2004,0x2004,0x2184,0x2184,0x2204,0x2404,0x1008,0x0810,0x07E0,0x0000,0x0000, //5
0x0000,0x0000,0x07E0,0x0810,0x1008,0x2004,0x2004,0x2184,0x2184,0x2104,0x2104,0x1108,0x0810,0x07E0,0x0000,0x0000, //6
0x0000,0x0000,0x07E0,0x0810,0x1008,0x2004,0x2004,0x2184,0x2184,0x2084,0x2084,0x1088,0x0810,0x07E0,0x0000,0x0000, //7
0x0000,0x0000,0x07E0,0x0810,0x1008,0x2004,0x2004,0x2184,0x2184,0x2044,0x2024,0x1008,0x0810,0x07E0,0x0000,0x0000, //8
0x0000,0x0000,0x07E0,0x0810,0x1008,0x2004,0x2004,0x2184,0x21F4,0x2004,0x2004,0x1008,0x0810,0x07E0,0x0000,0x0000, //9
0x0000,0x0000,0x07E0,0x0810,0x1008,0x2004,0x2004,0x21F4,0x2184,0x2004,0x2004,0x1008,0x0810,0x07E0,0x0000,0x0000, //10
0x0000,0x0000,0x07E0,0x0810,0x1008,0x2024,0x2044,0x2184,0x2184,0x2004,0x2004,0x1008,0x0810,0x07E0,0x0000,0x0000, //11
0x0000,0x0000,0x07E0,0x0810,0x1088,0x2084,0x2084,0x2184,0x2184,0x2004,0x2004,0x1008,0x0810,0x07E0,0x0000,0x0000, //12
0x0000,0x0000,0x07E0,0x0810,0x1008,0x2004,0x2184,0x2184,0x2004,0x2004,0x2004,0x1008,0x0810,0x07E0,0x0000,0x0000
};
for (i_cnt = 0; i_cnt < 16; i_cnt++) { // 제자리 쉬프트
if (move_motion == 0)
{
buff1[i_cnt] = pgm_read_word(&string[first][i_cnt]); // 1st String Dot1
buff2[i_cnt] = pgm_read_word(&string[second][i_cnt]); // 2st String Dot2
if(i_cnt == 15) Rack_protection++;
if(Rack_protection > 12) Rack_protection = 1;
}
}
speed_control = 250;
procession_control2 = 12;
}
if (procession_control == 2)
{
const int __attribute__((progmem)) string[][16] = {
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000
};
for (i_cnt = 0; i_cnt < 16; i_cnt++) { // 제자리 쉬프트
if (move_motion == 0)
{
buff1[i_cnt] = pgm_read_word(&string[first][i_cnt]); // 1st String Dot1
buff2[i_cnt] = pgm_read_word(&string[second][i_cnt]); // 2st String Dot2
}
}
speed_control = 350;
procession_control2 = 0;
}
if (procession_control == 3){
if (Sound_level == 1){
const int __attribute__((progmem)) string[][16] = {
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0001,0x0001,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0001,0x0001,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000
};
for (i_cnt = 0; i_cnt < 16; i_cnt++) { // 제자리 쉬프트
if (move_motion == 0)
{
buff1[i_cnt] = pgm_read_word(&string[first][i_cnt]); // 1st String Dot1
buff2[i_cnt] = pgm_read_word(&string[second][i_cnt]); // 2st String Dot2
}
}
}
if (Sound_level == 2){
const int __attribute__((progmem)) string[][16] = {
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0002,0x0003,0x0003,0x0002,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0002,0x0003,0x0003,0x0002,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0002,0x0003,0x0003,0x0002,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000
};
for (i_cnt = 0; i_cnt < 16; i_cnt++) { // 제자리 쉬프트
if (move_motion == 0)
{
buff1[i_cnt] = pgm_read_word(&string[first][i_cnt]); // 1st String Dot1
buff2[i_cnt] = pgm_read_word(&string[second][i_cnt]); // 2st String Dot2
}
}
Sound_level = 0;
}
if (Sound_level == 3){
const int __attribute__((progmem)) string[][16] = {
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0006,0x0007,0x0007,0x0006,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0006,0x0007,0x0007,0x0006,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0006,0x0007,0x0007,0x0006,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000
};
for (i_cnt = 0; i_cnt < 16; i_cnt++) { // 제자리 쉬프트
if (move_motion == 0)
{
buff1[i_cnt] = pgm_read_word(&string[first][i_cnt]); // 1st String Dot1
buff2[i_cnt] = pgm_read_word(&string[second][i_cnt]); // 2st String Dot2
}
}
Sound_level = 0;
}
if (Sound_level == 4){
const int __attribute__((progmem)) string[][16] = {
0x0000,0x0000,0x0000,0x0000,0x0000,0x0008,0x000E,0x000F,0x000F,0x000E,0x0008,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0008,0x000E,0x000F,0x000F,0x000E,0x0008,0x0000,0x0000,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,0x0000,0x0008,0x000E,0x000F,0x000F,0x000E,0x0008,0x0000,0x0000,0x0000,0x0000,0x0000
};
for (i_cnt = 0; i_cnt < 16; i_cnt++) { // 제자리 쉬프트
if (move_motion == 0)
{
buff1[i_cnt] = pgm_read_word(&string[first][i_cnt]); // 1st String Dot1
buff2[i_cnt] = pgm_read_word(&string[second][i_cnt]); // 2st String Dot2
}
}
Sound_level = 0;
}
if (Sound_level == 5){
const int __attribute__((progmem)) string[][16] = {
0x0020,0x0000,0x0020,0x0000,0x0020,0x0008,0x000E,0x000F,0x000F,0x000E,0x0008,0x0020,0x0000,0x0020,0x0000,0x0020,
0x0020,0x0000,0x0020,0x0000,0x0020,0x0008,0x000E,0x000F,0x000F,0x000E,0x0008,0x0020,0x0000,0x0020,0x0000,0x0020,
0x0020,0x0000,0x0020,0x0000,0x0020,0x0008,0x000E,0x000F,0x000F,0x000E,0x0008,0x0020,0x0000,0x0020,0x0000,0x0020
};
for (i_cnt = 0; i_cnt < 16; i_cnt++) { // 제자리 쉬프트
if (move_motion == 0)
{
buff1[i_cnt] = pgm_read_word(&string[first][i_cnt]); // 1st String Dot1
buff2[i_cnt] = pgm_read_word(&string[second][i_cnt]); // 2st String Dot2
}
}
Sound_level = 0;
}
if (Sound_level == 6){
const int __attribute__((progmem)) string[][16] = {
0x0060,0x0000,0x0060,0x0000,0x0020,0x0048,0x000E,0x000F,0x000F,0x000E,0x0048,0x0020,0x0000,0x0060,0x0000,0x0060,
0x0060,0x0000,0x0060,0x0000,0x0020,0x0048,0x000E,0x000F,0x000F,0x000E,0x0048,0x0020,0x0000,0x0060,0x0000,0x0060,
0x0060,0x0000,0x0060,0x0000,0x0020,0x0048,0x000E,0x000F,0x000F,0x000E,0x0048,0x0020,0x0000,0x0060,0x0000,0x0060
};
for (i_cnt = 0; i_cnt < 16; i_cnt++) { // 제자리 쉬프트
if (move_motion == 0)
{
buff1[i_cnt] = pgm_read_word(&string[first][i_cnt]); // 1st String Dot1
buff2[i_cnt] = pgm_read_word(&string[second][i_cnt]); // 2st String Dot2
}
}
Sound_level = 0;
}
if (Sound_level == 7){
const int __attribute__((progmem)) string[][16] = {
0x00E0,0x0000,0x0060,0x0080,0x0020,0x0048,0x008E,0x008F,0x008F,0x008E,0x0048,0x0020,0x0080,0x0060,0x0000,0x00E0,
0x00E0,0x0000,0x0060,0x0080,0x0020,0x0048,0x008E,0x008F,0x008F,0x008E,0x0048,0x0020,0x0080,0x0060,0x0000,0x00E0,
0x00E0,0x0000,0x0060,0x0080,0x0020,0x0048,0x008E,0x008F,0x008F,0x008E,0x0048,0x0020,0x0080,0x0060,0x0000,0x00E0
};
for (i_cnt = 0; i_cnt < 16; i_cnt++) { // 제자리 쉬프트
if (move_motion == 0)
{
buff1[i_cnt] = pgm_read_word(&string[first][i_cnt]); // 1st String Dot1
buff2[i_cnt] = pgm_read_word(&string[second][i_cnt]); // 2st String Dot2
}
}
Sound_level = 0;
}
if (Sound_level == 8){
const int __attribute__((progmem)) string[][16] = {
0x00E0,0x0100,0x0060,0x0080,0x0120,0x0048,0x008E,0x008F,0x008F,0x008E,0x0048,0x0120,0x0080,0x0060,0x0100,0x00E0,
0x00E0,0x0100,0x0060,0x0080,0x0120,0x0048,0x008E,0x008F,0x008F,0x008E,0x0048,0x0120,0x0080,0x0060,0x0100,0x00E0,
0x00E0,0x0100,0x0060,0x0080,0x0120,0x0048,0x008E,0x008F,0x008F,0x008E,0x0048,0x0120,0x0080,0x0060,0x0100,0x00E0
};
for (i_cnt = 0; i_cnt < 16; i_cnt++) { // 제자리 쉬프트
if (move_motion == 0)
{
buff1[i_cnt] = pgm_read_word(&string[first][i_cnt]); // 1st String Dot1
buff2[i_cnt] = pgm_read_word(&string[second][i_cnt]); // 2st String Dot2
}
}
Sound_level = 0;
}
if (Sound_level == 9){
const int __attribute__((progmem)) string[][16] = {
0x00E0,0x0100,0x0260,0x0080,0x0120,0x0248,0x008E,0x008F,0x008F,0x008E,0x0248,0x0120,0x0080,0x0260,0x0100,0x00E0,
0x00E0,0x0100,0x0260,0x0080,0x0120,0x0248,0x008E,0x008F,0x008F,0x008E,0x0248,0x0120,0x0080,0x0260,0x0100,0x00E0,
0x00E0,0x0100,0x0260,0x0080,0x0120,0x0248,0x008E,0x008F,0x008F,0x008E,0x0248,0x0120,0x0080,0x0260,0x0100,0x00E0
};
for (i_cnt = 0; i_cnt < 16; i_cnt++) { // 제자리 쉬프트
if (move_motion == 0)
{
buff1[i_cnt] = pgm_read_word(&string[first][i_cnt]); // 1st String Dot1
buff2[i_cnt] = pgm_read_word(&string[second][i_cnt]); // 2st String Dot2
}
}
Sound_level = 0;
}
if (Sound_level == 10){
const int __attribute__((progmem)) string[][16] = {
0x00E0,0x0100,0x0260,0x0480,0x0120,0x0248,0x048E,0x048F,0x048F,0x048E,0x0248,0x0120,0x0480,0x0260,0x0100,0x00E0,
0x00E0,0x0100,0x0260,0x0480,0x0120,0x0248,0x048E,0x048F,0x048F,0x048E,0x0248,0x0120,0x0480,0x0260,0x0100,0x00E0,
0x00E0,0x0100,0x0260,0x0480,0x0120,0x0248,0x048E,0x048F,0x048F,0x048E,0x0248,0x0120,0x0480,0x0260,0x0100,0x00E0
};
for (i_cnt = 0; i_cnt < 16; i_cnt++) { // 제자리 쉬프트
if (move_motion == 0)
{
buff1[i_cnt] = pgm_read_word(&string[first][i_cnt]); // 1st String Dot1
buff2[i_cnt] = pgm_read_word(&string[second][i_cnt]); // 2st String Dot2
}
}
Sound_level = 0;
}
if (Sound_level == 11){
const int __attribute__((progmem)) string[][16] = {
0x00E0,0x0100,0x0260,0x0480,0x0920,0x0248,0x048E,0x048F,0x048F,0x048E,0x0248,0x0920,0x0480,0x0260,0x0100,0x00E0,
0x00E0,0x0100,0x0260,0x0480,0x0920,0x0248,0x048E,0x048F,0x048F,0x048E,0x0248,0x0920,0x0480,0x0260,0x0100,0x00E0,
0x00E0,0x0100,0x0260,0x0480,0x0920,0x0248,0x048E,0x048F,0x048F,0x048E,0x0248,0x0920,0x0480,0x0260,0x0100,0x00E0
};
for (i_cnt = 0; i_cnt < 16; i_cnt++) { // 제자리 쉬프트
if (move_motion == 0)
{
buff1[i_cnt] = pgm_read_word(&string[first][i_cnt]); // 1st String Dot1
buff2[i_cnt] = pgm_read_word(&string[second][i_cnt]); // 2st String Dot2
}
}
Sound_level = 0;
}
if (Sound_level == 12){
const int __attribute__((progmem)) string[][16] = {
0x00E0,0x0100,0x0260,0x0480,0x0920,0x1248,0x148E,0x148F,0x148F,0x148E,0x1248,0x0920,0x0480,0x0260,0x0100,0x00E0,
0x00E0,0x0100,0x0260,0x0480,0x0920,0x1248,0x148E,0x148F,0x148F,0x148E,0x1248,0x0920,0x0480,0x0260,0x0100,0x00E0,
0x00E0,0x0100,0x0260,0x0480,0x0920,0x1248,0x148E,0x148F,0x148F,0x148E,0x1248,0x0920,0x0480,0x0260,0x0100,0x00E0
};
for (i_cnt = 0; i_cnt < 16; i_cnt++) { // 제자리 쉬프트
if (move_motion == 0)
{
buff1[i_cnt] = pgm_read_word(&string[first][i_cnt]); // 1st String Dot1
buff2[i_cnt] = pgm_read_word(&string[second][i_cnt]); // 2st String Dot2
}
}
Sound_level = 0;
}
if (Sound_level == 13){
const int __attribute__((progmem)) string[][16] = {
0x00E0,0x0100,0x2260,0x0480,0x0920,0x1248,0x148E,0x148F,0x148F,0x148E,0x1248,0x0920,0x0480,0x0260,0x2100,0x00E0,
0x00E0,0x0100,0x2260,0x0480,0x0920,0x1248,0x148E,0x148F,0x148F,0x148E,0x1248,0x0920,0x0480,0x0260,0x2100,0x00E0,
0x00E0,0x0100,0x2260,0x0480,0x0920,0x1248,0x148E,0x148F,0x148F,0x148E,0x1248,0x0920,0x0480,0x0260,0x2100,0x00E0
};
for (i_cnt = 0; i_cnt < 16; i_cnt++) { // 제자리 쉬프트
if (move_motion == 0)
{
buff1[i_cnt] = pgm_read_word(&string[first][i_cnt]); // 1st String Dot1
buff2[i_cnt] = pgm_read_word(&string[second][i_cnt]); // 2st String Dot2
}
}
Sound_level = 0;
}
if (Sound_level == 14){
const int __attribute__((progmem)) string[][16] = {
0x00E0,0x4100,0x6260,0x4480,0x0920,0x1248,0x148E,0x148F,0x148F,0x148E,0x1248,0x0920,0x0480,0x0260,0x6100,0x00E0,
0x00E0,0x4100,0x6260,0x4480,0x0920,0x1248,0x148E,0x148F,0x148F,0x148E,0x1248,0x0920,0x0480,0x0260,0x6100,0x00E0,
0x00E0,0x4100,0x6260,0x4480,0x0920,0x1248,0x148E,0x148F,0x148F,0x148E,0x1248,0x0920,0x0480,0x0260,0x6100,0x00E0
};
for (i_cnt = 0; i_cnt < 16; i_cnt++) { // 제자리 쉬프트
if (move_motion == 0)
{
buff1[i_cnt] = pgm_read_word(&string[first][i_cnt]); // 1st String Dot1
buff2[i_cnt] = pgm_read_word(&string[second][i_cnt]); // 2st String Dot2
}
}
Sound_level = 0;
}
if (Sound_level == 15){
const int __attribute__((progmem)) string[][16] = {
0x00E0,0x4100,0xE260,0x4480,0x0920,0x1248,0x148E,0x148F,0x148F,0x148E,0x1248,0x0920,0x0480,0x0260,0xE100,0x00E0,
0x00E0,0x4100,0xE260,0x4480,0x0920,0x1248,0x148E,0x148F,0x148F,0x148E,0x1248,0x0920,0x0480,0x0260,0xE100,0x00E0,
0x00E0,0x4100,0xE260,0x4480,0x0920,0x1248,0x148E,0x148F,0x148F,0x148E,0x1248,0x0920,0x0480,0x0260,0xE100,0x00E0
};
for (i_cnt = 0; i_cnt < 16; i_cnt++) { // 제자리 쉬프트
if (move_motion == 0)
{
buff1[i_cnt] = pgm_read_word(&string[first][i_cnt]); // 1st String Dot1
buff2[i_cnt] = pgm_read_word(&string[second][i_cnt]); // 2st String Dot2
}
}
Sound_level = 0;
}
speed_control = 250;
procession_control2 = 2;
}
for (i = 0; i < 16; i++)
{
high1 = (buff1[i] >> 8);
low1 = (buff1[i] & 0xff);
high2 = (buff2[i] >> 8);
low2 = (buff2[i] & 0xff);
shift_Register(high1);
shift_Register(low1);
shift_Register(high2);
shift_Register(low2);
row_dynamic();
ActivePulse();
}
}
void loop() {
dot1_display_shift(Dot_char_cnt, Dot_char_cnt + 1);
if (Dot_char_cnt == procession_control2) {
Dot_char_cnt = 0;
}
}


