Question about digitalWrire

Try to generate 8 bits data with single pin to test ASIC shift register. Can I do "digitalWrite(Din, data);", or there is another way to do it ? I tried shiftout(), but it is too fast, can not verify data and clk with oscilloscope.

#include "Timerone,h"
int data = B10101010;
int Din = 10;
int CLK = 11;

void setup(){
pinMode(Din, OUTPUT);
pinMode(CLK, OUTPUT);
Timer1.initialize(1000);         // initialize timer1, and set a 1/2 second period
Timer1.pwm(11, 512); 
}

void loop(){
digitalWrite(Din, data);
}
digitalWrite(Din, data);

If "data" is non-zero, this is the same as digitalWrite(Din, HIGH);, if "data " is zero, it is the same as digitalWrite(Din, LOW);

Google "Arduino port manipulation"

So I can't output 8bits data use digitalWrite ?

That's correct.

doaway: So I can't output 8bits data use digitalWrite ?

You could make a loop, and do 8 x digitalWrite.