turning digital output off

I'm pretty experienced with electronics and programming but this is my first experience with arduino. I have some basic programming questions and can't seem to find what I'm looking for. I am using a blend micro board wired to a remote for an adjustable bed so I can raise and lower it with my computer. It is simple digital out switches so I must be missing the basics.

I understand how to disable the digital pins and am using this

digitalWrite(Pin0, LOW);

but there is no function for opening the circuit? should I just change the mode? pinMode(Pin0, INPUT);

am I missing something basic here?

Try digitalWrite(Pin0, HIGH); ;)

https://www.arduino.cc/en/Reference/DigitalWrite

In setup(), declare a pin to be an OUTPUT: pinMode (pinX, OUTPUT); Then use it in loop() : Make an output LOW: digitalWrite(Pin0, LOW); // as you had Make an output HIGH: digitalWrite(Pin0, HIGH); // as you had

Make a pin an INPUT in setup(), that is read as high until an external button/switch connects it to Gnd: pinMode (pinX, INPUT_PULLUP); In loop() :

if (digitalRead (pinX) == LOW){ // pin has been pulled to Gnd, act on it
// whatever the code does for an active input, such as
digitalWrite (ledPin,  HIGH);
}
else { // do something else
digitalWrite (ledPin,  LOW);
}

it was my understanding, granted an understanding that could be totally wrong, that HIGH just sends voltage. That is how the description reads?

That all depends on what exactly you have it connected to. HIGH makes the pin at +5V and LOW makes it at 0V. Whether or not current flows is all a matter of what is connected to that pin.

Do you mean high-impedence ( aka tri-state) ?

What switch? Is there a relay or something? An output doesn't close or open a switch unless it is wired up to do that? All it does is output either 0 or 5 V. If you want to know how that 0 or 5 V operates some switch then you'll have to give us some details about the switch and the wiring.

High turns on the transistor that connects the pin to Vcc (5V on Uno). If the load draws current, (like a resistor to LED to Gnd) then current will be flow out (current source) up to the limit of the transistor. 20mA is pretty safe. 40mA or more can damage the transistor. Low turns on the transistor that connects the pin to Gnd. If the load can supply current, (like 5V to a resistor to LED to the pin) then current will flow in (current sink) up to the limit of the transistor. 20mA is pretty safe. 40mA or more can damage the transistor.

A switch in the normal sense is used as an input device, connecting a pin to +5 or Gnd. A relay is used as an output device, you source or sink current thru its coil to close its contacts.

What is the switch you refer to?

I wonder at your use of the variable name “pin0” - just in case it has the value of 0 which would mean that you are playing around with digital Pin 0 (note the space) which is the Rx pin. It is best not to use Pins 0 and 1 as they are used for Serial communication.

…R

I am wiring the digital output to a remote control, so essentially the output will emulate a finger press. I am so I can’t use the remote and need to send the command from my computer .

I am simply trying to open and close a circuit, emulating a button press.

AllEyes: I am wiring the digital output to a remote control

So you just took a wire out of Arduino and stuck it to the side of a remote control? That doesn't make much sense. I'm sure there was a particular component there that you connected to. That component is connected to other components. Without those sorts of details there's nothing we can do for you.

Even a rough hand drawn schematic would be helpful. Or even a description of what components are involved and where you have attached your wire. You gotta give us something to work with.

If you mean that you've connected the wire to one side of the button contacts where the button would normally drive a contact to ground and using the Arduino to connect to ground simulates the button press, then setting the pin to HIGH would simulate the button not being pressed.

On the other hand, Arduino levels are 0 & 5V, remotes run at 3V (mine only have 2 batteries, so pretty sure its 3V). Putting 5V on a pad that is expecting 3V could damage things. Can you probe around in the remote and see what voltage levels are used? Might need to wire a low coil current relay across each button, let the Arduino control the relay to close the button contacts.

Delta_G: If you mean that you've connected the wire to one side of the button contacts where the button would normally drive a contact to ground and using the Arduino to connect to ground simulates the button press, then setting the pin to HIGH would simulate the button not being pressed.

precisely. Setting it to HIGH and INPUT you mean? If I set it to OUTPUT and HIGH it will send voltage, no?

AllEyes:
precisely. Setting it to HIGH and INPUT you mean? If I set it to OUTPUT and HIGH it will send voltage, no?

Who knows. You still won’t show us how it is wired. Are we supposed to guess?

Yes, OUTPUT and HIGH puts 5V. INPUT and HIGH turns on a pull-up resistor and also puts out 5V but much much less current is possible that way. Who knows which you need? You won’t show us how the damned thing is wired up.

That makes no sense. That switch doesn't do anything but connect the two Arduino pins. The state of the pins has nothing to do with whether or not the switch in that drawing is open or closed.

I suspect you should find someone with a little knowledge of electronics to help you look at your circuit and figure out what you have.

Disabled or not, you could try to be precise about what you want. We have no idea. We can't see the remote. We don't of yet even know what kind of remote you're talking about. We don't know what your wiring looks like. We don't know what you want to control. We know nothing other than that you seem to think that writing a LOW to a pin will close the circuit yet somehow writing HIGH to the same pin won't open it. That makes no sense. So we're sort of stuck. I wish you luck, but I fear you're going to need someone to come look at what you have.

If you can't draw a picture, then how did you get the wires connected? I assume someone helped you. Could you get them to draw a picture for us?

You're still speaking in vague terms without telling us what we are working on. When you say "lift a ground" you mean take it to some positive voltage?

AllEyes: i posted a picture above. I'm simply looking to ground a output, in this case pin0 and gnd, then lift the ground with code, if possible. it might be that I can't do this with a single pin.

My huge guess is that you want the Arduino to ground something external to the Arduino (the switch you showed us is only for illustration, to show what the circuit should do?

In that case, An Arduino output won't work, you would need at least an external transistor to do the "grounding".

But I am guessing.

The way buttons in a remote typically work is that one side of the button is connected directly to ground and the other side of the button is connected to some control circuit and a resistor is used to pull the voltage on that side of the pin up to some positive value, usually the battery voltage. When the control circuit sees a positive voltage it knows the button isn't pressed and when it sees 0V it knows the button is pressed.

To simulate the pressing of a button you can connect an Arduino pin to the side of the button that goes to the control circuit. If you put 0V at that point by writing the pin LOW then the control circuit sees 0V and thinks the button is pressed. If you write some positive voltage (usually the same as the battery voltage for the device) to that same point then it will see a positive voltage and think the button is not pressed.

So you write an OUTPUT pin LOW to press the button and HIGH to release the button on the remote. The only caveat is making sure that you are writing the right HIGH voltage. If the remote runs at 3V then you'd need a transistor there to switch the 3V signal using the 5V signal.

If you're going to continue to refuse to give us any details to work with, then that's the best anyone can give you. Either take that or come back with some details on the circuit you want to control. Not what you think you have to do to control it, but real details on the actual circuit you want to control.