What is the code to discharge a capacitor? How is hardware setup to discharge a capacitor? I have the Arduino measuring voltage on ADC pin 0. Please help. Thanks
What is the code to discharge a capacitor?
digitalWrite(CapacitorPin, LOW);
How is hardware setup to discharge a capacitor?
Connect the - side of the capacitor to Ground and the + side of the capacitor to a pin.
I have the Arduino measuring voltage on ADC pin 0.
Interesting. Was that supposed to be relevant to your questions?
cuteguy570:
What is the code to discharge a capacitor?
How is hardware setup to discharge a capacitor?
These two questions are interdependent. One cannot be answered without first knowing the answer to the other.
Furthermore, I would not connect a charged capacitor of any significant size directly to a microcontroller pin and then set the pin low. The inrush current could easily exceed the MCU's absolute maximum rating. The result could well be this: http://arduino.cc/forum/index.php/topic,96408.0.html