Hello, i want to send the 10-bit analogread from A0 to the 8-bit PORTB pins.
That means i have to set ADLAR =1 and send ADCH to PORTB.
How can i do this?
Thanks
Sam.
Hello, i want to send the 10-bit analogread from A0 to the 8-bit PORTB pins.
That means i have to set ADLAR =1 and send ADCH to PORTB.
How can i do this?
Thanks
Sam.
What Arduino board are you using?
On an Uno. for example, some of the pins in every Port have special uses.
The Arduino IDE understands the names of all the registers so you could, in theory, do
PORTB = ADCH;
Your requirement seems strange, what is your project?
...R
Sam190:
Hello, i want to send the 10-bit analogread from A0 to the 8-bit PORTB pins.
You could:
PORTB= analogRead(A0) >> 2; // write upper 8 bits of ADC value to portB
That means i have to set ADLAR =1 and send ADCH to PORTB.
If you were using a processor which had some form of DMA that might be possible directly.
Yours,
TonyWilk
My project is the swap of the accelerator pedal from an engine test stand with a potmeter.
http://www.cw-industrialgroup.com/getattachment/9bbc3a5c-2bf4-4b48-b6a8-b983e171a713/wm-830_technical_information
The pedal has 2 outputs
Sam190:
My project is the swap of the accelerator pedal from an engine test stand with a potmeter.
http://www.cw-industrialgroup.com/getattachment/9bbc3a5c-2bf4-4b48-b6a8-b983e171a713/wm-830_technical_information
The pedal has 2 outputs
I think I'm confused here...
a. You have a pedal with one of those Rotary Position Sensors on it.
b. The sensor has dual redundant outputs.
c. You want to swap this out and replace it with a potentiometer ?
Is that correct ?
If so, you'll have to find out if the position sensor you have is the Voltage or PWM version.
If it is the Voltage version... why do you need an Arduino?
Yours,
TonyWilk