Transmit frame through PWM

I want to transmit a frame, for example 10111000 through PWM. Can I do? Because I know that PWM pins of arduino only creat a steady signals like 10101010... Can you help me? Thank you.

Can I do?

No.

I strongly suspect that you do not really understand what PWM is intended for. Also I think this is an example of the "XY Problem" (http://xyproblem.info/)
What is the problem you are actually trying to solve?
Susan

True, but on some processors there is a shift register bit pattern that can be put out by using PWM. For example the one in the Raspbery Pi has one. It is just that there is none on the processors used on the Arduino.

There's insufficient information in the post, but could it be bit-banged?
What is the required frequency?

Sounds like a hard way to do what Serial does easily.

...R

Yes you could bit bang it, you could even do it through a background task hung off the back of a timer interrupt, but it would not be "through PWM" which is what was asked.

It could be this

Ok, thank everyone. Maybe I don't know how to express. I want to use control two LED to transmit a frame 8 bit, for exemple 10110100. The pulse width of bit can change. And I want to code to receive signal through photodiode

If the pulse width can change, how can the receiver stay in synch? How is it to tell 11001100 from a l010 with a wider pulse?
I would suggest the IR remote control library as an example of what to do, but using a fixed width timing, generally 38 KHz, or 40 KHz I think as common frequ cies used.

You don't need to just output the bit pattern you need to modulate that bit pattern in some way.
One way is to use Manchester encoding

but there are many others.

This question has nothing to do with PWM.

Just use the IR library and send your data as if it was in infrared code.

The library has code for both a transmitter and a receiver

If you get interference or interfere with your tv etc, you could either modify the library to make it non standard

Hi all,
I want to transmit signal but I use LED (visible light communication) instead IR. Can you help me. Thank you.

I want to transmit signal but I use LED (visible light communication) instead IR

The principals are the same.

You are sending data using light, it just happens to be a different wavelength.

However, there is a reason that IR is used instead of visible light - far less interference with other light sources when using IR.

Try using the IR library with the LED and the detector close together and shielded by light.

Or use a laser (There is a youtube video somewhere where they are sending data via visible laser)

Or, instead of the IR library try using SoftwareSerial, it may be more suitable for what you are trying to do.

rogerClark:

I want to transmit signal but I use LED (visible light communication) instead IR

The principals are the same.

You are sending data using light, it just happens to be a different wavelength.

However, there is a reason that IR is used instead of visible light - far less interference with other light sources when using IR.

Try using the IR library with the LED and the detector close together and shielded by light.

Or use a laser (There is a youtube video somewhere where they are sending data via visible laser)

Or, instead of the IR library try using SoftwareSerial, it may be more suitable for what you are trying to do.

Ok. Thank you very much ^^