126

Re: управление драйвером жк lc75823

Пока только осилит 4 цифры и счет от 0 до 4

#define CE  10
#define CL  13
#define DI  11

int w;
unsigned long byte_1,byte_2,byte_3,byte_4,byte_5;
unsigned long h1,h2,h3,h4,h5,h6,h7,h8;
unsigned long kav_1=0,dvoetoh=0,toch=1,kav_2=1;

void setup() {
  Serial.begin(9600);
  pinMode(CE, OUTPUT);
  pinMode(CL, OUTPUT);
  pinMode(DI, OUTPUT);
  digitalWrite(CE,LOW);
  digitalWrite(CL,LOW);
  delay(200);
      //  1                             32
//byte_1  00000000000000000000000000000000
      //  33                            64
//byte_2  00000000000000000000000000000000
      //  65                            96
//byte_3  00000000000000000000000000000000



}

void loop() {
  w++;
  if(w>4){w=0;}
  h1 = segm(w); 
  h2 = segm(w); 
  h3 = segm(w);
  h4 = segm(w);
  byte_1 = h1>>6; 
  byte_2 = (h1&0b11111111)<<24 | (h2&0b1111111111000)<<10 |kav_1<<12 | (h2&0b11)<<10 | dvoetoh<<9 | h3>>5; 
  byte_3 = (h3&0b11111)<<27 | toch<<29 | h4<<12;
 
  
  
  write_byte(0x41, byte_1,byte_2,byte_3,byte_4,byte_5,    0b0000);

  delay(1000);

  
 

}

