Это видео недоступно.
Сожалеем об этом.

Arduino Joystick 2.0 Library - Beginners Guide

Поделиться
HTML-код
  • Опубликовано: 15 авг 2024
  • A beginners guide to using the Arduino Joystick 2.0 Library, by MHeironimus
    Github for Library
    github.com/MHe...
    Files mentioned in video (Sketch + AVR Board Folder)
    drive.google.c...
    The Library will only work on MEGA32u4 boards, such as the Arduino Pro Micro or Leonardo, or a AT91SAM board like the Arduino Due.

Комментарии • 208

  • @CRJ700
    @CRJ700 2 года назад +6

    I have decided that YOU are one of my favorite people in the entire world! Not just because you've got that cool accent thing going on, but because you posted something useful that went straight to the point. Thank you for saving me TONS time by posting this tutorial. It is VERY appreciated!

  • @Johan-ex5yj
    @Johan-ex5yj 2 года назад +10

    This is an excellent tutorial, thank you. 👍
    One possible improvement is to add the following in the setup section >>
    Joystick.setXAxisRange(0, 255);
    Joystick.setYAxisRange(0, 255);
    Joystick.setRzAxisRange(0, 255);
    Joystick.setThrottleRange(0, 255);
    That ensures that you get full range output, with no need to calibrate.

    • @CapungPlastik
      @CapungPlastik 2 года назад

      what's the different using "range" and map?

    • @Johan-ex5yj
      @Johan-ex5yj 2 года назад +8

      @@CapungPlastik In this example the guy is mapping the normal 10 bit analog range of 0 to 1023 to 0 to 255, because he wants the resolution to be bigger (less sensitive). The Joystick library, expects (by default) that the numbers will be 0 to 1023, so you will end up with a Joystick that has only 25% of if it’s full travel. That is why you need to specify that your range is 0 to 255.
      If however, you use the full 0 to 1023 resolution, you don’t need set the range, and you also do not need to do any mapping. In this case the range command is still useful if you need to invert an axis, then you go: …Range(1023, 0) instead of …Range(0, 1023) .

  • @ZachJackson-ri6lf
    @ZachJackson-ri6lf Месяц назад

    Thank you so much for this video, I have now successfully built my own flight sim Hotas complete with rudder pedals, a handbrake for racing, 2 joysticks for Farm / Construction Sim, and now a one handed controller / keyboard hybrid, and NONE of them would've worked if i hadn't found your video.

  • @arturkonczalski
    @arturkonczalski 16 дней назад

    Your first video that i watch, and already love it. Straight to the point. Solved all my issues with joystick.h. Cheers!

  • @SynisterGatess07
    @SynisterGatess07 5 месяцев назад +2

    i ve been looking the whole day for an in depth tutorial and finally found exactly what i needed. thanks

  • @avm263
    @avm263 Год назад +1

    Thankyou so much my dude! I just bought my leonardo after realising I wasn't able to do this with an uno, but didn't know where to go from there. I have some basic coding with arduino but felt really helpless after finding out about this library, your video helped me so much!!! Have a great day sir.

  • @nigelb5370
    @nigelb5370 3 года назад +20

    Many, many, thanks for this tutorial and example code. It was precisely what I needed for my simple DIY button box/potentiometer throttle. I would have been trying to figure out the 'right' code for months if I hadn't found your excellent video. As it was, I was able to program my Arduino in less than ten minutes and it worked perfectly first time.

  • @spencer.h561
    @spencer.h561 2 года назад +4

    I’ve been looking for this for so long, this is exactly what I need. I am trying to start making and selling flight simulator equipment and this knowledge is going to be extremely helpful!

  • @mirochlebovec6586
    @mirochlebovec6586 2 месяца назад

    This probably the most comprehensive guide for this library.

  • @nocloo6829
    @nocloo6829 5 месяцев назад

    Thanks for this very straightforward tutorial! I am new to Arduino and programming and was looking for exactly what you explained. I had been able to read out a potentiometer with arduino and I played around with Hieronymus' examples, but I could not figure out how to merge the two. Thanks to you, I am so much closer to creating my own flight sim peripherals!

  • @the_arrgyle9086
    @the_arrgyle9086 3 года назад +3

    THANK YOU! Made my first DIY Throttle yesterday. Out of an Arduino, Lego, some Wires, Hotglue, Rubber Bands, Hockey Tape and Ziplocks ;-)

  • @nvennep111
    @nvennep111 10 дней назад

    I do not react or like RUclips videos regularly, but wow, what a great video! Thanks for you help!!

  • @garytaylor5646
    @garytaylor5646 3 года назад +3

    I just have to say "" Thank you"", I have spent weeks searching RUclips for your video :) After many headaches of going through Arduino courses etc., I can now do this for my flight sim, totally enjoyed your no waisted info talk, please do more for us old simmers that are not electronics guys but really want to build our sims that work,

    • @danstechbox7077
      @danstechbox7077  3 года назад +1

      Thanks Gary! I plan on doing some vidoes on the basic concepts of arduino and sim controls, but just started a new job so squeezing it in when I can :)

  • @manch.gamingrodri8089
    @manch.gamingrodri8089 3 года назад +3

    Enormous thanks for the tutorial and amazing work explaining it, I really didn’t understood the examples of the library and this helped me a ton

  • @mheironimus
    @mheironimus 3 года назад +12

    Thanks for posting this video.

    • @RUMBLE.com_ClickthruMAN
      @RUMBLE.com_ClickthruMAN 3 года назад

      8 data is dat mean it just have 0 to 255 step/precision n how could it has 16bit precision without have latency so much sir?

  • @abirmahato648
    @abirmahato648 3 месяца назад

    best one out there. hats off man, this is amazing. I have been trying to do this myself for so long. thanks for the help man.

  • @Chef_PC
    @Chef_PC Год назад

    Just this one video has helped me immensely to get my button box going. Thanks!

  • @colins2
    @colins2 3 года назад

    Excellent, thanks for posting. I've just built a set of rudder pedals and now need to connect then up, so this tutorial was perfect.

  • @tonipaskalin6973
    @tonipaskalin6973 3 года назад +1

    You made my life so much easier, thank you so much for making this video.

  • @garethbarry3825
    @garethbarry3825 9 месяцев назад

    Incredibly useful and clear - thank you so much for this.

  • @vanusy
    @vanusy 3 года назад

    Thank you sooooo much. I don't know c++ at all and get my first leonardo, but with your guide i sucsessfully make my own sketch for my purpose. Thank you very much

  • @jeffonquest1001
    @jeffonquest1001 3 года назад +2

    Finally someone that explains it all!

  • @triodit
    @triodit Год назад

    Thank you so much! Your a legend and I'm SOOOOO referancing this in my design documentation!

  • @BokeFlyingSimulations
    @BokeFlyingSimulations 2 года назад

    this is an A MA ZING tutorial man. Congratulations, it is VERY helpful!

  • @SkyriderOfficial
    @SkyriderOfficial 10 месяцев назад

    Most valuable tutorial on the topic. Thanks!!!🎉🎉

  • @jmsian3505
    @jmsian3505 Год назад

    20:01 changing Arduino Name. Thanks for this!

  • @tbryson2
    @tbryson2 3 года назад +3

    Thank you for taking the time to present this! It's exactly what I've been looking for! One question though, when you were calibrating the axis, the visual indication was jumping all over the place! Obviously it didn't affect the outcome, but is that normal and / or something to "worry" about? Will that same jumping around be evident while using the Arduino as a joystick controller?

  • @Nikolas_A
    @Nikolas_A Год назад +2

    I run the multiple joystick example. It enumerates four joysticks (all named Arduino Micro). Is there a way to name each separately? E.g. Joystick1, Joystick2 etc

  • @NortheastLance
    @NortheastLance 3 года назад

    Dude this was great. It got me started and taught me a bit. Now i gotta figure out how to make a toggle switch act like a button

    • @BushidoShishido
      @BushidoShishido 3 года назад

      Please let me know if you ever figure that out!

  • @eugenebrown9803
    @eugenebrown9803 3 года назад +3

    waiting on your more complex teachings

  • @astonishing-a
    @astonishing-a 3 месяца назад

    Legend, Thanks for this!

  • @Joejoe-vd2do
    @Joejoe-vd2do 3 года назад

    I wish I could've liked this video more than once!

  • @cosmicp.o.m.e3460
    @cosmicp.o.m.e3460 3 года назад

    Thanks for confirming what I was afraid of misunderstanding :Thumbs UP: :)

  • @tannimkyraxx
    @tannimkyraxx 3 года назад +3

    The Mega and Uno can be flashed to report as HID, but it takes a bit of extra steps and the unojoy library is a little more limited

    • @fernank017
      @fernank017 2 года назад

      i've been trying to figure this out, how would I go about it?

    • @amrosero
      @amrosero 2 года назад

      Hi, I can get a Unojoy device with Mega and Uno, but can you personalize the setup, (Name of HID in PC)?

    • @arias80rp10
      @arias80rp10 8 месяцев назад

      Fernan, u should save all that effort and hours u will spend on that, and just buy any board tih atmega32u4 like leonardo or yue
      @@fernank017

  • @hakanviajando
    @hakanviajando 3 года назад

    Thank you very much for the greatly detailed video.

  • @davekelly4322
    @davekelly4322 Год назад

    Just what I needed. Thanks a lot

  • @johanns.rivera3480
    @johanns.rivera3480 Год назад +1

    it says that I have downloaded the library and it shows in my library folders but i get an error message saying there is so such file as joystick .h

  • @sudipthapa9877
    @sudipthapa9877 2 года назад

    You are my god bro wow ❤️❤️❤️ ,thank you very very much dude much appreciated.

  • @requiem4adreamc
    @requiem4adreamc Год назад

    Very detailed and informative video. Thank you very much :) I am gonna make an button box and diy analog handbrake. I hope i can manage to do them :)

  • @Linrox
    @Linrox Месяц назад

    Very helpful video. Can you show how to use a toggle (on-off) switch as a button.

  • @dmmuller
    @dmmuller Год назад

    Thanks for taking the time to make this video and explain the steps thoroughly. Did you ever complete the button matrix version at all?

  • @HansVGinkel
    @HansVGinkel 3 года назад +2

    Hi, is it possible with this Joystick.h 2.0 library to make a XBOX 360 or XBOX ONE PC controller?
    I have a PC game that only accepts that type of controller.
    Or do I need the XInput.h library instead?
    (I'm breaking my head on this)

    • @danstechbox7077
      @danstechbox7077  3 года назад

      Joystick 2.0 take inputs in and spits them out to the OS as a dedicated HID input device, which is recognisable by most kinds of OS. The XInput library emulates control input by pretending to be a Xbox 360 controller, and triggering command presses on that virtual controller.
      XInput is limited to 10 + 1 Buttons, 2 Two-Axis joysticks, Two analog triggers, and a single D-Pad hat switch. Joystick 2.0 gives you 32 buttons, 10 Axis, and 2 Hat switches depending on your configuration.
      In theory, it should be able to work with both Joystick.h and Xinput.h as they both produce controllers using the HID interface, but I'd test it on your system as they both use the same family of boards. From there, depending on your use case, choose which library fits your purpose.

    • @HansVGinkel
      @HansVGinkel 3 года назад

      @@danstechbox7077 Thanks for your answer.
      In the meantime I've tried both libraries.
      It's only recognised as a XBOX controller with the XInput.h library. It's not being recognised as a XBOX controller with the Joystick.h 2.0 library.

  • @felipeyoshino6951
    @felipeyoshino6951 2 года назад

    Easiest like I've ever gave in a video

  • @SwoodyCraft
    @SwoodyCraft Год назад

    Excellent tut. Thank you

  • @sirnewhill
    @sirnewhill 3 года назад

    Thanks, this video was very helpful!

  • @user-fy3xh7oj7c
    @user-fy3xh7oj7c Год назад

    Hello, thanks you, but can you help me with rotation x and rotation y, I can't to turn on them

  • @casperhxr6018
    @casperhxr6018 2 года назад

    Very helpful, thank you!

  • @agenchicken
    @agenchicken 3 года назад +1

    Nice video man good job and ty for helping us! If I can ask you if you can explain how the steering and brake work and how we can use this library for making a steering wheel and if I can. Ty for everything and also you have a really nice voice!

    • @danstechbox7077
      @danstechbox7077  3 года назад +1

      Thanks for the complement! I do actually do some voice work at times!
      As for your question, thats fairly straight forward. Instead of defining the Axis as X,Y, Rz, and Throttle as I did in the video, you can define the axis as any of the avalible in Windows HID, as shown in the avalible axis when you define your joystick (I have them listed out in the example code in the description). In your case, you could make a pedal set using Accelerator and Brake as Axis, with possibly a Digital Button for a Clutch (depending on your use case), and then using the Steering Axis for the steering wheel - really depends on how complicated you want your setup to be.
      The reason you would use the Steering, Brake, and Accelerator axis as opposed to just using an X and Y axis on seperate physical units (such as two potentiometers) is that Windows joins these two together - the Steering, Brake, and Accelerator axis are reserved axis, and are seperated in the HID system so they dont have any dependancies on eachother. While most games can seperate them, there is no guaruntee as different generational implementations of the HID system can get veeeery messy, so it is better to approach it correctly from the HID controller end to avoid any overlaps in the HID software and game decoding.
      You can pretty much use any potentiometer, or even magnets and Hall-Effect sensors (Will be doing another video on that now my 3D printer is working again), to give you an analog input, however you will need to add a hardware return device (such as a spring or something) to make sure it goes back to reading the middle of the axis, however there are some deadzone tools in both the Windows HID setup and the Joystick 2.0 library (I think) to enable a wider middle section if you cant get an exact centre and find your wheels/rudder/other steering device is slightly leaning when it should be central. This is something I would like to approach in another video with my own Joystick and Flight Control system, but I'm still designing that so in the meantime that should give you a good idea of what to consider when designing/building your own steering wheel and possibly pedal set.
      You can also make digital buttons work as analog axis at 100% using some clever coding, which I will do in another video shortly, if you want to have a button on the steering wheel for brake but dont want to use a digital button, and would rather use the Brake Axis - but that depends more on how you're building your steering wheel and what games/software you want to use it on.
      Hope that answers your question well enough, but let me know if you have any more specific questions or would like me to clarify anything.

    • @agenchicken
      @agenchicken 3 года назад

      @@danstechbox7077 Yeah ty for all of the information is really helpful but I have 1 more question I have no problem with the steering wheel and pedals with an optical encoder and potentiometers but the strange thing is in the game f1 2020. I have a very hard time setting the controls and sometimes it does not even detect it. but in the game Asseto corsa I have no such problems and it's working wonderfully. If you have any idea why it's doing that its going to be amazing ty again for the help.
      Also, I want to have force feedback and I have found a joystick library similar to that one but I am not sure how the schematics go and what should I do if you can help me it will be amazing.
      This is the library github.com/YukMingLaw/ArduinoJoystickWithFFBLibrary

  • @ChainsawDNA
    @ChainsawDNA 2 года назад

    Excellent tutorial!

  • @JovendinamicololSP
    @JovendinamicololSP Год назад +2

    guys I'm not an native english speaker so i didn't understand the difference between (THROTTLE and ACCELERATOR) if it's the same thing why there're two ways to say the same thing? my english is a work in progress so Sorry!

    • @Dcscockpit
      @Dcscockpit 7 месяцев назад +2

      Yes they are the same thing when people use both terms, the reason there are two terms is because they are technically different terms. So let’s say your driving your car, and you push your foot on the gas pedal, that would be an accelerator, doesn’t matter if it’s an electric care or a gas vehicle, it’s always going to accelerate. A throttle may control engine rpm on something that doesn’t even move, like a lawnmower engine for example. Most times when people say the two words they are interchangeable .

    • @VstromVroomer
      @VstromVroomer 5 месяцев назад +1

      In a nutshell:
      an accelerator you press and then you stop pressing it it returns to idle.
      A throttle, you move it and it stays in that state.

    • @JovendinamicololSP
      @JovendinamicololSP 5 месяцев назад

      @@Dcscockpit thank you it helped a lot

    • @JovendinamicololSP
      @JovendinamicololSP 5 месяцев назад

      @@VstromVroomer thanks i took some time trying to understand the about this topic

  • @yeloyoung9944
    @yeloyoung9944 2 года назад +1

    how can we integrated a bluetooth module on it?

    • @vahida6146
      @vahida6146 6 месяцев назад

      Did you find any answer for this question?

  • @joaolancha8824
    @joaolancha8824 3 года назад +2

    Hey dude, Amazing video, helped me so much. Im running into a little bit of an issue, i dont know if maybe you can help me. Im currently making a button box for xplane, and to do a test i just connected a toggle switch to the arduino micro and made a joystick (exactly like you did) but with only one button, uploaded the code and tested on the windows manager for usb game devices, everything was working.However, when i connect the arduino micro and go into Xplane the game freezes, do you have any idea what can be causing this issue? Thanks in advance

    • @danstechbox7077
      @danstechbox7077  3 года назад +1

      Glad it helped you! It could be a number of things.
      I know XPlane has a few reserved USB device ID's, so you might need to change the device ID as I outline in the video to something further along, just to ensure that it's not clashing with anything.
      With Toggle Switches, it could be the continous signal - in a few of my games I know i've seen this issue. I am currently working on a function module to take a toggle switch and get the code/windows to treat it as two discrete button presses, but I'll need a bit of fiddling to make sure it works, and likewise will also require some input on the user end to make sure that the switch position matches up with the simulation position.
      For now, try removing the toggle switches and using push buttons instead - see if that get's XPlane to play nice. Otherwise, try shifting the USB device ID along a bit in case you've hit a reserved value. Hope that helps.

  • @ourlifeofpoint3519
    @ourlifeofpoint3519 Год назад

    Very good tutorial, but 1 question. In the Set up USB game controllers the joystick recognized for calibration and use only hen the arduino ide sodtware runs. If the IDE close the controller stop working. Maybe stupid question, but why this happend? Need also software for communication? Thanks!!!

  • @chethy7353
    @chethy7353 3 года назад +2

    very helpful bro

  • @IronManhood
    @IronManhood Год назад

    Anybody know why my pro micro doesn't register as a game controller? I tested it in game and it seemed to work properly but I'm not able to calibrate it. Pretty annoying honestly.
    I must admit I'm a beginner and didn't understand the proper procedure for uploading to the board and went through a whole series of suggestions from different threads that I found with google. One suggesting that I uninstall the drivers and reinstall them. I did several times and eventually the board stopped showing as an arduino leonardo. I managed to figure out how to install the drivers located in the arduino ide installation but that didn't seem to fix it.
    -Should the board be using HID driver from 2006?-
    Edit: I managed to figure out the issue. It was my goal to include an ADS1115 in my project for higher precision and that was the problem. Specifically, calling the "Adafruit_ADS1X15.h" constructor before the "Joystick.h" constructor. So now I setup the joystick first and then the ads.

  • @UzairAli001
    @UzairAli001 Год назад

    I can't find boards.txt there is no hardware folder. I'm using Arduino IDE 2.0

  • @Marcin79W
    @Marcin79W 3 года назад

    Thank you, big help!

  • @naveenDEAS
    @naveenDEAS 3 года назад

    First of all I would like to thank you for providing such an informative and useful video. Really!!
    Actually I was planning to make a arcade joystick using a keyboard encoder taken out of a usb keyboard. But using a Arduino Leonardo looks much efficient and better.
    I have some questions!!
    I am planning to make a Mame arcade encoder with 4 direction keys + around 14 other keys to play and control the settings of Mame.
    As you know, in arcade fighting games, we press multiple keys simultaneously ( for example, up+right+ button 1 etc), will it be possible to do so without any delays? In computer keyboards, when we press multiple keys, we have problems such as keyboard ghosting and masking. So Arduino leonardo keyboard encoder will have the same problems?

  • @Sanchez9241
    @Sanchez9241 10 месяцев назад

    how to add vibrations to this joystick library?

  • @danw5996
    @danw5996 Год назад

    Thanks for this!

  • @simtcr
    @simtcr 2 года назад

    Will this work with a esp8266 nodemcu?

  • @gobdav
    @gobdav 2 года назад

    Thank you. Finally got my switches to work as button. How would I wire/program a 3 position switch (on/off/on) using this code?

  • @malejvelkej_
    @malejvelkej_ Год назад

    Hi, i have maybe an issue, when i'm in the game controler properties and i have for exmaple throttle and z rotaion set in the code and when i turn the potentiometr it moves with both of the values please help

  • @shaggyprimetime8813
    @shaggyprimetime8813 2 года назад

    Hi I need some advice pls when you spoke about card selection I have a uno and the joystick library isn't supported by that card bit is the joystick library essentially designating the card so the computer understands its a joystick or can I still use the understands as a joystick without using the library as I want to make a dual throttle controller for a flight sim using 10k pots any advice is appreciated im new to this thanx

  • @ProgramAndNectar
    @ProgramAndNectar 2 года назад

    this works! thank you!

  • @PuuTV
    @PuuTV 3 года назад

    Amazing video, shame you only have 55 subscribers.

  • @86poulin
    @86poulin 2 года назад

    Please someone help me. i try and upload the sketch exactly as he wrote it, then i even try and do an example from the uploaded sketch example and i keep getting
    'Joystick_' does not name a type; did you mean 'Joystick'?
    What am i doing wrong?

  • @assamita81
    @assamita81 Год назад

    Hey there. I'm working on a device using this library. I need to know the status for a specific button at all times. So you set a button by using Joystick.setButton(buttonID, status). Is there any formula that gives you the status of that button? for instance Joystick.readButton(buttonID), and it returns 1 or 0? Important to mention that I'm not using individual pins for buttons, but a Keypad matrix of buttons.

  • @LockDCS
    @LockDCS 3 года назад

    Awesome video. Once you program the board, can you still reprogram it with the IDE if the USB controller still thinks it is a Joystick?

  • @JoePCP
    @JoePCP 2 года назад

    I would also like to commend you on such an informative and interesting video. I have used your sketch quite sucessfully for my flight deck but have come up against the issue you mentioned, where more than onbe board is used. I.E. they both addess the same buttons.
    I've followed your description at the end of the video and for the most part undertand what should be done. However the boards.txt file in my system already includes descriptions of a number of diferent boards, should I add the data to my existing boads file or replace it with the one you provided?
    Also should I just change the product ID or both the vendor and product ID?
    Sorry to burden you with this but my 77 year old brain is not as quick as it used to be.
    Regards
    Joe.

  • @hridaanshugusain474
    @hridaanshugusain474 3 года назад +2

    why does it 'JOYSTICK_TYPE_JOYSTICK' was not declared in this scope
    as an error when i run my code?

    • @rimson3274
      @rimson3274 3 года назад

      i had a same problem

    • @hridaanshugusain474
      @hridaanshugusain474 3 года назад

      @@rimson3274 apparently i had the wrong library installed. after installing the correct library it worked.

    • @rimson3274
      @rimson3274 3 года назад

      @@hridaanshugusain474 303 / 5000
      Wyniki tłumaczenia
      I suspect it too, I can not find the old library but I see that it exists, I just uninstalled the arduino program and reinstalled so that all old libraries were removed, and I suspect that it will work because it probably includes the old library with the same name, I will check it right away, but thanks , Greetings

    • @rimson3274
      @rimson3274 3 года назад

      all fine and working, thank u, have a nice day!

  • @lucares92
    @lucares92 3 месяца назад

    Can't find the avr folder in arduino 2.3.2

  • @alessandromarrone5355
    @alessandromarrone5355 2 года назад

    thanks for this video that's was very helpful.....can you use distance from ultrasonic sensors as button imput?

  • @battlebros7075
    @battlebros7075 3 года назад

    Nice Video!!!
    It resolved a lot of my problems.
    Is it possible to connect the arduino with a shift register and use the Joystick Library for having more buttons?

  • @rabajter2746
    @rabajter2746 2 года назад

    I really like your tutorial, but i have one question. How do you make it work in games ? Even tho the game controllers tab in control panel registers the joystick, games do not want to work with it. Do you know what may be possible fix for it ?

  • @mattivirta
    @mattivirta 3 года назад

    normal flight sim basic need yoke steering 2 potentiometer, trottle,propel,mix,3 pot, rudder,brake 2pot,flap,1pot, or build encoder this, trim wheel i pot,on/off swirtch, light switch,engine start,3-4 encoder to autopilot gauges, radio2 encoder, 7+segment display 2 pcs radio panel, mobiflight can make all other but not can analog inputs, need make arduino leonardo usb hid about 9-12 potentiometers. or 2 leonardo board, and one arduino mega 2560 to mobiflight all switch and buttond and lcd,7.segment displays.

  • @johnpeters5906
    @johnpeters5906 2 года назад

    Thank you very much, I'am so glad ;) that I have found this video. You did a very good job. I'am going to look for other tutorials. Question; why is it "Up to 2 Hat Switches", has this to do with the number of pins ?.

  • @RedPixels_
    @RedPixels_ 2 года назад

    Thanks so much for the tutorial, so useful! I just have one problem: in the Arduino folder there is no "hardware" folder, what could be the reason of this issue?

  • @MegaBrettlee
    @MegaBrettlee 2 года назад

    hey there great vid one question i had i need two throttles do i just label them as throttle 1 and throttle 2

  • @paulb36utube
    @paulb36utube 3 года назад

    This is a nice simple explanation. I’ve had to figure out through trial and error ( and a few tears) wish I saw this way earlier.
    One question I have been able to do a twin joystick with that library. I’ve gotten a twin gimbal (used in RC drones) that run off 3.3v that I’ve hooked up but just can’t get them working together (and the sensitivity is outrages -thinking I need either hardware or software debugging ) [Frsky M9-Gimbal M9 High Sensitivity Hall Sensor Gimbal For Taranis X9D & X9D Plus RC Parts]
    Any chance of giving it a crack? The software that is.

  • @OvaisDIYGarage
    @OvaisDIYGarage 3 года назад

    how did you have it to work in fs2020? i tried connecting mine it is being recognized by windows and works on dcs as well, but on fs202 i see the controller but cant assign anythng to it , fs220 doesn't allow me to map anything on my attached board

  • @xaviercaju
    @xaviercaju Год назад

    Hello! Could be possible to use this for a PlayStation controller?

  • @BooktownBoy
    @BooktownBoy 3 года назад

    This is an excellent video, thank you. Just a question about giving the pro micro's a unique name...would I need to rename, change PID (do I make up PID?) upload to board, then change it again to another unique name before uploading the next sketch to the next pro micro? ie, "joystick" PID x for first pro micro and "throttle" PID y for second one... I couldn't quite follow that part of the vid.

    • @BooktownBoy
      @BooktownBoy 3 года назад

      EDIT: Don't worry, I've sussed it after going over the end of the vid a few times. ^ThumbsUp^

  • @Magoo277
    @Magoo277 2 года назад

    Would this work if I used it for the nintendo switch or do I need a whole different library to work with that?

  • @JoelisSc33p0
    @JoelisSc33p0 2 года назад

    can someone just make a code i bought a promicro to solder to my hall sensor as my sim handbrake broke the usb and i cant figure this out for the life of me

  • @patricklux3
    @patricklux3 Год назад

    Can I somehow do this With an ESP32 S2

  • @toyoboi
    @toyoboi 3 года назад

    you should make another video. I'm working on my first project (a 6 DOF joystick using a stewart platform) and I'm struggling with quite a bit.

  • @manamdigeable
    @manamdigeable Год назад

    hi, Thx for the tutorial. can I use this program for using rotary encoders in flight simulators ??

  • @FERNANDOPENAS
    @FERNANDOPENAS 3 года назад

    How do I declare multiple buttons in a single input in this code? I understand the wiring but do not know the code.

  • @gkps2363
    @gkps2363 3 года назад

    Can you make a video of the matrix buttons? I think what you said very well helped me a lot

  • @Vintage_USA_Tech
    @Vintage_USA_Tech 3 года назад

    Man that was a great video.... That really helped me understand how this library works and how easy it is to use, 2 question's have you had the time to get the hat switch video done yet? and 2nd you have a folder called hardware in your Arduino folder where you changed the name of the board in the board text file.... I do not have that folder I'm running IDE version 1.8.13 and it is a fresh install.... how do you get that folder with the board information?

    • @Vintage_USA_Tech
      @Vintage_USA_Tech 3 года назад

      Ok scratch that 2nd question I installed the Arduino IDE from the App store and that comes with its own can of worms when it comes to permission's I have a feeling the board.txt file is in there I just need to figure out how to get access to it. Windows is such a turd... cant wait until I can use Linux as a game box.

    • @BooktownBoy
      @BooktownBoy 3 года назад +1

      @@Vintage_USA_Tech Just create the hardware folder in Documents>Arduino alongside your libraries and sketches folders, then create a named folder inside that, copy the avr folder from the google drive link (unzipped) into that named folder and edit the boads.txt as required. Profit??? Just learned myself so thought I'd chime in :)

  • @thoufeekbaber8597
    @thoufeekbaber8597 Год назад

    this is gem..but can i do same procedures in uno??

  • @jason6344
    @jason6344 3 года назад

    I am very new to this and trying to make a joystick that emulates a controllers left analog stick. I have a joystick module and am soon to get a leonardo board . I am not so sure what to do past this.

    • @danstechbox7077
      @danstechbox7077  3 года назад

      If you watch the video and follow along with the way I've wired up the joystick, and when you're defining the code you only need to have the X and Y axis included (along with a button press if you want that in there too), that should do the job.

  • @jasongoldenberg973
    @jasongoldenberg973 3 года назад

    I am having trouble getting two leonardos to work together. When i connected the second one, it started to have issues. Now when i try to start from scratch with only one board, it never gets detected in usb game controllers, and in device manager shows with an ! next to that device. I can upload new sketch fine. tried changing vid and pid, as well as id in the sketch. Any thoughts?

    • @danstechbox7077
      @danstechbox7077  3 года назад

      I've seen a few issues with the Leonardos, particularly between different revisions - not sure if its a USB handover issue or what. If you can, try a different MEGA32u4 board to see if that resolves the issue. I'm personally looking into the Arduino Micro based on the 32u4 (not the Pro-Micro. This one has 6 Analog Pins) as it's similar to a Leonardo but is smaller form factor and doesnt have the USB Handover issues.
      Have you tried removing the drivers in Device Manager and re-installing them? Could be a COM issue too. That's all that springs to mind at the moment.
      I will be doin another video soon on some revisions I've made to my parts of the code, along with some more testing on using two controllers at once in the same game/HID instance.

  • @techie2337
    @techie2337 3 года назад

    Greetings. Thank you for the video. I just found the joystick library and I have been trying to figure out how to use it. I created my own circuit board that hold a Leonardo. One of many questions I have is how would you assign analog inputs coming in from shift registers to individual variables to be called later as buttons? I'm waiting to see how you created an array for multiple buttons as well. I'm very much new to this so watching you explain your code has helped. Still so much I don't understand. Thanks for the videos.

    • @danstechbox7077
      @danstechbox7077  3 года назад

      Will be doing one on button arrays (both binary and row-column) soon. I will also be doing input/output multiplexing using muxing boards (might also be called shift registers but that’s the name I know them under).
      I am currently writing a series called: “How to (Properly) Arduino to cover the basics of wiring and coding inputs and outputs in an appropriate and board-safe manner, so keep tuned! Waiting on some parts but will be recording soon!

  • @theshawnmccown
    @theshawnmccown 2 года назад

    What would I need to add to set a deadzone?

  • @andrewjamez
    @andrewjamez 3 года назад

    hi there thanks for your tutorial, Are you able to name your device? for example I am building flight sim controllers and want the name of the controller to show in the joystick calibration menu and not just "arduino Leonardo"...

  • @noahgranger6749
    @noahgranger6749 3 года назад

    I got this error:
    JoystickFinal:13:18: error: expected constructor, destructor, or type conversion before '(' token
    Joystick_Joystick(0x15, JOYSTICK_TYPE_JOYSTICK, 4, 0, true, true, false, false, false, false, false, false, false, false, false)
    any tips?

  • @stevling1
    @stevling1 11 месяцев назад

    I'm a bit new to this how do I update that boards.txt file so it works in newer versions like 2.2.1
    thangs for the Guide :D

  • @chiragjeram
    @chiragjeram 3 года назад +1

    thank you sir for nice video, can you guide how can i use yours' beginner guide sketch to make 1 joystick and 20 push buttons on arduino leonardo?

    • @danstechbox7077
      @danstechbox7077  3 года назад +1

      Hi Chirag Jeram! Thanks for the comment. Hope i can answer your question properly.
      To use the arduino leonardo, you literally just need to change the board - the only difference between the two in regards to this project are the number of pins and the pin numbering. Nothing in the code would change apart from adding in the extra buttons and removing your unused axis. HOWEVER, although the technical spec says that the board has 20 Digital Pins and 6 Analog pins, a number of these pins are shared due to the nature of the chipset, and as a result you can have a maximum of 20 Digital Pins, 14 Digital Pins and 6 Analog Pins, OR Any variation of the above. For this kind of setup, you would be limited to 18 Digital Pins for buttons, and 2 Analog pins for the X/Y of the joystick. If you reeeally need 20 buttons, you could either go for a button matrix (more complicated option) or swapy the board out for the Arduino Due, which has significantly more Digital Pins, but that may be overkill depending on your project.
      Below I'll go into the changes for the code, regardless of your board choice (I wont go into button matrixing as that is a video unto itself)
      In the Joystick Initialisation section, reduce your axis to just including X and Y, everything else for false, and change the number of buttons to 20 (or however many you want).
      For the Joystick - In the beginner Guide Sketch, you would use the X/Y axis of the Joystick as A0 and A1, set up with the hardware how I wired the joystick up in the video - Just comment out or delete the "#define joy####" lines with whichever axis you dont wish to use, and likewise the Axis Initialization and Axis Reading sections for the axis you are not using.
      For the Buttons - Duplicate the "#define joyButton####" lines, changing the button number and pin inputs for your buttons to the button number (in this case 1-20) and the pin you are putting it in to in the Arduino board. Likewise, set up the "pinmode" of the extra buttons as demonstrated for button 1-3 in the code, and make sure to do the same for the "LastButton#State" section per button, or none of them will work. You will then need to copy the "Current Button State" IF loop per button in the "Button Reading During Runtime", changing the button Number for every copy. If you want to, rather than copying them individually, you could subnest the IF loop and do a for loop to cycle the test between buttons 1 and 20, but only if you feel confident doing that.
      Otherwise, everything else should be as it is in the video. Let me know if you have any more questions.

    • @chiragjeram
      @chiragjeram 3 года назад

      @@danstechbox7077 thank you very much for detailed reply....i will make it practically and then let you know how it goes........have a good day !