CD4051BE as demultiplexer.

Hi!
I am using a CD4501B as demultiplexer,
I test it step by step sending an high digital signal in every output in order to signed which output is whict ect. and it works.
but when I want to use more out put together I have problem,
like this simple code over here:

the pin 010 or the pin 100 ar LOW all the time.
How much time the pin needs to be able to became an output?
I need before to send the signal with arduino an then select the right output or the opposite?
This device is to slow to be sensible to a faster change of output or it just needs some delay and it is possible to use?
Thank you in advance
Giulia

The CD4051 can only drive one output at a time. All of the other outputs will be left floating.

For expanding outputs a 74HC595 serial in/parallel out shift register will work better.

thank you for your answer, does it need arduino clock?

Lots of examples are available. You can connect any number of shift registers to three pins on the Arduino. If you need really fast writing you can use the SPI hardware to get close to 8 million bits per second.