ted
February 7, 2018, 3:49pm
1
For analog input we are using external resistor divider for bias, can be that replaced by command which will pull up to 50% of 5V or 3.3V ?
I was trying but I have an error.
The code
pinMode(encoderAPin , INPUT_PULLUP);
pinMode(encoderBpin , INPUT_PULLUP_HALF);
Error
'INPUT_PULLUP_HALF' was not declared in this scope
system
February 7, 2018, 3:52pm
2
can be that replaced by command which will pull up to 50% of 5V or 3.3V ?
No. The resistor is in place, or not. What you are asking for is like being hald-pregnant. Are you planning to have half a baby?
For analog input we are using external resistor divider for bias, can be that replaced by command which will pull up to 50% of 5V or 3.3V ?
No.
What overall voltage is being divided by the resistors ?
ted
February 7, 2018, 4:33pm
4
fot uno 5V forstm32 3.3V. I was just wondering it is possible or not.
Most people use a digital input, rather than an analog input, to read an encoder.
Wonder if there's anyway to get it to turn on both the PULL UP and PULL DOWN resistors simultaneously? And, are they equal value?
Anyway, external divider is the more conventional way to go. Don't be a test pilot if you don't have to.
ted
February 7, 2018, 4:41pm
7
that bias is used for analog signal input not for encoder.
system
February 7, 2018, 4:44pm
8
Wonder if there's anyway to get it to turn on both the PULL UP and PULL DOWN resistors simultaneously?
Arduinos don't have pull down resistors.
ted
February 7, 2018, 5:05pm
9
I am using two resistors no problem, but less components on testing board will be nice.
Maybe I should change the name of the topic to - set up analog input bias to 2.2V internally?
gfvalvo
February 7, 2018, 5:06pm
10
PaulS:
Arduinos don't have pull down resistors.
I stand corrected, thanks.
Which Arduino are you using? AVR based ones (Uno, Mega, Leonardo) only have pull ups, but some of the ARM based ones might have both.
gfvalvo
February 7, 2018, 5:26pm
12
Jiggy-Ninja:
Which Arduino are you using? AVR based ones (Uno, Mega, Leonardo) only have pull ups, but some of the ARM based ones might have both.
ah...thought I saw it somewhere. This does indeed compile for Teensy 3.2:
pinMode(encoderAPin , INPUT_PULLDOWN);
ted
February 7, 2018, 5:35pm
13
Sorry guys - please ignore encoder - analog input pull up 50%
Read the datasheet of the processor or peripherals (if applicable) on the board. For e.g. AVR based boards, as said, not possible.