Go Down

Topic: neither send 0 nor 1 as digital (Read 1 time) previous topic - next topic

karlok

Hello,

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

My code (simplified):
Code: [Select]
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
using Arduino Uno Rev 3

AWOL

What don't you understand about binary?
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

dhenry

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


Tri-state it.

BulletMagnet83

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?

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. 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

fungus


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.
No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

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.

karlok


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.

using Arduino Uno Rev 3

dhenry

Quote
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.

mauried

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.

dlight

#10
Oct 12, 2012, 10:55 am Last Edit: Oct 12, 2012, 11:00 am by AWOL Reason: 1
Maybe not exactly what you are looking for, but check this forum post.

Moderator edit: removed quotes from URL

Grumpy_Mike



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.

Graynomad

Quote
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
Rob Gray aka the GRAYnomad www.robgray.com

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)

fungus


Quote
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.

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

Go Up