arduino and potentiometer. - ED Forums
 


Notices

Reply
 
Thread Tools Display Modes
Old 08-12-2019, 06:06 PM   #1
BULLITT83
Junior Member
 
Join Date: May 2018
Location: SOUTH OF FRANCE
Posts: 38
Default arduino and potentiometer.

which potentiometer did you use on your arduino . actully i try 10 Ko potentiometer to simulate my tacan course selection and it is " too fast " .... how do "slow down" the pointer ?

same with rotary encoder , how to tune the sensivity of this switch , i made almost 180° at each step ? ...

please help
BULLITT83 is offline   Reply With Quote
Old 08-12-2019, 09:04 PM   #2
Warhog
Member
 
Warhog's Avatar
 
Join Date: Dec 2012
Location: Nova Scotia, Canada
Posts: 731
Default

Potentiometers are only suitable for controlling things like volume or brightness types of controls. But 10k is a good selection for a pot. For items like channel selectors, course and heading knobs(HSI), altimeter pressure and even volume controls, I use a rotary encoder.

To control how large a step the rotary encoder makes is done by adjusting the code as follows:

This is the basic rotary encoder code from the control reference docs for course knob on the HSI:

DcsBios::RotaryEncoder hsiCrsKnob("HSI_CRS_KNOB", "-3200", "+3200", PIN_A, PIN_B);

To adjust the size of the step, you change the -3200 and the +3200 to, lets say -1000 and +1000, or -2000 and +2000. Experiment with these setting and see what works best for whatever you are wanting to control.
__________________
Regards
John W
aka WarHog.


WIN 10 Pro, i8-8700k @ 5.0ghz, ASUS Maximus x Code, 16GB Corsair Dominator Platinum Ram,
AIO Water Cooler, M.2 512GB NVMe,
500gb SSD, EVGA GTX 1080 ti (11gb), Sony 65” 4K Display
VPC MongoosT-50, TM Warthog Throttle, TRK IR 5.0, Slaw Viper Pedals
Warhog is offline   Reply With Quote
Old 08-13-2019, 07:02 AM   #3
BULLITT83
Junior Member
 
Join Date: May 2018
Location: SOUTH OF FRANCE
Posts: 38
Default

Warhog, thanks a lot for your answer ,

i'll try this .

may i ve anothger question : i build a sweep wing lever with a 10Ko Pot . but mechanicaly i can "move " the lever only on 90° ... so i don't have the full movement of the in game lever .... it works with my pot outside of my pit with his normal 270° movment.

How to have full in game lever travel with only 90° of real potentiometer movement ? increase or decrease potentiometer value may be a solution ? isn't it ?

regards

guillaume
BULLITT83 is offline   Reply With Quote
Old 08-13-2019, 05:23 PM   #4
Warhog
Member
 
Warhog's Avatar
 
Join Date: Dec 2012
Location: Nova Scotia, Canada
Posts: 731
Default

You should post your full code otherwise its hard to tell what may be causing this. Also, this may be better served by using a rotary encoder. Regardless, lets see your code and maybe we can fix this.
__________________
Regards
John W
aka WarHog.


WIN 10 Pro, i8-8700k @ 5.0ghz, ASUS Maximus x Code, 16GB Corsair Dominator Platinum Ram,
AIO Water Cooler, M.2 512GB NVMe,
500gb SSD, EVGA GTX 1080 ti (11gb), Sony 65” 4K Display
VPC MongoosT-50, TM Warthog Throttle, TRK IR 5.0, Slaw Viper Pedals
Warhog is offline   Reply With Quote
Old 08-13-2019, 06:00 PM   #5
BULLITT83
Junior Member
 
Join Date: May 2018
Location: SOUTH OF FRANCE
Posts: 38
Default

First ...i was happy of my simpit since i click on your FLICKR link ... amazing job is your sim pit !!!

next here is my code , very basic

DcsBios:otentiometer pltEmergWingSweepltLever("PLT_EMERG_WING_SWEEPLT_LEVER", A0);
BULLITT83 is offline   Reply With Quote
Old 08-13-2019, 09:45 PM   #6
Blue73
Member
 
Blue73's Avatar
 
Join Date: Oct 2010
Location: Perth, Australia
Posts: 372
Default

Hi, I've added extra functionality to the Potentiometer function, it'll help you here. I can give you my header file if you like?

Quote:
Originally Posted by BULLITT83 View Post
First ...i was happy of my simpit since i click on your FLICKR link ... amazing job is your sim pit !!!

next here is my code , very basic

DcsBios:otentiometer pltEmergWingSweepltLever("PLT_EMERG_WING_SWEEPLT_LEVER", A0);
Blue73 is offline   Reply With Quote
Old 08-13-2019, 09:46 PM   #7
JG14_Smil
Senior Member
 
Join Date: Dec 2008
Posts: 2,330
Send a message via MSN to JG14_Smil
Default

Hello,

Are potentiometer's seen as HID devices when used with Arduino? Curious as some source of calibration can be important.
JG14_Smil is offline   Reply With Quote
Old 08-13-2019, 09:58 PM   #8
Blue73
Member
 
Blue73's Avatar
 
Join Date: Oct 2010
Location: Perth, Australia
Posts: 372
Default

No this is DCS-BIOS, 0->65535 represents GND->Aref(V).

Quote:
Originally Posted by JG14_Smil View Post
Hello,

Are potentiometer's seen as HID devices when used with Arduino? Curious as some source of calibration can be important.
Blue73 is offline   Reply With Quote
Old 08-15-2019, 02:27 PM   #9
BULLITT83
Junior Member
 
Join Date: May 2018
Location: SOUTH OF FRANCE
Posts: 38
Default

Blue it works perfectly with your code !!!! thats great ! i managed to tune my axis perfectly ! without changing potentiometer value !
great

THANKS A LOT
BULLITT83 is offline   Reply With Quote
Old 08-15-2019, 02:39 PM   #10
Blue73
Member
 
Blue73's Avatar
 
Join Date: Oct 2010
Location: Perth, Australia
Posts: 372
Default

That's great to hear, glad it worked out! There's polling function in there too, so if you want the current position sent to the sim on startup take a look at my other thread, or I can help you here.

cheers

John


Quote:
Originally Posted by BULLITT83 View Post
Blue it works perfectly with your code !!!! thats great ! i managed to tune my axis perfectly ! without changing potentiometer value !
great

THANKS A LOT
Blue73 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 03:17 AM. vBulletin Skin by ForumMonkeys. Powered by vBulletin®.
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.