REsistors for inputs

Status
Not open for further replies.

carcaes1

Well-known member
Hi everybody

I am testing the teensy like a joystick and i have tested some resistors ( 100 ohm, 200, 300, 1k, 10k, 100k) between inputs without using and GND and always the value is flickering.

How can i get the inputs without connecting give me a 0 (low) value?

Thanks in advance
 
logical low is when input voltages is less than about 0.8 volts.
Does the joystick have contact closures for its switches, and those joystick's common GND go to the same ground (GND pin) of the teensy?

generally, a resistor like 10K or less connected from the Teensy I/O pin to GND, will yield a logic low. If you apply more than the 0.8V (as above), say 1.5 or 3.3V to that with the resistor still connected, you'll see a HIGH.
 
Thanks!!!

Finally i solved with this code in setup of the sketch and without resistors.

When teensy is loading (setup part), I test if all analog inputs are disconnected, comparing with high value 16 bits (65535) because there are in HIGH, and i put 0 the value.

If i have connected a potentiometer (for example), as the value is different, works well.



Code:
void setup() {
  
  analogReadRes(16);
  analogReadAveraging(16);
  analogReference(EXTERNAL);
  
  if (analogRead(0) == 65535 ) valor=0;
  if (analogRead(2) == 65535 ) valorz=0;
  if (analogRead(3) == 65535 ) valory=0;
  if (analogRead(4) == 65535 ) valorzr=0;
  if (analogRead(5) == 65535 ) valorslide1=0;
  if (analogRead(6) == 65535 ) valorslide2=0;
 
Last edited:
Another question

I use these inputs as analogic of 16 bits. So what kind of resistors should i use? 10 kohm input&GND?

And the value of this input when i connect a potentiometer, will be correct?

Thanks in advance
 
Finally i solved better with resistors.

I have used a resistor of 10 kohm and works perfect between AGND and analogics inputs

Cheers
 
Last edited:
Status
Not open for further replies.
Back
Top