Analog Reading the State of an LED. Possible? If not, what to do?

Now, let's say I want to analogRead a value from an LED. I want to see how dim the LED is. Let's say this is LED1. Now, I want to take this value and make LED2 as dim as LED1.

Let's say that LED1 is connected to pin 1, and LED2 is connected to pin 2. Would the following line of code achieve the desired result?

analogWrite(2, (analogRead(1)/4));

Would the following line of code achieve the desired result?

No, because an analogWrite produces a PWM signal not an analogue signal.
http://www.thebox.myzen.co.uk/Tutorial/PWM.html
Therefore you will not read the brightness level of an LED.

It begs the question of why? Your program set the LED value in the first place so why do you want to read it back?

Yep… you are right… as Krupski suggested here, I should use shadow variables… or what I like to call more “temp” variables

I will see where this gets me… I will share the code once I end this project for the benefit of others

Thanks

P.S.: I think it would be an interesting research for Arduino guys to try and come up with a way to analogRead an LED… would make a lot of things easier

EDIT: Typo

pyroblast:
Now, let’s say I want to analogRead a value from an LED. I want to see how dim the LED is. Let’s say this is LED1. Now, I want to take this value and make LED2 as dim as LED1.

Let’s say that LED1 is connected to pin 1, and LED2 is connected to pin 2. Would the following line of code achieve the desired result?

analogWrite(2, (analogRead(1)/4));

Why a duplicate post? We already addressed your question here: http://forum.arduino.cc/index.php?topic=286035.0

Krupski:
Why a duplicate post? We already addressed your question here: http://forum.arduino.cc/index.php?topic=286035.0

I actually removed the question in that post since it seemed unrelated, but you replied in the old one, and I submitted a new post before I realized you replied.. sorry about that

P.S.: I think it would be an interesting research for Arduino guys to try and come up with a way to analogRead an LED.. would make a lot of things easier

No it would not make things easier, it would just make you program a lot worse.
No it would not be interesting. All you have to do is to buffer the signal, smooth it, feed it into an analog port and then map the resulting signal back into the PWM value. But that is a PITA compaired with just keeping the value in a variable.

This thread is just daft.

Are you familiar with the = operation? It is used to store a value in a variable. When you use analogWrite, you simply have to follow it with this cunning feature to store the same value in a variable.

If you then want to use the same value for another analogWrite you simply use the same variable as a source for the value.