I may have a silly question but I'm new to all this and I build a circuit with a Mosfet in it. I have a Arduino hooked up to the gate. And I'm powering a led for this instance. The mosfet works perfectly so when I send a signal to the gate of 100 the led dims.
But my question is: Is there a way that I could keep the gate that amount open. So lets say that if I break the gate connection with the arduino the gate should still be on 100 open instead of 0/255.
Thanks in advance,
With most Arduino outputs, when you do AnalogWrite you are not setting the voltage of the output. You are setting the duty cycle (percent on-time) of a digital signal that turns on and off. There are other chips that can generate that type of signal independent of the Arduino output but they are more complex to implement and program than just using another Arduino processor.
The Arduino Due (and most other ARM based Arduinos) have a couple of actual analog outputs (DACs) which changes what is happening with the gate, but doesn't really change the solution.
So, in short, no. There is no simple way to keep the gate in that state after disconnecting the Arduino pin. Depending on what you are actually trying to accomplish there might be other solutions.
EDIT - google Charlieplexing if you want to drive a large number of leds from an arduino.