Skip to main content

how How to read shiftOut function using arduino

(I"mI'm sorry for my bad English,but i but I will do my best)

I have a Chinese MUC which already programmed,it communicate. It communicates with a LED driver chip using using three wires (STB,CLK,DIN).
(LED driver controls 16 digit 7 Segment display)

afterAfter some research  ,I I found that it can be talk to LED driver using shiftout function.

Now the main coal is to connect these 3 pins(STB,clk,din) to Arduino and read the incoming data and convert the data to numbers.

To test if this idea is working or not, iI came with two arduino (uno to send shiftout function and mega to read it) after connect pin 2 of uno to pin 2 of mega and same 3 to 3 4, 4 to 4 and also Gnd of uno to Gnd of mega.
I wrote these codes:

arduino UNO side (to send shiftOut function)


    #define STB  4
#define clockPin  5
#define dataPin  6

void setup() {
  Serial.begin(9600);

  pinMode(STB, OUTPUT);
  pinMode(clockPin,  OUTPUT);
  pinMode(dataPin, OUTPUT);
}

void loop() {
 digitalWrite(STB, LOW);
    shiftOut(dataPin, clockPin, LSBFIRST, 0b10101010 ); // 1st digit   
   digitalWrite(STB, HIGH);
}

arduino mega side (to read shiftOut function)


    #define STB 4
#define clockPin  5
#define dataPin  6

 int R_STB[8]; 
 int R_clockPin ;
 int R_dataPin ; 
void setup() {
   Serial.begin(115200);
 
  pinMode(STB, INPUT);
  pinMode(clockPin,  INPUT);
  pinMode(dataPin, INPUT);
}

void loop() {

 R_STB = digitalRead(STB); 
 R_clockPin = digitalRead(clockPin);
 R_dataPin = digitalRead(dataPin);


   for(int i=0 ; i<8;i++){
  Serial.print(R_STB[i]-2);

  Serial.print(" ");
  Serial.print (R_clockPin[i]);

 Serial.print(" ");
  Serial.print(R_dataPin[i]+2);
Serial.println(" ");
   }
 }

butBut the digital read at arduino mega side can't read all data due to it fast switching between High LOW statement maybe? and iI am stuck here.

pleasePlease any one has any ideas? thanks.

how to read shiftOut function using arduino

(I"m sorry for my bad English,but i will do my best)

I have a Chinese MUC which already programmed,it communicate with a LED driver chip using three wires (STB,CLK,DIN).
(LED driver controls 16 digit 7 Segment display)

after some research  ,I found that it can be talk to LED driver using shiftout function.

Now the main coal is to connect these 3 pins(STB,clk,din) to Arduino and read the incoming data and convert the data to numbers.

To test if this idea is working or not, i came with two arduino (uno to send shiftout function and mega to read it) after connect pin 2 of uno to pin 2 of mega and same 3 to 3 4 to 4 and also Gnd of uno to Gnd of mega I wrote these codes

arduino UNO side (to send shiftOut function)


    #define STB  4
#define clockPin  5
#define dataPin  6

void setup() {
  Serial.begin(9600);

  pinMode(STB, OUTPUT);
  pinMode(clockPin,  OUTPUT);
  pinMode(dataPin, OUTPUT);
}

void loop() {
 digitalWrite(STB, LOW);
    shiftOut(dataPin, clockPin, LSBFIRST, 0b10101010 ); // 1st digit   
   digitalWrite(STB, HIGH);
}

arduino mega side (to read shiftOut function)


    #define STB 4
#define clockPin  5
#define dataPin  6

 int R_STB[8]; 
 int R_clockPin ;
 int R_dataPin ; 
void setup() {
   Serial.begin(115200);
 
  pinMode(STB, INPUT);
  pinMode(clockPin,  INPUT);
  pinMode(dataPin, INPUT);
}

void loop() {

 R_STB = digitalRead(STB); 
 R_clockPin = digitalRead(clockPin);
 R_dataPin = digitalRead(dataPin);


   for(int i=0 ; i<8;i++){
  Serial.print(R_STB[i]-2);

  Serial.print(" ");
  Serial.print (R_clockPin[i]);

 Serial.print(" ");
  Serial.print(R_dataPin[i]+2);
Serial.println(" ");
   }
 }

but the digital read at arduino mega side can't read all data due to it fast switching between High LOW statement maybe? and i stuck here

please any one has any ideas? thanks.

How to read shiftOut function using arduino

(I'm sorry for my bad English, but I will do my best)

I have a Chinese MUC which already programmed. It communicates with a LED driver chip using three wires (STB,CLK,DIN).
(LED driver controls 16 digit 7 Segment display)

After some research, I found that it can be talk to LED driver using shiftout function.

Now the main coal is to connect these 3 pins(STB,clk,din) to Arduino and read the incoming data and convert the data to numbers.

To test if this idea is working or not, I came with two arduino (uno to send shiftout function and mega to read it) after connect pin 2 of uno to pin 2 of mega and same 3 to 3, 4 to 4 and also Gnd of uno to Gnd of mega.
I wrote these codes:

arduino UNO side (to send shiftOut function)


    #define STB  4
#define clockPin  5
#define dataPin  6

void setup() {
  Serial.begin(9600);

  pinMode(STB, OUTPUT);
  pinMode(clockPin,  OUTPUT);
  pinMode(dataPin, OUTPUT);
}

void loop() {
 digitalWrite(STB, LOW);
    shiftOut(dataPin, clockPin, LSBFIRST, 0b10101010 ); // 1st digit   
   digitalWrite(STB, HIGH);
}

arduino mega side (to read shiftOut function)


    #define STB 4
#define clockPin  5
#define dataPin  6

 int R_STB[8]; 
 int R_clockPin ;
 int R_dataPin ; 
void setup() {
   Serial.begin(115200);
 
  pinMode(STB, INPUT);
  pinMode(clockPin,  INPUT);
  pinMode(dataPin, INPUT);
}

void loop() {

 R_STB = digitalRead(STB); 
 R_clockPin = digitalRead(clockPin);
 R_dataPin = digitalRead(dataPin);


   for(int i=0 ; i<8;i++){
  Serial.print(R_STB[i]-2);

  Serial.print(" ");
  Serial.print (R_clockPin[i]);

 Serial.print(" ");
  Serial.print(R_dataPin[i]+2);
Serial.println(" ");
   }
 }

But the digital read at arduino mega side can't read all data due to it fast switching between High LOW statement maybe? and I am stuck here.

Please any one has any ideas?

added 91 characters in body
Source Link

(I"m sorry for my bad English,but i will do my best)

I have a Chinese MUC which already programmed,it communicate with a LED driver chip using three wires (STB,CLK,DIN).
(LED driver controls 16 digit 7 Segment display)

after some research ,I found that it can be talk to LED driver using shiftout function.

Now the main coal is to connect these 3 pins(STB,clk,din) to Arduino and read the incoming data and convert the data to numbers.

To test if this idea is working or not, i came with two arduino (uno to send shiftout function and mega to read it) after connect pin 2 of uno to pin 2 of mega and same 3 to 3 4 to 4 and also Gnd of uno to Gnd of mega I wrote these codes

arduino UNO side (to send shiftOut function)


    #define STB  4
#define clockPin  5
#define dataPin  6

void setup() {
  Serial.begin(9600);

  pinMode(STB, OUTPUT);
  pinMode(clockPin,  OUTPUT);
  pinMode(dataPin, OUTPUT);
}

void loop() {
 digitalWrite(STB, LOW);
    shiftOut(dataPin, clockPin, LSBFIRST, 0b10101010 ); // 1st digit   
   digitalWrite(STB, HIGH);
}

arduino mega side (to read shiftOut function)


    #define STB 4
#define clockPin  5
#define dataPin  6

 int R_STB[8]; 
 int R_clockPin ;
 int R_dataPin ; 
void setup() {
   Serial.begin(115200);
 
  pinMode(STB, INPUT);
  pinMode(clockPin,  INPUT);
  pinMode(dataPin, INPUT);
}

void loop() {

 R_STB = digitalRead(STB); 
 R_clockPin = digitalRead(clockPin);
 R_dataPin = digitalRead(dataPin);


   for(int i=0 ; i<8;i++){
  Serial.print(R_STB[i]-2);

  Serial.print(" ");
  Serial.print (R_clockPin[i]);

 Serial.print(" ");
  Serial.print(R_dataPin[i]+2);
Serial.println(" ");
   }
 }

but the digital read at arduino mega side can't read all data due to it fast switching between High LOW statement maybe? and i stuck here

please any one has any ideas? thanks.

(I"m sorry for my bad English,but i will do my best)

I have a Chinese MUC which already programmed,it communicate with a LED driver chip using three wires (STB,CLK,DIN).
(LED driver controls 16 digit 7 Segment display)

after some research ,I found that it can be talk to LED driver using shiftout function.

Now the main coal is to connect these 3 pins(STB,clk,din) to Arduino and read the incoming data and convert the data to numbers.

To test if this idea is working or not, i came with two arduino (uno to send shiftout function and mega to read it) after connect pin 2 of uno to pin 2 of mega and same 3 to 3 4 to 4 and also Gnd of uno to Gnd of mega I wrote these codes


    #define STB  4
#define clockPin  5
#define dataPin  6

void setup() {
  Serial.begin(9600);

  pinMode(STB, OUTPUT);
  pinMode(clockPin,  OUTPUT);
  pinMode(dataPin, OUTPUT);
}

void loop() {
 digitalWrite(STB, LOW);
    shiftOut(dataPin, clockPin, LSBFIRST, 0b10101010 ); // 1st digit   
   digitalWrite(STB, HIGH);
}


    #define STB 4
#define clockPin  5
#define dataPin  6

 int R_STB[8]; 
 int R_clockPin ;
 int R_dataPin ; 
void setup() {
   Serial.begin(115200);
 
  pinMode(STB, INPUT);
  pinMode(clockPin,  INPUT);
  pinMode(dataPin, INPUT);
}

void loop() {

 R_STB = digitalRead(STB); 
 R_clockPin = digitalRead(clockPin);
 R_dataPin = digitalRead(dataPin);


   for(int i=0 ; i<8;i++){
  Serial.print(R_STB[i]-2);

  Serial.print(" ");
  Serial.print (R_clockPin[i]);

 Serial.print(" ");
  Serial.print(R_dataPin[i]+2);
Serial.println(" ");
   }
 }

but the digital read at arduino mega side can't read all data due to it fast switching between High LOW statement maybe? and i stuck here

please any one has any ideas? thanks.

(I"m sorry for my bad English,but i will do my best)

I have a Chinese MUC which already programmed,it communicate with a LED driver chip using three wires (STB,CLK,DIN).
(LED driver controls 16 digit 7 Segment display)

after some research ,I found that it can be talk to LED driver using shiftout function.

Now the main coal is to connect these 3 pins(STB,clk,din) to Arduino and read the incoming data and convert the data to numbers.

To test if this idea is working or not, i came with two arduino (uno to send shiftout function and mega to read it) after connect pin 2 of uno to pin 2 of mega and same 3 to 3 4 to 4 and also Gnd of uno to Gnd of mega I wrote these codes

arduino UNO side (to send shiftOut function)


    #define STB  4
#define clockPin  5
#define dataPin  6

void setup() {
  Serial.begin(9600);

  pinMode(STB, OUTPUT);
  pinMode(clockPin,  OUTPUT);
  pinMode(dataPin, OUTPUT);
}

void loop() {
 digitalWrite(STB, LOW);
    shiftOut(dataPin, clockPin, LSBFIRST, 0b10101010 ); // 1st digit   
   digitalWrite(STB, HIGH);
}

arduino mega side (to read shiftOut function)


    #define STB 4
#define clockPin  5
#define dataPin  6

 int R_STB[8]; 
 int R_clockPin ;
 int R_dataPin ; 
void setup() {
   Serial.begin(115200);
 
  pinMode(STB, INPUT);
  pinMode(clockPin,  INPUT);
  pinMode(dataPin, INPUT);
}

void loop() {

 R_STB = digitalRead(STB); 
 R_clockPin = digitalRead(clockPin);
 R_dataPin = digitalRead(dataPin);


   for(int i=0 ; i<8;i++){
  Serial.print(R_STB[i]-2);

  Serial.print(" ");
  Serial.print (R_clockPin[i]);

 Serial.print(" ");
  Serial.print(R_dataPin[i]+2);
Serial.println(" ");
   }
 }

but the digital read at arduino mega side can't read all data due to it fast switching between High LOW statement maybe? and i stuck here

please any one has any ideas? thanks.

Source Link

how to read shiftOut function using arduino

(I"m sorry for my bad English,but i will do my best)

I have a Chinese MUC which already programmed,it communicate with a LED driver chip using three wires (STB,CLK,DIN).
(LED driver controls 16 digit 7 Segment display)

after some research ,I found that it can be talk to LED driver using shiftout function.

Now the main coal is to connect these 3 pins(STB,clk,din) to Arduino and read the incoming data and convert the data to numbers.

To test if this idea is working or not, i came with two arduino (uno to send shiftout function and mega to read it) after connect pin 2 of uno to pin 2 of mega and same 3 to 3 4 to 4 and also Gnd of uno to Gnd of mega I wrote these codes


    #define STB  4
#define clockPin  5
#define dataPin  6

void setup() {
  Serial.begin(9600);

  pinMode(STB, OUTPUT);
  pinMode(clockPin,  OUTPUT);
  pinMode(dataPin, OUTPUT);
}

void loop() {
 digitalWrite(STB, LOW);
    shiftOut(dataPin, clockPin, LSBFIRST, 0b10101010 ); // 1st digit   
   digitalWrite(STB, HIGH);
}


    #define STB 4
#define clockPin  5
#define dataPin  6

 int R_STB[8]; 
 int R_clockPin ;
 int R_dataPin ; 
void setup() {
   Serial.begin(115200);
 
  pinMode(STB, INPUT);
  pinMode(clockPin,  INPUT);
  pinMode(dataPin, INPUT);
}

void loop() {

 R_STB = digitalRead(STB); 
 R_clockPin = digitalRead(clockPin);
 R_dataPin = digitalRead(dataPin);


   for(int i=0 ; i<8;i++){
  Serial.print(R_STB[i]-2);

  Serial.print(" ");
  Serial.print (R_clockPin[i]);

 Serial.print(" ");
  Serial.print(R_dataPin[i]+2);
Serial.println(" ");
   }
 }

but the digital read at arduino mega side can't read all data due to it fast switching between High LOW statement maybe? and i stuck here

please any one has any ideas? thanks.