I have the following example circuit:
I do not understand why this lights the LED. For my main project I am building a circuit that has a button connected to an output as well as the collector of the transistor as shown in the diagram. The circuit works as expected when I put the LED on the collector instead of the emitter, but this solution will not work for my overall setup. Even a 1M Ohm resistor allows current through. Am I just using transistors wrong?