I am build a robot with my Arduino and I've run into a problem. I have 2 5V motors that change direction by switching the voltage and the ground. Is there a way to make a digital pin act as a ground?
You mean like HIGH and LOW?
AWOL:
You mean like HIGH and LOW?
Well, if LOW acts as a ground, then yes.
As a digital signal GND, yes, as a power GND, no.
How much experience in programming and in electronics do you have?
.
LarryD:
As a digital signal GND, yes, as a power GND, no.
digitalWrite() - Arduino ReferenceHow much experience in programming and in electronics do you have?
.
I'm 13. Not much, but I have been programming for about 4 years.
9 years of age when you started programming.
WOW!
If you have the following line of code the pin selected goes LOW or to 0 volts.
This is a logic level LOW and cannot be used to significantly provide a power ground.
digitalWrite(myPin, LOW); // make myPin go to 0 volts, logic LOW
What are you trying to do with the LOW from a digital pin?
.
The I/O pins on an Arduino can supply (if at 5v) or receive (if at 0v) about 20mA and 40mA is the absolute max. That is what @LarryD meant when he said they could not act as GND for power - such as for a motor.
...R