I have to send 0x11, 0x01, 0x01, 0xED to the co2 sensor consequently then the co2 sensor will send me response data
To send the data
before setup loop I define
pattern []=[0x11, 0x01, 0x01, 0xED];
then in the setup loop I write
no=0;
while(no<=3){
for(int i=0; i<8; i++){
boolean on_off=bitread(pattern[no], i);
digitalWrite(4, on_off);} no++;}
does this code transmit 0x11, 0x01, 0x01, 0xED in this order to the sensor?