Is there any other way to invert a signal apart from using an op-amp?
I am inverting a square wave from a function generator to an LED through an op-amp.
Problem: I am also using
simulate this circuit – Schematic created using CircuitLab
An analog switch IC to control (stop) the signal going through the LED if needed (by closing and opening the switch with 5V).
The led lights up and flashes as needed without the involvement of the switch, but when I connect the function generator through the analog switch to the op-amp, the LED stops flashing and is dimly lit. When I check the signal in the oscilloscope, there is a slight voltage, instead of a 5V square pulse.
Is it because of the op amp?
Connections: function generator : op-amp: transistor: resistor: led
function generator: switch: op-amp: transistor: resistor: led