void write_byte(byte addr, unsigned long b0, unsigned long b1, unsigned long b2, unsigned long b3, unsigned long b4, byte contr){
  /// addr 8 bit
     digitalWrite(CE,LOW);
   for(int i = 0; i <= 7; i++){
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (addr >> i) & 1); 
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(CE,HIGH);

// data 156 bit
  // 1-24 seg
     for(int i = 31;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b0 >> i) & 1);
     Serial.print((b0 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     Serial.print(" ");

     for(int i = 31;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b1 >> i) & 1);
     Serial.print((b1 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     Serial.print(" ");

     for(int i = 31;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b2 >> i) & 1);
     Serial.print((b2 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     Serial.print(" ");

     for(int i = 31;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b3 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 

     for(int i = 27;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b4 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     Serial.println();
    
// control data 4 bit     
for(int i = 3; i >= 0; i--){
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (contr >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     digitalWrite(CE,LOW);
     digitalWrite(CL,LOW);
     delay(10);
  }  

int segm(int cif){
  unsigned int data_out;
  switch(cif){
    case 0: data_out=0b11000101000011;break;//0
    case 1: data_out=0b00000000100011;break;//1
    case 2: data_out=0b01010101010010;break;//2
    case 3: data_out=0b00010101010011;break;//3 
    case 4: data_out=0b10010000010011;break;//4  
    case 5: data_out=0b00000000000000;break;//5
    case 6: data_out=0b00000000000000;break;//6
    case 7: data_out=0b00000000000000;break;//7
    case 8: data_out=0b00000000000000;break;//8
    case 9: data_out=0b00000000000000;break;//9
   case 10: data_out=0b00000000000000;break;// пусто
   case 11: data_out=0b11111111111011;break;// все
    
    }
    return data_out;
  }  

127

Re: управление драйвером жк lc75823

#define CE  10
#define CL  13
#define DI  11

int w;
unsigned long byte_1,byte_2,byte_3,byte_4,byte_5;
unsigned long h1,h2,h3,h4,h5,h6,h7,h8;
unsigned long kav_1=0,dvoetoh=0,toch=0,kav_2=0;

void setup() {
  Serial.begin(9600);
  pinMode(CE, OUTPUT);
  pinMode(CL, OUTPUT);
  pinMode(DI, OUTPUT);
  digitalWrite(CE,LOW);
  digitalWrite(CL,LOW);
  delay(200);
      //  1                             32
//byte_1  00000000000000000000000000000000
      //  33                            64
//byte_2  00000000000000000000000000000000
      //  65                            96
//byte_3  00000000000000000000000000000000



}

void loop() {
  w++;
  if(w>4){w=0;}
  h1 = segm(w); 
  h2 = segm(w); 
  h3 = segm(w);
  h4 = segm(w);
  byte_1 = h1>>7; 
  byte_2 = (h1&0b1111111)<<25 | h2<<10 |kav_1<<12 | dvoetoh<<9 | h3>>5; 
  byte_3 = (h3&0b11111)<<27 | toch<<29 | h4<<12 | kav_2<<14;
 
  
  
  write_byte(0x41, byte_1,byte_2,byte_3,byte_4,byte_5,    0b0000);

  delay(1000);

  
 

}

void write_byte(byte addr, unsigned long b0, unsigned long b1, unsigned long b2, unsigned long b3, unsigned long b4, byte contr){
  /// addr 8 bit
     digitalWrite(CE,LOW);
   for(int i = 0; i <= 7; i++){
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (addr >> i) & 1); 
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(CE,HIGH);

// data 156 bit
  // 1-24 seg
     for(int i = 31;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b0 >> i) & 1);
     Serial.print((b0 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     Serial.print(" ");

     for(int i = 31;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b1 >> i) & 1);
     Serial.print((b1 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     Serial.print(" ");

     for(int i = 31;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b2 >> i) & 1);
     Serial.print((b2 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     Serial.print(" ");

     for(int i = 31;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b3 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 

     for(int i = 27;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b4 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     Serial.println();
    
// control data 4 bit     
for(int i = 3; i >= 0; i--){
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (contr >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     digitalWrite(CE,LOW);
     digitalWrite(CL,LOW);
     delay(10);
  }  

int segm(int cif){
  unsigned int data_out;
  switch(cif){
    case 0: data_out=0b11000101000011;break;//0
    case 1: data_out=0b00000000100011;break;//1 
    case 2: data_out=0b01010101010010;break;//2
    case 3: data_out=0b00010101010011;break;//3 
    case 4: data_out=0b10010000010011;break;//4  
    case 5: data_out=0b00000000000000;break;//5
    case 6: data_out=0b00000000000000;break;//6
    case 7: data_out=0b00000000000000;break;//7
    case 8: data_out=0b00000000000000;break;//8
    case 9: data_out=0b00000000000000;break;//9
   case 10: data_out=0b00000000000000;break;// пусто
   case 11: data_out=0b11111111111011;break;// все
    
    }
    return data_out;
  }  

128

Re: управление драйвером жк lc75823

#define CE  10
#define CL  13
#define DI  11

int w;
unsigned long byte_1,byte_2,byte_3,byte_4,byte_5;
unsigned long h1,h2,h3,h4,h5,h6,h7,h8;
unsigned long kav_1=0,dvoetoh=0,toch=0,kav_2=0;

void setup() {
  Serial.begin(9600);
  pinMode(CE, OUTPUT);
  pinMode(CL, OUTPUT);
  pinMode(DI, OUTPUT);
  digitalWrite(CE,LOW);
  digitalWrite(CL,LOW);
  delay(200);
      //  1                             32
//byte_1  00000000000000000000000000000000
      //  33                            64
//byte_2  00000000000000000000000000000000
      //  65                            96
//byte_3  00000000000000000000000000000000
      //  97                           128
//byte_4  00000000000000000000000000000000
      //  129                      156
//byte_5  0000000000000000000000000000



}

void loop() {
  w++;
  if(w>9){w=0;}
  h1 = segm(w); 
  h2 = segm(w); 
  h3 = segm(w);
  h4 = segm(w);
  h5 = segm(w);
  h6 = segm(w);
  h7 = segm(w);
  h8 = segm(w);
  byte_1 = h1>>7; 
  byte_2 = (h1&0b1111111)<<25 | h2<<10 |kav_1<<12 | dvoetoh<<9 | h3>>5; 
  byte_3 = (h3&0b11111)<<27 | toch<<29 | h4<<12 | kav_2<<14 | h5>>3;
  byte_4 = (h5&0b111)<<29 | h6<<14 | h7>>1;
  byte_5 = (h7&1)<<23 | h8<<8;
  
  
  write_byte(0x41, byte_1,byte_2,byte_3,byte_4,byte_5,    0b0000);

  delay(1000);

  
 

}

void write_byte(byte addr, unsigned long b0, unsigned long b1, unsigned long b2, unsigned long b3, unsigned long b4, byte contr){
  /// addr 8 bit
     digitalWrite(CE,LOW);
   for(int i = 0; i <= 7; i++){
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (addr >> i) & 1); 
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(CE,HIGH);

// data 156 bit
  // 1-24 seg
     for(int i = 31;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b0 >> i) & 1);
     Serial.print((b0 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     Serial.print(" ");

     for(int i = 31;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b1 >> i) & 1);
     Serial.print((b1 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     Serial.print(" ");

     for(int i = 31;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b2 >> i) & 1);
     Serial.print((b2 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     Serial.print(" ");

     for(int i = 31;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b3 >> i) & 1);
     Serial.print((b3 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     Serial.print(" ");

     for(int i = 27;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b4 >> i) & 1);
     Serial.print((b4 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     Serial.println();
    
// control data 4 bit     
for(int i = 3; i >= 0; i--){
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (contr >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     digitalWrite(CE,LOW);
     digitalWrite(CL,LOW);
     delay(10);
  }  

int segm(int cif){
  unsigned int data_out;
  switch(cif){
    case 0: data_out=0b11000101000011;break;//0
    case 1: data_out=0b00000000100011;break;//1 
    case 2: data_out=0b01010101010010;break;//2
    case 3: data_out=0b00010101010011;break;//3 
    case 4: data_out=0b10010000010011;break;//4  
    case 5: data_out=0b10010101010001;break;//5 
    case 6: data_out=0b11010101010001;break;//6   
    case 7: data_out=0b00000100000011;break;//7   
    case 8: data_out=0b11010101010011;break;//8   
    case 9: data_out=0b10010101010011;break;//9  
   case 10: data_out=0b00000000000000;break;// пусто
   case 11: data_out=0b11111111111011;break;// все
    
    }
    return data_out;
  }  

129

Re: управление драйвером жк lc75823

#define CE  10
#define CL  13
#define DI  11

int w;
unsigned long byte_1,byte_2,byte_3,byte_4,byte_5;
unsigned long h1,h2,h3,h4,h5,h6,h7,h8;
unsigned long kav_1=0,dvoetoh=0,toch=0,kav_2=0;

void setup() {
  Serial.begin(9600);
  pinMode(CE, OUTPUT);
  pinMode(CL, OUTPUT);
  pinMode(DI, OUTPUT);
  digitalWrite(CE,LOW);
  digitalWrite(CL,LOW);
  delay(200);
      //  1                             32
//byte_1  00000000000000000000000000000000
      //  33                            64
//byte_2  00000000000000000000000000000000
      //  65                            96
//byte_3  00000000000000000000000000000000
      //  97                           128
//byte_4  00000000000000000000000000000000
      //  129                      156
//byte_5  0000000000000000000000000000



}

void loop() {
  w++;
  if(w>9){w=0;}
  h1 = segm(10); 
  h2 = segm(10); 
  h3 = segm(10);
  h4 = segm(10);
  h5 = segm(10);
  h6 = segm(10);
  h7 = segm(11);
  h8 = segm(11);
  byte_1 = h1>>7; 
  byte_2 = (h1&0b1111111)<<25 | h2<<10 |kav_1<<12 | dvoetoh<<9 | h3>>5; 
  byte_3 = (h3&0b11111)<<27 | toch<<29 | h4<<12 | kav_2<<14 | h5>>3;
  byte_4 = (h5&0b111)<<29 | h6<<14 | h7>>1;
  byte_5 = (h7&1)<<23 | h8<<8;
  
  
  write_byte(0x41, byte_1,byte_2,byte_3,byte_4,byte_5,    0b0000);

  delay(100000);

  
 

}

void write_byte(byte addr, unsigned long b0, unsigned long b1, unsigned long b2, unsigned long b3, unsigned long b4, byte contr){
  /// addr 8 bit
     digitalWrite(CE,LOW);
   for(int i = 0; i <= 7; i++){
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (addr >> i) & 1); 
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(CE,HIGH);

// data 156 bit
  // 1-24 seg
     for(int i = 31;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b0 >> i) & 1);
     Serial.print((b0 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     Serial.print(" ");

     for(int i = 31;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b1 >> i) & 1);
     Serial.print((b1 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     Serial.print(" ");

     for(int i = 31;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b2 >> i) & 1);
     Serial.print((b2 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     Serial.print(" ");

     for(int i = 31;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b3 >> i) & 1);
     Serial.print((b3 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     Serial.print(" ");

     for(int i = 27;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b4 >> i) & 1);
     Serial.print((b4 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     Serial.println();
    
// control data 4 bit     
for(int i = 3; i >= 0; i--){
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (contr >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     digitalWrite(CE,LOW);
     digitalWrite(CL,LOW);
     delay(10);
  }  

int segm(int cif){
  unsigned int data_out;
  switch(cif){
    case 0: data_out=0b11000101000011;break;//0
    case 1: data_out=0b00000000100011;break;//1 
    case 2: data_out=0b01010101010010;break;//2
    case 3: data_out=0b00010101010011;break;//3 
    case 4: data_out=0b10010000010011;break;//4  
    case 5: data_out=0b10010101010001;break;//5 
    case 6: data_out=0b11010101010001;break;//6   
    case 7: data_out=0b00000100000011;break;//7   
    case 8: data_out=0b11010101010011;break;//8   
    case 9: data_out=0b10010101010011;break;//9  
   case 10: data_out=0b00000000000000;break;// пусто
   case 11: data_out=0b11111111111011;break;// все
    
    }
    return data_out;
  }  

130

Re: управление драйвером жк lc75823

#define CE  10
#define CL  13
#define DI  11

int w;
unsigned long byte_1,byte_2,byte_3,byte_4,byte_5;
unsigned long h1,h2,h3,h4,h5,h6,h7,h8;
unsigned long kav_1=0,dvoetoh=0,toch=0,kav_2=0;

void setup() {
  Serial.begin(9600);
  pinMode(CE, OUTPUT);
  pinMode(CL, OUTPUT);
  pinMode(DI, OUTPUT);
  digitalWrite(CE,LOW);
  digitalWrite(CL,LOW);
  delay(200);
      //  1                             32
//byte_1  00000000000000000000000000000000
      //  33                            64
//byte_2  00000000000000000000000000000000
      //  65                            96
//byte_3  00000000000000000000000000000000
      //  97                           128
//byte_4  00000000000000000000000000000000
      //  129                      156
//byte_5  0000000000000000000000000000



}

void loop() {
  w++;
  if(w>9){w=0;}
  h1 = segm(10); 
  h2 = segm(10); 
  h3 = segm(10);
  h4 = segm(10);
  h5 = segm(10);
  h6 = segm(10);
  h7 = segm(11);
  h8 = segm(11);
  byte_1 = h1>>7; 
  byte_2 = (h1&0b1111111)<<25 | h2<<10 |kav_1<<12 | dvoetoh<<9 | h3>>5; 
  byte_3 = (h3&0b11111)<<27 | toch<<29 | h4<<12 | kav_2<<14 | h5>>3;
  byte_4 = (h5&0b111)<<29 | h6<<14 | h7>>1;
  byte_5 = (h7&1)<<23 | h8<<8;
  
  
  write_byte(0x41, byte_1,byte_2,byte_3,byte_4,byte_5,    0b0000);

  delay(100000);

  
 

}

void write_byte(byte addr, unsigned long b0, unsigned long b1, unsigned long b2, unsigned long b3, unsigned long b4, byte contr){
  /// addr 8 bit
     digitalWrite(CE,LOW);
   for(int i = 0; i <= 7; i++){
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (addr >> i) & 1); 
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(CE,HIGH);

// data 156 bit
  // 1-24 seg
     for(int i = 31;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b0 >> i) & 1);
     Serial.print((b0 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     Serial.print(" ");

     for(int i = 31;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b1 >> i) & 1);
     Serial.print((b1 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     Serial.print(" ");

     for(int i = 31;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b2 >> i) & 1);
     Serial.print((b2 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     Serial.print(" ");

     for(int i = 31;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b3 >> i) & 1);
     Serial.print((b3 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     Serial.print(" ");

     for(int i = 27;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b4 >> i) & 1);
     Serial.print((b4 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     Serial.println();
    
// control data 4 bit     
for(int i = 3; i >= 0; i--){
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (contr >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     digitalWrite(CE,LOW);
     digitalWrite(CL,LOW);
     delay(10);
  }  

int segm(int cif){
  unsigned int data_out;
  switch(cif){
    case 0: data_out=0b11000101000011;break;//0
    case 1: data_out=0b00000000100011;break;//1 
    case 2: data_out=0b01010101010010;break;//2
    case 3: data_out=0b00010101010011;break;//3 
    case 4: data_out=0b10010000010011;break;//4  
    case 5: data_out=0b10010101010001;break;//5 
    case 6: data_out=0b11010101010001;break;//6   
    case 7: data_out=0b00000100000011;break;//7   
    case 8: data_out=0b11010101010011;break;//8   
    case 9: data_out=0b10010101010011;break;//9  
   case 10: data_out=0b00000000000000;break;// пусто
   case 11: data_out=0b11111111111011;break;// все
    
    }
    return data_out;
  }  

131

Re: управление драйвером жк lc75823

#define CE  10
#define CL  13
#define DI  11

int w;
unsigned long byte_1,byte_2,byte_3,byte_4,byte_5;
unsigned long h1,h2,h3,h4,h5,h6,h7,h8;
unsigned long kav_1=0,dvoetoh=0,toch=0,kav_2=0;

void setup() {
  Serial.begin(9600);
  pinMode(CE, OUTPUT);
  pinMode(CL, OUTPUT);
  pinMode(DI, OUTPUT);
  digitalWrite(CE,LOW);
  digitalWrite(CL,LOW);
  delay(200);
      //  1                             32
//byte_1  00000000000000000000000000000000
      //  33                            64
//byte_2  00000000000000000000000000000000
      //  65                            96
//byte_3  00000000000000000000000000000000
      //  97                           128
//byte_4  00000000000000000000000000000000
      //  129                      156
//byte_5  0000000000000000000000000000



}

void loop() {
  w++;
  if(w>9){w=0;}
  h1 = segm(w); 
  h2 = segm(w); 
  h3 = segm(w);
  h4 = segm(w);
  h5 = segm(w);
  h6 = segm(w);
  h7 = segm(w);
  h8 = segm(w);
  byte_1 = h1>>7; 
  byte_2 = (h1&0b1111111)<<25 | h2<<10 |kav_1<<12 | dvoetoh<<9 | h3>>5; 
  byte_3 = (h3&0b11111)<<27 | toch<<29 | h4<<12 | kav_2<<14 | h5>>3;
  byte_4 = (h5&0b111)<<29 | h6<<14 | h7>>1;
  byte_5 = (h7&1)<<23 | h8<<8;
  
  
  write_byte(0x41, byte_1,byte_2,byte_3,byte_4,byte_5,    0b0000);

  delay(1000);

  
 

}

void write_byte(byte addr, unsigned long b0, unsigned long b1, unsigned long b2, unsigned long b3, unsigned long b4, byte contr){
  /// addr 8 bit
     digitalWrite(CE,LOW);
   for(int i = 0; i <= 7; i++){
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (addr >> i) & 1); 
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(CE,HIGH);

// data 156 bit
  // 1-24 seg
     for(int i = 31;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b0 >> i) & 1);
     Serial.print((b0 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     Serial.print(" ");

     for(int i = 31;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b1 >> i) & 1);
     Serial.print((b1 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     Serial.print(" ");

     for(int i = 31;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b2 >> i) & 1);
     Serial.print((b2 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     Serial.print(" ");

     for(int i = 31;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b3 >> i) & 1);
     Serial.print((b3 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     Serial.print(" ");

     for(int i = 27;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b4 >> i) & 1);
     Serial.print((b4 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     Serial.println();
    
// control data 4 bit     
for(int i = 3; i >= 0; i--){
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (contr >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     digitalWrite(CE,LOW);
     digitalWrite(CL,LOW);
     delay(10);
  }  

int segm(int cif){
  unsigned int data_out;
  switch(cif){
    case 0: data_out=0b11000101000011;break;//0
    case 1: data_out=0b00000000100011;break;//1 
    case 2: data_out=0b01010101010010;break;//2
    case 3: data_out=0b00010101010011;break;//3 
    case 4: data_out=0b10010000010011;break;//4  
    case 5: data_out=0b10010101010001;break;//5 
    case 6: data_out=0b11010101010001;break;//6   
    case 7: data_out=0b00000100000011;break;//7   
    case 8: data_out=0b11010101010011;break;//8   
    case 9: data_out=0b10010101010011;break;//9  
   case 10: data_out=0b00000000000000;break;// пусто
   case 11: data_out=0b11111111111011;break;// все
    
    }
    return data_out;
  }  

132

Re: управление драйвером жк lc75823

#define CE  10
#define CL  13
#define DI  11

int w;
unsigned long byte_1,byte_2,byte_3,byte_4,byte_5;
unsigned long h1,h2,h3,h4,h5,h6,h7,h8;
unsigned long kav_1=0,dvoetoh=0,toch=0,kav_2=0;

void setup() {
  Serial.begin(9600);
  pinMode(CE, OUTPUT);
  pinMode(CL, OUTPUT);
  pinMode(DI, OUTPUT);
  digitalWrite(CE,LOW);
  digitalWrite(CL,LOW);
  delay(200);
      //  1                             32
//byte_1  00000000000000000000000000000000
      //  33                            64
//byte_2  00000000000000000000000000000000
      //  65                            96
//byte_3  00000000000000000000000000000000
      //  97                           128
//byte_4  00000000000000000000000000000000
      //  129                      156
//byte_5  0000000000000000000000000000



}

void loop() {
  w++;
  if(w>9){w=0;}
  h1 = segm(w); 
  h2 = segm(w); 
  h3 = segm(w);
  h4 = segm(w);
  h5 = segm(w);
  h6 = segm(w);
  h7 = segm(w);
  h8 = segm(w);
  byte_1 = h1>>7; 
  byte_2 = (h1&0b1111111)<<25 | h2<<10 |kav_1<<12 | dvoetoh<<9 | h3>>5; 
  byte_3 = (h3&0b11111)<<27 | toch<<29 | h4<<12 | kav_2<<14 | h5>>3;
  byte_4 = (h5&0b111)<<29 | h6<<14 | h7>>1;
  byte_5 = (h7&1)<<27 | h8<<12;
  
  
  write_byte(0x41, byte_1,byte_2,byte_3,byte_4,byte_5,    0b0000);

  delay(1000);

  
 

}

void write_byte(byte addr, unsigned long b0, unsigned long b1, unsigned long b2, unsigned long b3, unsigned long b4, byte contr){
  /// addr 8 bit
     digitalWrite(CE,LOW);
   for(int i = 0; i <= 7; i++){
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (addr >> i) & 1); 
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(CE,HIGH);

// data 156 bit
  // 1-24 seg
     for(int i = 31;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b0 >> i) & 1);
     Serial.print((b0 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     Serial.print(" ");

     for(int i = 31;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b1 >> i) & 1);
     Serial.print((b1 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     Serial.print(" ");

     for(int i = 31;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b2 >> i) & 1);
     Serial.print((b2 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     Serial.print(" ");

     for(int i = 31;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b3 >> i) & 1);
     Serial.print((b3 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     Serial.print(" ");

     for(int i = 27;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b4 >> i) & 1);
     Serial.print((b4 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     Serial.println();
    
// control data 4 bit     
for(int i = 3; i >= 0; i--){
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (contr >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     digitalWrite(CE,LOW);
     digitalWrite(CL,LOW);
     delay(10);
  }  

int segm(int cif){
  unsigned int data_out;
  switch(cif){
    case 0: data_out=0b11000101000011;break;//0
    case 1: data_out=0b00000000100011;break;//1 
    case 2: data_out=0b01010101010010;break;//2
    case 3: data_out=0b00010101010011;break;//3 
    case 4: data_out=0b10010000010011;break;//4  
    case 5: data_out=0b10010101010001;break;//5 
    case 6: data_out=0b11010101010001;break;//6   
    case 7: data_out=0b00000100000011;break;//7   
    case 8: data_out=0b11010101010011;break;//8   
    case 9: data_out=0b10010101010011;break;//9  
   case 10: data_out=0b00000000000000;break;// пусто
   case 11: data_out=0b11111111111011;break;// все
    
    }
    return data_out;
  }  

133

Re: управление драйвером жк lc75823

успешно, всё правильно выводится

134

Re: управление драйвером жк lc75823

я только подкоректировал цифру 1, поскольку мне не очень понравилась как она выглядит. Я убрал центральный сегмент и оставил только 2 чёрточки сбоку

135

Re: управление драйвером жк lc75823

Еще бы хорошо было бы реализовать команды для зажигания каждого значка, и отдельную функцию для анализатора спектра.

136

Re: управление драйвером жк lc75823

Должен гореть только анализатор и цифры

#define CE  10
#define CL  13
#define DI  11

int w;
unsigned long byte_1,byte_2,byte_3,byte_4,byte_5;
unsigned long h1,h2,h3,h4,h5,h6,h7,h8;
unsigned long kav_1=0,dvoetoh=0,toch=0,kav_2=0;
unsigned long vu[14]={1,1,1,1,1,1,1,1,1,1,1,1,1,1};

void setup() {
  Serial.begin(9600);
  pinMode(CE, OUTPUT);
  pinMode(CL, OUTPUT);
  pinMode(DI, OUTPUT);
  digitalWrite(CE,LOW);
  digitalWrite(CL,LOW);
  delay(200);
      //  1                             32
//byte_1  00000000000000000000000000000000
      //  33                            64
//byte_2  00000000000000000000000000000000
      //  65                            96
//byte_3  00000000000000000000000000000000
      //  97                           128
//byte_4  00000000000000000000000000000000
      //  129                      156
//byte_5  0000000000000000000000000000



}

void loop() {
  h1 = segm(1); 
  h2 = segm(2); 
  h3 = segm(3);
  h4 = segm(4);
  h5 = segm(5);
  h6 = segm(6);
  h7 = segm(7);
  h8 = segm(8);
  unsigned long vu_code = vu[1]<<24|vu[2]<<23|vu[3]<<22|vu[4]<<21|vu[5]<<20|vu[6]<<19|vu[7]<<18|vu[8]<<17|vu[9]<<16|vu[10]<<15|vu[11]<<14| vu[12]<<11|vu[13]<<8;
  byte_1 = h1>>7 | vu[0]<<25 | vu_code; 
  byte_2 = (h1&0b1111111)<<25 | h2<<10 |kav_1<<12 | dvoetoh<<9 | h3>>5; 
  byte_3 = (h3&0b11111)<<27 | toch<<29 | h4<<12 | kav_2<<14 | h5>>3;
  byte_4 = (h5&0b111)<<29 | h6<<14 | h7>>1;
  byte_5 = (h7&1)<<27 | h8<<12;
  
  
  write_byte(0x41, byte_1,byte_2,byte_3,byte_4,byte_5,    0b0000);

  delay(100000);
  Serial.println(vu[0]);
  
 

}

void write_byte(byte addr, unsigned long b0, unsigned long b1, unsigned long b2, unsigned long b3, unsigned long b4, byte contr){
  /// addr 8 bit
     digitalWrite(CE,LOW);
   for(int i = 0; i <= 7; i++){
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (addr >> i) & 1); 
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(CE,HIGH);

// data 156 bit
  // 1-24 seg
     for(int i = 31;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b0 >> i) & 1);
     Serial.print((b0 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     Serial.print(" ");

     for(int i = 31;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b1 >> i) & 1);
     Serial.print((b1 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     Serial.print(" ");

     for(int i = 31;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b2 >> i) & 1);
     Serial.print((b2 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     Serial.print(" ");

     for(int i = 31;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b3 >> i) & 1);
     Serial.print((b3 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     Serial.print(" ");

     for(int i = 27;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b4 >> i) & 1);
     Serial.print((b4 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     Serial.println();
    
// control data 4 bit     
for(int i = 3; i >= 0; i--){
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (contr >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     digitalWrite(CE,LOW);
     digitalWrite(CL,LOW);
     delay(10);
  }  

int segm(int cif){
  unsigned int data_out;
  switch(cif){
    case 0: data_out=0b11000101000011;break;//0
    case 1: data_out=0b00000000000011;break;//1 
    case 2: data_out=0b01010101010010;break;//2
    case 3: data_out=0b00010101010011;break;//3 
    case 4: data_out=0b10010000010011;break;//4  
    case 5: data_out=0b10010101010001;break;//5 
    case 6: data_out=0b11010101010001;break;//6   
    case 7: data_out=0b00000100000011;break;//7   
    case 8: data_out=0b11010101010011;break;//8   
    case 9: data_out=0b10010101010011;break;//9  
   case 10: data_out=0b00000000000000;break;// пусто
   case 11: data_out=0b11111111111011;break;// все
    
    }
    return data_out;
  }  

137

Re: управление драйвером жк lc75823

Да, все верно

138

Re: управление драйвером жк lc75823

#define CE  10
#define CL  13
#define DI  11

int w;
unsigned long byte_1,byte_2,byte_3,byte_4,byte_5;
unsigned long h1,h2,h3,h4,h5,h6,h7,h8;
unsigned long kav_1=0,dvoetoh=0,toch=0,kav_2=0;
unsigned long vu[14]={0,0,0,0,0,0,0,0,0,0,0,0,0,0};
unsigned long scm=1, beat=1, soft=1,pop=1;

void setup() {
  Serial.begin(9600);
  pinMode(CE, OUTPUT);
  pinMode(CL, OUTPUT);
  pinMode(DI, OUTPUT);
  digitalWrite(CE,LOW);
  digitalWrite(CL,LOW);
  delay(200);
      //  1                             32
//byte_1  00000000000000000000000000000000
      //  33                            64
//byte_2  00000000000000000000000000000000
      //  65                            96
//byte_3  00000000000000000000000000000000
      //  97                           128
//byte_4  00000000000000000000000000000000
      //  129                      156
//byte_5  0000000000000000000000000000



}

void loop() {
  h1 = segm(1); 
  h2 = segm(2); 
  h3 = segm(3);
  h4 = segm(4);
  h5 = segm(5);
  h6 = segm(6);
  h7 = segm(7);
  h8 = segm(8);
  unsigned long vu_code = vu[1]<<24|vu[2]<<23|vu[3]<<22|vu[4]<<21|vu[5]<<20|vu[6]<<19|vu[7]<<18|vu[8]<<17|vu[9]<<16|vu[10]<<15|vu[11]<<14| vu[12]<<11|vu[13]<<8;
  byte_1 = h1>>7 | vu[0]<<25 | vu_code | scm<<13 | beat<<12 |soft<<9 | pop<<10; 
  byte_2 = (h1&0b1111111)<<25 | h2<<10 |kav_1<<12 | dvoetoh<<9 | h3>>5; 
  byte_3 = (h3&0b11111)<<27 | toch<<29 | h4<<12 | kav_2<<14 | h5>>3;
  byte_4 = (h5&0b111)<<29 | h6<<14 | h7>>1;
  byte_5 = (h7&1)<<27 | h8<<12;
  
  
  write_byte(0x41, byte_1,byte_2,byte_3,byte_4,byte_5,    0b0000);

  delay(100000);
  Serial.println(vu[0]);
  
 

}

void write_byte(byte addr, unsigned long b0, unsigned long b1, unsigned long b2, unsigned long b3, unsigned long b4, byte contr){
  /// addr 8 bit
     digitalWrite(CE,LOW);
   for(int i = 0; i <= 7; i++){
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (addr >> i) & 1); 
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(CE,HIGH);

// data 156 bit
  // 1-24 seg
     for(int i = 31;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b0 >> i) & 1);
     Serial.print((b0 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     Serial.print(" ");

     for(int i = 31;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b1 >> i) & 1);
     Serial.print((b1 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     Serial.print(" ");

     for(int i = 31;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b2 >> i) & 1);
     Serial.print((b2 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     Serial.print(" ");

     for(int i = 31;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b3 >> i) & 1);
     Serial.print((b3 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     Serial.print(" ");

     for(int i = 27;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b4 >> i) & 1);
     Serial.print((b4 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     Serial.println();
    
// control data 4 bit     
for(int i = 3; i >= 0; i--){
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (contr >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     digitalWrite(CE,LOW);
     digitalWrite(CL,LOW);
     delay(10);
  }  

int segm(int cif){
  unsigned int data_out;
  switch(cif){
    case 0: data_out=0b11000101000011;break;//0
    case 1: data_out=0b00000000000011;break;//1 
    case 2: data_out=0b01010101010010;break;//2
    case 3: data_out=0b00010101010011;break;//3 
    case 4: data_out=0b10010000010011;break;//4  
    case 5: data_out=0b10010101010001;break;//5 
    case 6: data_out=0b11010101010001;break;//6   
    case 7: data_out=0b00000100000011;break;//7   
    case 8: data_out=0b11010101010011;break;//8   
    case 9: data_out=0b10010101010011;break;//9  
   case 10: data_out=0b00000000000000;break;// пусто
   case 11: data_out=0b11111111111011;break;// все
    
    }
    return data_out;
  }  

139

Re: управление драйвером жк lc75823

верно загорелся блок со стиями звучания слева

140

Re: управление драйвером жк lc75823

Надо посмотреть какие элементы блока справа не будут работать

#define CE  10
#define CL  13
#define DI  11

int w;
unsigned long byte_1,byte_2,byte_3,byte_4,byte_5;
unsigned long h1,h2,h3,h4,h5,h6,h7,h8;
unsigned long kav_1=0,dvoetoh=0,toch=0,kav_2=0;
unsigned long vu[14]={0,0,0,0,0,0,0,0,0,0,0,0,0,0};
unsigned long scm=1, beat=1, soft=1,pop=1;

void setup() {
  Serial.begin(9600);
  pinMode(CE, OUTPUT);
  pinMode(CL, OUTPUT);
  pinMode(DI, OUTPUT);
  digitalWrite(CE,LOW);
  digitalWrite(CL,LOW);
  delay(200);
      //  1                             32
//byte_1  00000000000000000000000000000000
      //  33                            64
//byte_2  00000000000000000000000000000000
      //  65                            96
//byte_3  00000000000000000000000000000000
      //  97                           128
//byte_4  00000000000000000000000000000000
      //  129                      156
//byte_5  0000000000000000000000000000



}

void loop() {
  h1 = segm(1); 
  h2 = segm(2); 
  h3 = segm(3);
  h4 = segm(4);
  h5 = segm(5);
  h6 = segm(6);
  h7 = segm(7);
  h8 = segm(8);
  unsigned long vu_code = vu[1]<<24|vu[2]<<23|vu[3]<<22|vu[4]<<21|vu[5]<<20|vu[6]<<19|vu[7]<<18|vu[8]<<17|vu[9]<<16|vu[10]<<15|vu[11]<<14| vu[12]<<11|vu[13]<<8;
  byte_1 = h1>>7 | vu[0]<<25 | vu_code | scm<<13 | beat<<12 |soft<<9 | pop<<10; 
  byte_2 = (h1&0b1111111)<<25 | h2<<10 |kav_1<<12 | dvoetoh<<9 | h3>>5; 
  byte_3 = (h3&0b11111)<<27 | toch<<29 | h4<<12 | kav_2<<14 | h5>>3;
  byte_4 = (h5&0b111)<<29 | h6<<14 | h7>>1;
  byte_5 = (h7&1)<<27 | h8<<12 | 0b111111111111;
  
  
  write_byte(0x41, byte_1,byte_2,byte_3,byte_4,byte_5,    0b0000);

  delay(100000);
  Serial.println(vu[0]);
  
 

}

void write_byte(byte addr, unsigned long b0, unsigned long b1, unsigned long b2, unsigned long b3, unsigned long b4, byte contr){
  /// addr 8 bit
     digitalWrite(CE,LOW);
   for(int i = 0; i <= 7; i++){
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (addr >> i) & 1); 
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(CE,HIGH);

// data 156 bit
  // 1-24 seg
     for(int i = 31;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b0 >> i) & 1);
     Serial.print((b0 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     Serial.print(" ");

     for(int i = 31;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b1 >> i) & 1);
     Serial.print((b1 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     Serial.print(" ");

     for(int i = 31;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b2 >> i) & 1);
     Serial.print((b2 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     Serial.print(" ");

     for(int i = 31;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b3 >> i) & 1);
     Serial.print((b3 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     Serial.print(" ");

     for(int i = 27;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b4 >> i) & 1);
     Serial.print((b4 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     Serial.println();
    
// control data 4 bit     
for(int i = 3; i >= 0; i--){
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (contr >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     digitalWrite(CE,LOW);
     digitalWrite(CL,LOW);
     delay(10);
  }  

int segm(int cif){
  unsigned int data_out;
  switch(cif){
    case 0: data_out=0b11000101000011;break;//0
    case 1: data_out=0b00000000000011;break;//1 
    case 2: data_out=0b01010101010010;break;//2
    case 3: data_out=0b00010101010011;break;//3 
    case 4: data_out=0b10010000010011;break;//4  
    case 5: data_out=0b10010101010001;break;//5 
    case 6: data_out=0b11010101010001;break;//6   
    case 7: data_out=0b00000100000011;break;//7   
    case 8: data_out=0b11010101010011;break;//8   
    case 9: data_out=0b10010101010011;break;//9  
   case 10: data_out=0b00000000000000;break;// пусто
   case 11: data_out=0b11111111111011;break;// все
    
    }
    return data_out;
  }  

141

Re: управление драйвером жк lc75823

http://forum.rcl-radio.ru/uploads/images/2024/03/6bfa9a4638fe90f12d47e18450a03b20.jpeg не горят (146,134,127,115). Я только не понял как вам удалось зажечь fм 1и2, когда я их определял их не было, тоже самое с cd-ch

142

Re: управление драйвером жк lc75823

#define CE  10
#define CL  13
#define DI  11

int w;
unsigned long byte_1,byte_2,byte_3,byte_4,byte_5;
unsigned long h1,h2,h3,h4,h5,h6,h7,h8;
unsigned long kav_1=0,dvoetoh=0,toch=0,kav_2=0;
unsigned long vu[14]={0,0,0,0,0,0,0,0,0,0,0,0,0,0};
unsigned long scm=1, beat=1, soft=1,pop=1;

void setup() {
  Serial.begin(9600);
  pinMode(CE, OUTPUT);
  pinMode(CL, OUTPUT);
  pinMode(DI, OUTPUT);
  digitalWrite(CE,LOW);
  digitalWrite(CL,LOW);
  delay(200);
      //  1                             32
//byte_1  00000000000000000000000000000000
      //  33                            64
//byte_2  00000000000000000000000000000000
      //  65                            96
//byte_3  00000000000000000000000000000000
      //  97                           128
//byte_4  00000000000000000000000000000000
      //  129                      156
//byte_5  0000000000000000000000000000



}

void loop() {
  h1 = segm(11); 
  h2 = segm(11); 
  h3 = segm(11);
  h4 = segm(11);
  h5 = segm(11);
  h6 = segm(11);
  h7 = segm(11);
  h8 = segm(11);
  unsigned long vu_code = vu[1]<<24|vu[2]<<23|vu[3]<<22|vu[4]<<21|vu[5]<<20|vu[6]<<19|vu[7]<<18|vu[8]<<17|vu[9]<<16|vu[10]<<15|vu[11]<<14| vu[12]<<11|vu[13]<<8;
  byte_1 = h1>>7 | vu[0]<<25 | vu_code | scm<<13 | beat<<12 |soft<<9 | pop<<10; 
  byte_2 = (h1&0b1111111)<<25 | h2<<10 |kav_1<<12 | dvoetoh<<9 | h3>>5; 
  byte_3 = (h3&0b11111)<<27 | toch<<29 | h4<<12 | kav_2<<14 | h5>>3;
  byte_4 = (h5&0b111)<<29 | h6<<14 | h7>>1;
  byte_5 = (h7&1)<<27 | h8<<12 | 0b111111111111;
  
  
  write_byte(0x41, byte_1,byte_2,byte_3,byte_4,byte_5,    0b0000);

  delay(100000);
  Serial.println(vu[0]);
  
 

}

void write_byte(byte addr, unsigned long b0, unsigned long b1, unsigned long b2, unsigned long b3, unsigned long b4, byte contr){
  /// addr 8 bit
     digitalWrite(CE,LOW);
   for(int i = 0; i <= 7; i++){
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (addr >> i) & 1); 
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(CE,HIGH);

// data 156 bit
  // 1-24 seg
     for(int i = 31;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b0 >> i) & 1);
     Serial.print((b0 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     Serial.print(" ");

     for(int i = 31;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b1 >> i) & 1);
     Serial.print((b1 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     Serial.print(" ");

     for(int i = 31;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b2 >> i) & 1);
     Serial.print((b2 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     Serial.print(" ");

     for(int i = 31;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b3 >> i) & 1);
     Serial.print((b3 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     Serial.print(" ");

     for(int i = 27;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b4 >> i) & 1);
     Serial.print((b4 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     Serial.println();
    
// control data 4 bit     
for(int i = 3; i >= 0; i--){
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (contr >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     digitalWrite(CE,LOW);
     digitalWrite(CL,LOW);
     delay(10);
  }  

int segm(int cif){
  unsigned int data_out;
  switch(cif){
    case 0: data_out=0b11000101000011;break;//0
    case 1: data_out=0b00000000000011;break;//1 
    case 2: data_out=0b01010101010010;break;//2
    case 3: data_out=0b00010101010011;break;//3 
    case 4: data_out=0b10010000010011;break;//4  
    case 5: data_out=0b10010101010001;break;//5 
    case 6: data_out=0b11010101010001;break;//6   
    case 7: data_out=0b00000100000011;break;//7   
    case 8: data_out=0b11010101010011;break;//8   
    case 9: data_out=0b10010101010011;break;//9  
   case 10: data_out=0b00000000000000;break;// пусто
   case 11: data_out=0b11111111111111;break;// все
    
    }
    return data_out;
  }  

143

Re: управление драйвером жк lc75823

Я только не понял как вам удалось зажечь fм 1и2, когда я их определял их не было, тоже самое с cd-ch

Подал 1 на все оставшиеся после 8 цифры биты

144

Re: управление драйвером жк lc75823

http://forum.rcl-radio.ru/uploads/images/2024/03/b366d7966d1604cbe7c980577fb42a1a.jpeg

145

Re: управление драйвером жк lc75823

#define CE  10
#define CL  13
#define DI  11

int w;
unsigned long byte_1,byte_2,byte_3,byte_4,byte_5;
unsigned long h1,h2,h3,h4,h5,h6,h7,h8;
unsigned long kav_1=0,dvoetoh=0,toch=0,kav_2=0;
unsigned long vu[14]={0,0,0,0,0,0,0,0,0,0,0,0,0,0};
unsigned long scm=1, beat=1, soft=1,pop=1;

void setup() {
  Serial.begin(9600);
  pinMode(CE, OUTPUT);
  pinMode(CL, OUTPUT);
  pinMode(DI, OUTPUT);
  digitalWrite(CE,LOW);
  digitalWrite(CL,LOW);
  delay(200);
      //  1                             32
//byte_1  00000000000000000000000000000000
      //  33                            64
//byte_2  00000000000000000000000000000000
      //  65                            96
//byte_3  00000000000000000000000000000000
      //  97                           128
//byte_4  00000000000000000000000000000000
      //  129                      156
//byte_5  0000000000000000000000000000



}

void loop() {
  h1 = segm(1); 
  h2 = segm(2); 
  h3 = segm(3);
  h4 = segm(4);
  h5 = segm(5);
  h6 = segm(6);
  h7 = segm(11);
  h8 = segm(11);
  unsigned long vu_code = vu[1]<<24|vu[2]<<23|vu[3]<<22|vu[4]<<21|vu[5]<<20|vu[6]<<19|vu[7]<<18|vu[8]<<17|vu[9]<<16|vu[10]<<15|vu[11]<<14| vu[12]<<11|vu[13]<<8;
  byte_1 = h1>>7 | vu[0]<<25 | vu_code | scm<<13 | beat<<12 |soft<<9 | pop<<10; 
  byte_2 = (h1&0b1111111)<<25 | h2<<10 |kav_1<<12 | dvoetoh<<9 | h3>>5; 
  byte_3 = (h3&0b11111)<<27 | toch<<29 | h4<<12 | kav_2<<14 | h5>>3;
  byte_4 = (h5&0b111)<<29 | h6<<14 | h7>>1;
  byte_5 = (h7&1)<<27 | h8<<12 | 1<<14| 0b000000000000;
  
  
  write_byte(0x41, byte_1,byte_2,byte_3,byte_4,byte_5,    0b0000);

  delay(100000);
  Serial.println(vu[0]);
  
 

}

void write_byte(byte addr, unsigned long b0, unsigned long b1, unsigned long b2, unsigned long b3, unsigned long b4, byte contr){
  /// addr 8 bit
     digitalWrite(CE,LOW);
   for(int i = 0; i <= 7; i++){
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (addr >> i) & 1); 
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(CE,HIGH);

// data 156 bit
  // 1-24 seg
     for(int i = 31;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b0 >> i) & 1);
     Serial.print((b0 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     Serial.print(" ");

     for(int i = 31;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b1 >> i) & 1);
     Serial.print((b1 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     Serial.print(" ");

     for(int i = 31;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b2 >> i) & 1);
     Serial.print((b2 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     Serial.print(" ");

     for(int i = 31;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b3 >> i) & 1);
     Serial.print((b3 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     Serial.print(" ");

     for(int i = 27;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b4 >> i) & 1);
     Serial.print((b4 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     Serial.println();
    
// control data 4 bit     
for(int i = 3; i >= 0; i--){
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (contr >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     digitalWrite(CE,LOW);
     digitalWrite(CL,LOW);
     delay(10);
  }  

int segm(int cif){
  unsigned int data_out;
  switch(cif){
    case 0: data_out=0b11000101000011;break;//0
    case 1: data_out=0b00000000000011;break;//1 
    case 2: data_out=0b01010101010010;break;//2
    case 3: data_out=0b00010101010011;break;//3 
    case 4: data_out=0b10010000010011;break;//4  
    case 5: data_out=0b10010101010001;break;//5 
    case 6: data_out=0b11010101010001;break;//6   
    case 7: data_out=0b00000100000011;break;//7   
    case 8: data_out=0b11010101010011;break;//8   
    case 9: data_out=0b10010101010011;break;//9  
   case 10: data_out=0b00000000000000;break;// пусто
   case 11: data_out=0b11111111111011;break;// все
    
    }
    return data_out;
  }  

146

Re: управление драйвером жк lc75823

http://forum.rcl-radio.ru/uploads/images/2024/03/18620d0b881385e3b48791cd0195b63f.jpeg

147

Re: управление драйвером жк lc75823

#define CE  10
#define CL  13
#define DI  11

int w;
unsigned long byte_1,byte_2,byte_3,byte_4,byte_5;
unsigned long h1,h2,h3,h4,h5,h6,h7,h8;
unsigned long kav_1=0,dvoetoh=0,toch=0,kav_2=0;
unsigned long vu[14]={0,0,0,0,0,0,0,0,0,0,0,0,0,0};
unsigned long scm=1, beat=1, soft=1,pop=1;
unsigned long rnd=0,xxx=1;

void setup() {
  Serial.begin(9600);
  pinMode(CE, OUTPUT);
  pinMode(CL, OUTPUT);
  pinMode(DI, OUTPUT);
  digitalWrite(CE,LOW);
  digitalWrite(CL,LOW);
  delay(200);
      //  1                             32
//byte_1  00000000000000000000000000000000
      //  33                            64
//byte_2  00000000000000000000000000000000
      //  65                            96
//byte_3  00000000000000000000000000000000
      //  97                           128
//byte_4  00000000000000000000000000000000
      //  129                      156
//byte_5  0000000000000000000000000000



}

void loop() {
  h1 = segm(1); 
  h2 = segm(2); 
  h3 = segm(3);
  h4 = segm(4);
  h5 = segm(5);
  h6 = segm(6);
  h7 = segm(11);
  h8 = segm(11);
  unsigned long vu_code = vu[1]<<24|vu[2]<<23|vu[3]<<22|vu[4]<<21|vu[5]<<20|vu[6]<<19|vu[7]<<18|vu[8]<<17|vu[9]<<16|vu[10]<<15|vu[11]<<14| vu[12]<<11|vu[13]<<8;
  byte_1 = h1>>7 | vu[0]<<25 | vu_code | scm<<13 | beat<<12 |soft<<9 | pop<<10; 
  byte_2 = (h1&0b1111111)<<25 | h2<<10 |kav_1<<12 | dvoetoh<<9 | h3>>5; 
  byte_3 = (h3&0b11111)<<27 | toch<<29 | h4<<12 | kav_2<<14 | h5>>3;
  byte_4 = (h5&0b111)<<29 | h6<<14 | h7>>1;
  byte_5 = (h7&1)<<27 | h8<<12 | rnd<<14|xxx<<26| 0b000000000000;
  
  
  write_byte(0x41, byte_1,byte_2,byte_3,byte_4,byte_5,    0b0000);

  delay(100000);
  Serial.println(vu[0]);
  
 

}

void write_byte(byte addr, unsigned long b0, unsigned long b1, unsigned long b2, unsigned long b3, unsigned long b4, byte contr){
  /// addr 8 bit
     digitalWrite(CE,LOW);
   for(int i = 0; i <= 7; i++){
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (addr >> i) & 1); 
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(CE,HIGH);

// data 156 bit
  // 1-24 seg
     for(int i = 31;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b0 >> i) & 1);
     Serial.print((b0 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     Serial.print(" ");

     for(int i = 31;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b1 >> i) & 1);
     Serial.print((b1 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     Serial.print(" ");

     for(int i = 31;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b2 >> i) & 1);
     Serial.print((b2 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     Serial.print(" ");

     for(int i = 31;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b3 >> i) & 1);
     Serial.print((b3 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     Serial.print(" ");

     for(int i = 27;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b4 >> i) & 1);
     Serial.print((b4 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     Serial.println();
    
// control data 4 bit     
for(int i = 3; i >= 0; i--){
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (contr >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     digitalWrite(CE,LOW);
     digitalWrite(CL,LOW);
     delay(10);
  }  

int segm(int cif){
  unsigned int data_out;
  switch(cif){
    case 0: data_out=0b11000101000011;break;//0
    case 1: data_out=0b00000000000011;break;//1 
    case 2: data_out=0b01010101010010;break;//2
    case 3: data_out=0b00010101010011;break;//3 
    case 4: data_out=0b10010000010011;break;//4  
    case 5: data_out=0b10010101010001;break;//5 
    case 6: data_out=0b11010101010001;break;//6   
    case 7: data_out=0b00000100000011;break;//7   
    case 8: data_out=0b11010101010011;break;//8   
    case 9: data_out=0b10010101010011;break;//9  
   case 10: data_out=0b00000000000000;break;// пусто
   case 11: data_out=0b11111111111011;break;// все
    
    }
    return data_out;
  }  

148

Re: управление драйвером жк lc75823

ничего не изменилось, только потух 146 а вместо него загорелся 134

149

Re: управление драйвером жк lc75823

#define CE  10
#define CL  13
#define DI  11

int w;
unsigned long byte_1,byte_2,byte_3,byte_4,byte_5;
unsigned long h1,h2,h3,h4,h5,h6,h7,h8;
unsigned long kav_1=0,dvoetoh=0,toch=0,kav_2=0;
unsigned long vu[14]={0,0,0,0,0,0,0,0,0,0,0,0,0,0};
unsigned long scm=1, beat=1, soft=1,pop=1;
unsigned long rnd=0,prt=0,xxx=1;

void setup() {
  Serial.begin(9600);
  pinMode(CE, OUTPUT);
  pinMode(CL, OUTPUT);
  pinMode(DI, OUTPUT);
  digitalWrite(CE,LOW);
  digitalWrite(CL,LOW);
  delay(200);
      //  1                             32
//byte_1  00000000000000000000000000000000
      //  33                            64
//byte_2  00000000000000000000000000000000
      //  65                            96
//byte_3  00000000000000000000000000000000
      //  97                           128
//byte_4  00000000000000000000000000000000
      //  129                      156
//byte_5  0000000000000000000000000000



}

void loop() {
  h1 = segm(1); 
  h2 = segm(2); 
  h3 = segm(3);
  h4 = segm(4);
  h5 = segm(5);
  h6 = segm(6);
  h7 = segm(11);
  h8 = segm(11);
  unsigned long vu_code = vu[1]<<24|vu[2]<<23|vu[3]<<22|vu[4]<<21|vu[5]<<20|vu[6]<<19|vu[7]<<18|vu[8]<<17|vu[9]<<16|vu[10]<<15|vu[11]<<14| vu[12]<<11|vu[13]<<8;
  byte_1 = h1>>7 | vu[0]<<25 | vu_code | scm<<13 | beat<<12 |soft<<9 | pop<<10; 
  byte_2 = (h1&0b1111111)<<25 | h2<<10 |kav_1<<12 | dvoetoh<<9 | h3>>5; 
  byte_3 = (h3&0b11111)<<27 | toch<<29 | h4<<12 | kav_2<<14 | h5>>3;
  byte_4 = (h5&0b111)<<29 | h6<<14 | h7>>1 | xxx<<1;
  byte_5 = (h7&1)<<27 | h8<<12 | rnd<<14|prt<<26| 0b000000000000;
  
  
  write_byte(0x41, byte_1,byte_2,byte_3,byte_4,byte_5,    0b0000);

  delay(100000);
  Serial.println(vu[0]);
  
 

}

void write_byte(byte addr, unsigned long b0, unsigned long b1, unsigned long b2, unsigned long b3, unsigned long b4, byte contr){
  /// addr 8 bit
     digitalWrite(CE,LOW);
   for(int i = 0; i <= 7; i++){
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (addr >> i) & 1); 
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(CE,HIGH);

// data 156 bit
  // 1-24 seg
     for(int i = 31;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b0 >> i) & 1);
     Serial.print((b0 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     Serial.print(" ");

     for(int i = 31;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b1 >> i) & 1);
     Serial.print((b1 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     Serial.print(" ");

     for(int i = 31;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b2 >> i) & 1);
     Serial.print((b2 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     Serial.print(" ");

     for(int i = 31;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b3 >> i) & 1);
     Serial.print((b3 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     Serial.print(" ");

     for(int i = 27;i >= 0; i--){ 
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (b4 >> i) & 1);
     Serial.print((b4 >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     Serial.println();
    
// control data 4 bit     
for(int i = 3; i >= 0; i--){
     digitalWrite(CL,LOW);delayMicroseconds(10);
     digitalWrite(DI, (contr >> i) & 1);
     digitalWrite(CL,HIGH);delayMicroseconds(10);
     } 
     digitalWrite(CE,LOW);
     digitalWrite(CL,LOW);
     delay(10);
  }  

int segm(int cif){
  unsigned int data_out;
  switch(cif){
    case 0: data_out=0b11000101000011;break;//0
    case 1: data_out=0b00000000000011;break;//1 
    case 2: data_out=0b01010101010010;break;//2
    case 3: data_out=0b00010101010011;break;//3 
    case 4: data_out=0b10010000010011;break;//4  
    case 5: data_out=0b10010101010001;break;//5 
    case 6: data_out=0b11010101010001;break;//6   
    case 7: data_out=0b00000100000011;break;//7   
    case 8: data_out=0b11010101010011;break;//8   
    case 9: data_out=0b10010101010011;break;//9  
   case 10: data_out=0b00000000000000;break;// пусто
   case 11: data_out=0b11111111111011;break;// все
    
    }
    return data_out;
  }  

150

Re: управление драйвером жк lc75823

ничего не изменилось, только потух 134 а вместо него загорелся 127