neither send 0 nor 1 as digital

Hello,

how to neither send 0 nor 1 on a digital output?

My code (simplified):

pinMode(5,OUTPUT);
digitalWrite(5,HIGH);

This is for a transmitter and I don't think that sending LOW is the same as doing nothing...

I want to do the same as cutting the line would do.

Thank you

What don't you understand about binary?

how to neither send 0 nor 1 on a digital output?

Tri-state it.

If your transmitter has a chip-select / enable pin, use that to turn it off when you're not transmitting. Is that what you're after?

Hmm, in digital devices something is either 0 (low/false) or 1 (high/true). It cannot be both, and it cannot be neither. However, if you don't want to output anything at all on a pin, set the pin as an input. That way the arduino won't drive the connecting pin. This means some other device can set the pin level. If no device drives the pin, its state is undefined (it can be anything and everything). Digital things don't like undefined (undefined is not a number), so you may want to avoid that last situation.

Pieter

pbrouwer:
Hmm, in digital devices something is either 0 (low/false) or 1 (high/true). It cannot be both, and it cannot be neither. However, if you don't want to output anything at all on a pin, set the pin as an input.

Set the pin as an input AND turn off the pullup resistor by setting the output to 0.

fungus:

pbrouwer:
Hmm, in digital devices something is either 0 (low/false) or 1 (high/true). It cannot be both, and it cannot be neither. However, if you don't want to output anything at all on a pin, set the pin as an input.

Set the pin as an input AND turn off the pullup resistor by setting the output to 0.

Yep, unless you want the pin to default to 5V that is.

fungus:
Set the pin as an input AND turn off the pullup resistor by setting the output to 0.

That's good!
Thank you very much.

Set the pin as an input AND turn off the pullup resistor by setting the output to 0.

The part after "AND" is not necessary.

What type of Transmitter is being used?
If its a simple ASK Transmitter , then leaving the data pin in a high impedance state can cause the
transmitter to intermitantly transmit , as the voltage on the pin will float around.
Much better to leave it with a 0 on the data pin.

Maybe not exactly what you are looking for, but check this forum post.

Moderator edit: removed quotes from URL

karlok:

fungus:
Set the pin as an input AND turn off the pullup resistor by setting the output to 0.

That's good!
Thank you very much.

While that is correct what ever you are doing I don't think you need to do this at all. If you are connecting the pin to the input of another chip you do not want it floating as it is called.

What don't you understand about binary?

That there are only 10 types of people in the world...those that understand binary and those that don't.

Yeah I know, it's an old one, but it still cracks me up.


Rob

To me... floating means... I will allow the mysterious spirits of the Ether and Paranormal to decide the fate (state) of the pin in question. (or let my finger decide)

dhenry:

Set the pin as an input AND turn off the pullup resistor by setting the output to 0.

The part after “AND” is not necessary.

Nope. It’s definitely necessary.

Grumpy_Mike:

karlok:

fungus:
Set the pin as an input AND turn off the pullup resistor by setting the output to 0.

That's good!
Thank you very much.

While that is correct what ever you are doing I don't think you need to do this at all. If you are connecting the pin to the input of another chip you do not want it floating as it is called.

He never said what he's trying to do. Maybe it's something like charlieplexing where you want the Arduino completely isolated from the piece of wire connected to the pin.

(or let my finger decide)

The Fickle Finger of Fate? :stuck_out_tongue_closed_eyes:

pwillard:
To me... floating means... I will allow the mysterious spirits of the Ether and Paranormal to decide the fate (state) of the pin in question. (or let my finger decide)

Not if you are using wired OR.

AWOL:

(or let my finger decide)

The Fickle Finger of Fate? :stuck_out_tongue_closed_eyes:

I was messing with an arithmetic circuit (16x16 multiplier - Logic Devices LMU18) that uses a clock and I wanted to use it as a straight combinatorial circuit. So once everything was wired up it was all working but nothing to trigger the rising edge that causes the multiplication. What to do? I soldered a wire to that pin and touching it triggered the multiplication. There is your fickle finger of clock fate. Not a smart idea, right? Fortunately I didn't fry it. I wired a 555 to produce a 1Khz signal to that pin and now it produces a 16x16 multiplication 1000 times a second, running at about 1/28,000th of its worst-case rated speed. Whoot.