multiplexer

Hello!
I have a idea in my mind but I am not sure if I can realiwe it.
I would like to use only one LED to transmit my message.
I have three different signal to transmit coming from digital pin 3, 5 and 6. I would like to pass them in a multiplexer in order to have only one LED switching on and off.
Is that possibile? what device I should use? and I can I find a tutorial or more information about it? Thank you alot! and have a good day!

Why use a mux?

Your program simply uses the same output pin for all outputs.

Weedpharma

If I use the same output for the three PWM how can I then reconized which one is which?
I was thinking to do a sort of array..

int TDM[]={transmittedSignal1(),transmittedSignal2(),transmittedSignal3()};

where the functions transmittedSignal1() ect are like this:

int transmittedSignal1() //modifica perche il trasmitted deve essere 

{
  incomingSignal = analogRead(A0) >> 2;//get new value from A0
  analogWrite(3, incomingSignal); //assigned value to the LEDs
}

Please give a full description of what you are doing.

The mux would be used to select an output from any of the 3 inputs.

You have only mentioned PWM in your last post.

If you are wanting to set up 3 PWM outputs and switch them to the LED via a mux, you would also need to have mux address outputs.

Wouldn't it be easier to simply change the PWM from one pin to whatever is required when you need it rather than switching via a mux?

Weedpharma

Hi,
If you are only using one LED to output, how does the receiving end know which output of the arduino sent it?
You will have to send ID info with the signal to identify which output sent it.
I think we need to know more about your appication.

Tom.... :slight_smile:

my schema is

if botton A is high

digital write pin 3 high
read the signal in A0

digital write ID code first signal //(it should be some send bit comand)
trasmit the signal in pin 3
digital write low

same things with the other two signal just change ID code //(second and third signal)

and for receiv it should be if digital read HIGH //(means that it is receiving something)
read the ID code
analog read the signal and place it.
digital read trasmission ended // pin low

this is my main Idea.

I need to think what is the right way how to make an ID

@weedpharma

If you are wanting to set up 3 PWM outputs and switch them to the LED via a mux, you would also need to have mux address outputs.

Wouldn't it be easier to simply change the PWM from one pin to whatever is required when you need it rather than switching via a mux?

I can use one PWM because the signal that I want to transmit as a small bandwith and I can just modulate the pwm with dutycicly proportional to the amplitude of the input signal.
It will be different for every signal.
Maybe I need to trasmitted one peridiod of each PWM.

@ TomGeorge

If you are only using one LED to output, how does the receiving end know which output of the arduino sent it?
You will have to send ID info with the signal to identify which output sent it.
I think we need to know more about your appication.

I just have a sistem trasmitter and receiver but with three transmitter and three receiver!

thank you guys!

I am writing the sketch as soon I will finish a little bit I will post it!

I posted the code in programming question because the topic was going to be more about how to program since you helped me in decide how to project it :slight_smile:

here the title to follow it:
ID message code + DAC SLAVE selection