Тёмный

How to connect and use an Analog Joystick with an Arduino - Tutorial 

Brainy-Bits
Подписаться 49 тыс.
Просмотров 413 тыс.
50% 1

Let's connect and use a Joystick module with an Arduino UNO.
To download the sketch we used, check out our tutorials page at: brainy-bits.com/tutorials

Наука

Опубликовано:

 

7 янв 2015

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 323   
@carlosluna4092
@carlosluna4092 2 года назад
Brilliant. Clear and succinct. Thanks! (7 years later)
@billybbob18
@billybbob18 9 лет назад
I did the same thing with a broken xbox controller. I desoldered it from the board, mounted it to a small perf board, then soldered jumper wire to the board. It worked on the arduino. It's just 2 10k pots on a stick with return springs. Each axis will have a slightly different "zero range". If you are using this for a project, then the most important part is to find the min and max zero reading, then map that range of values for each potentiometer to zero. This prevents "idle drift" as I'm sure most gamers end up seeing with a controller at some point. Ex. Letting off the stick to see very slow motion in the x or y axis.
@sundyluo4618
@sundyluo4618 5 лет назад
This kind of rocker potentiometer is produced in our factory,www.joysticksensor.com
@JC-no1jy
@JC-no1jy Год назад
This is exactly what I've been looking for. Thank you so much!
@tamaraceclia
@tamaraceclia 2 года назад
Thank you so much for your efforts. You have done a great job explaining this.
@mertcapkin7263
@mertcapkin7263 6 лет назад
crystal clear and short video! thanks! :)
@sjoerdkurstjens1504
@sjoerdkurstjens1504 6 лет назад
This was really helpfull, thank you! Now i have to figure out how to graph my outputs
@Suboptimaltraining
@Suboptimaltraining Год назад
I’m building my own version of the gmk joystick and this helps a lot thank you
@AndreasBaumgartnerMUC
@AndreasBaumgartnerMUC 3 года назад
Excellent work, thank you!
@v3rtigooo
@v3rtigooo 2 года назад
thank you so much this is awesome, you showed exactly what i needed
@parranoic
@parranoic 8 лет назад
Great video, really simple to understand!
@BrainybitsCanada
@BrainybitsCanada 8 лет назад
+Daniel Tevi (Jizzy) Great to hear to helped. Thanks for watching!
@gebrn4872
@gebrn4872 8 лет назад
Thanks for making this video it's so helpful for my project
@BrainybitsCanada
@BrainybitsCanada 8 лет назад
+Gaute Eide Bergstø Alway great to hear that it helped! Thanks for watching!
@dhromayjani7911
@dhromayjani7911 7 лет назад
i am new to arduino and this is my 3rd experiment with arduino , great experience, really nice thank you for this video . video was very help full thank you
@BrainybitsCanada
@BrainybitsCanada 7 лет назад
Always great to hear the videos are helping others! Thanks for your comment and for watching!
@c-myc
@c-myc 8 лет назад
You´re Website is so awesome!!! Helped me so much!
@BrainybitsCanada
@BrainybitsCanada 8 лет назад
+DJ FlatCube Always great to hear that the videos and website are helping others! Thanks for the comment and for watching!
@IUGIIMASA
@IUGIIMASA 3 года назад
Very useful, thank you!
@tudorocrain4798
@tudorocrain4798 5 лет назад
thank you very much,great video!!!!
@jevchance
@jevchance 3 года назад
Thinking these will be great for controlling LED strips: left-right to cycle through animations, up-down to control brightness, push to turn on/off!
@9001greg
@9001greg 5 лет назад
Thanks, your code works good. It's unfortunate these joysticks are crap and have a very low threshold before going to max of 1023.. way too sensitive.
@wywarren
@wywarren 6 лет назад
I've got a couple analog keyes analog joysticks here as well and I think similar to your demo, they don't auto calibrate their centers at 512,512 perfectly. I guess there needs to be some sort of calibration mode for more advanced systems to init the rest position and then calculate the relative offsets based on that as a relative center position. I guess I can try to share an example once I finish coding it on my end.
@deepyaa3392
@deepyaa3392 4 года назад
It works! Thanks!
@kimiakiani6931
@kimiakiani6931 6 лет назад
THANK YOU , Brief & Beneficial
@wqdqwdwtffu63
@wqdqwdwtffu63 6 лет назад
NJO NOJWDU WDQASDAWDERVFV
@bt4670
@bt4670 4 года назад
Thanks, it was very useful!
@BrainybitsCanada
@BrainybitsCanada 4 года назад
Thanks for watching, glad it helped!
@musabbafridi8721
@musabbafridi8721 7 лет назад
Thanks Ivan! Appreciate it
@BrainybitsCanada
@BrainybitsCanada 7 лет назад
Thanks for watching Musabb :)
@rockdrummer3999
@rockdrummer3999 5 лет назад
Very clear tutorial, appreciate it.
@sq3k
@sq3k 9 месяцев назад
Super useful, thanks
@adelineboo6641
@adelineboo6641 4 года назад
Great tutorial
@aem870
@aem870 2 года назад
Nice. Clear to undesrtand.
@karthikraj6347
@karthikraj6347 4 года назад
How do you make the serial monitor do that? Like a "static serial monitor"... like overwrite the values on the same line instead of going to a new line?
@mattlong8002
@mattlong8002 3 года назад
How different would the coding be for a pro micro board? Looking to use two joysticks on one pro micro.
@Pegasvs
@Pegasvs 7 лет назад
Do you have a script for joysticks that dosen't have buttons? I REALLY need help please!
@cadetabdulkhaliq2491
@cadetabdulkhaliq2491 6 лет назад
thanks ,its working
@ragtagragnor2943
@ragtagragnor2943 3 года назад
I'm planning on making a controle panel for ksp this will work great for rcs thank you.
@ragtagragnor2943
@ragtagragnor2943 3 года назад
Update I finished the controle panle. The code is not the best and works for buttons but not the toggles😒😔
@mohammedmogadem9523
@mohammedmogadem9523 7 лет назад
Pretty nice and simple...keep it up!!
@BrainybitsCanada
@BrainybitsCanada 7 лет назад
Thank you for your comment and for watching!
@jynclr
@jynclr 5 лет назад
Thank you for this very quick and simple joystick tutorial. Appreciate it.
@BrainybitsCanada
@BrainybitsCanada 5 лет назад
Thanks for watching, glad it helped!
@sethfrancissimracing7558
@sethfrancissimracing7558 8 лет назад
Great video, I have a question though. Will this code (or a similar code without the button input) work to map two potentiometers to Windows control panel for use in game? The game will allow calibration of end points but it needs to see the input. I am looking to use three separate pots for gas, brake and clutch in racing sims. I know I would have to change the code to add an additional pot read out from another analog pin but from a conceptual stand point will this basic code work as to send pot input to a game/pc or will it only function within the serial monitor. I have been trying to figure out the key to using an arduino to send pot input to my pc and ultimately games but I feel like I'm missing something. I also heard about the need for a resistor between the ground and signal on the pot to prevent spikes, it would be great to know if this is needed when using an arduino or even just be directed to somewhere I can get more info on this topic(s). I already have arduino uno boards so that is preferred unless there is reason to go with another board. Thank you in advance if you get a chance to respond.
@BrainybitsCanada
@BrainybitsCanada 8 лет назад
Check out those other video where I use an Arduino Micro to interface with a computer via usb: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-JwCzx7UhOd0.html ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-JwCzx7UhOd0.html Hope that helps! Thanks for watching!
@pareshmhatre4019
@pareshmhatre4019 2 года назад
you made it very very easy!
@hydri8248
@hydri8248 3 года назад
this has help me so much
@tomphotog022
@tomphotog022 7 лет назад
Hey looks great and great video! Can I input this code and transmit these codes via bluetooth given I have paired my two bluetooths to slave and master to control a servo? Or how would I go about doing that?
@kristianskrede9886
@kristianskrede9886 8 лет назад
That was a quick answer, ty. And btw can you guys make a video where you use the joystick, arduino and a makey makey to controll the PC
@BrainybitsCanada
@BrainybitsCanada 8 лет назад
+Kristian Skrede No problem... Can you explain a little more what you would like to see using a joystick, arduino, etc... to control a PC... Thanks
@nivmoshe5536
@nivmoshe5536 6 лет назад
That was very useful and well explained, but can you tell me how to make the computer read these values like a game controller?
@myriadtechrepair1191
@myriadtechrepair1191 7 месяцев назад
To do that you need to interface with xinput. There is an arduino xinput library, iirc.
@adriankazmierski8541
@adriankazmierski8541 7 лет назад
hi, ist that all the code you need to run a teensy with an (e.g. psp thumbstick) on a raspberry pi? dunno how to configure my teensy++ 2.0, that makes me get kinda stressed. I want to do a Gameboy Zero
@adelmakhloufi5017
@adelmakhloufi5017 7 лет назад
Thanks. Good tutorial.
@pdph-kk4ut
@pdph-kk4ut 7 лет назад
how did you make your pofile photo
@ClockworkBastard
@ClockworkBastard 8 лет назад
Айван? Круто, я конечно не лингвист, но я почти не детектировал соотечественника по произношению. Круто, спасибо
@BrainybitsCanada
@BrainybitsCanada 8 лет назад
+ClockworkBastard Я предполагаю, что некоторые люди более подвержены произношении, чем другие, я думаю, что мое произношение, хотя и не идеально, довольно хорошие :) спасибо за комментарий и для просмотра!
@wqdqwdwtffu63
@wqdqwdwtffu63 6 лет назад
руто, я конечно не руто, я конечно не руто, я конечно не руто, я конечно не руто, я конечно не руто, я конечно не руто, я конечно не руто, я конечно не руто, я конечно не
@paulb36utube
@paulb36utube 4 года назад
I am able to get it working. However I cant seem to understand how to get it recognized as a joystick in Windows using an Promicro. I read the other mouse tutorial but couldn't find the code that makes it be recognized. Any help would be appreciated.
@voodoomotion5855
@voodoomotion5855 5 лет назад
Awesome tutorial, thanks so much! Quick question, how many analogue sticks and buttons can be connected to the Arduino? Thanks again
@DustinWatts
@DustinWatts 4 года назад
The ATmega328 (the chip on the Arduino UNO, Nano, Pro Micro, etc.) has 6 analog inputs and 14 digital inputs. So, 6 sticks and 14 buttons!
@jiehfeng
@jiehfeng 7 лет назад
Can you please explain the wire colours and why?
@angusquigley3713
@angusquigley3713 5 лет назад
Awesome Vid!
@nadimnabil2443
@nadimnabil2443 3 года назад
thank you so much...🤎
@TheRio966
@TheRio966 4 года назад
I am trying to use a xy joystick into a arduino uno to use as a mouse and left clicker for kodi within retropie But I cannot find the next steps to get the raspberry pi to interact with the Uno when I plug the usb from the Uno to the pi. Any advice?
@yagababa6028
@yagababa6028 8 лет назад
hey i liked your work a lot but i am making a project and it uses 2 joystick module so can u plz tell me how to connect them to arduino actually i want to connect 4 servos
@carlosdavila2552
@carlosdavila2552 8 лет назад
hello, do you have documentation on this joystick such as specs/datasheet? i am having a hard time finding one. thanks!
@handlol
@handlol Год назад
same mine has B103 388 can't find anything about it
@abdulmuiz6875
@abdulmuiz6875 6 лет назад
Can I use gyroscope sensor instead of joystick module?
@inhibited44
@inhibited44 5 лет назад
I want to control four motors with the joystick. I think I can use that code to operate four solenoids to feed power to the motors.
@Demirci91
@Demirci91 8 лет назад
thanks man you'r the best
@BrainybitsCanada
@BrainybitsCanada 8 лет назад
+Ahmed DemirciOglu Thanks for watching! Glad it helped :)
@christopolis1
@christopolis1 7 лет назад
the whole code is //Arduino pin numbers const int SW_pin = 2; //digital pin connected to switch output const int X_pin = 0; //analog pin connected to x output const int Y_pin = 1; //analog pin connected to y output void setup() { pinMode(SW_pin, INPUT); digitalWrite(SW_pin, HIGH); Serial.begin(115200); } void loop () { Serial.print("Switch: "); Serial.print(digitalRead(SW_pin)); Serial.print(" "); Serial.print("X-axis: "); Serial.print(analogRead(X_pin)); Serial.print(" "); Serial.print("Y-axis: "); Serial.println(analogRead(Y_pin)); Serial.print(" "); delay(500); }
@SchlechteBewertung
@SchlechteBewertung 6 лет назад
eh do no wrk
@blackotear
@blackotear 6 лет назад
The code you posted doesn't work just go straight to the tutorial page instead www.brainy-bits.com/arduino-joystick-tutorial/ all the code is there and it works.
@sriramchava8062
@sriramchava8062 4 года назад
Why did u choose 115200 and not any other number for serial begin
@janphillipjuntado
@janphillipjuntado 4 года назад
thanks, man
@mlgsupergamer948
@mlgsupergamer948 4 года назад
thanks
@VmsRekDGP
@VmsRekDGP 8 лет назад
I always get x: around 240-270 and y: around 240-270. It wont change if I use my joystick and I have no idea why :(
@Level_Legends
@Level_Legends 8 месяцев назад
Its because you msut of put them in the wrong pin
@yogendrakumarpatel8369
@yogendrakumarpatel8369 4 года назад
Is it necessary to use microcontroller with joystick module?
@benedictrehiesi5166
@benedictrehiesi5166 5 лет назад
Can I use two joysticks for this board instead of only one?
@Epsio0
@Epsio0 8 лет назад
Would it be possible to make this work with an application on Android?
@rakshithnarun
@rakshithnarun 9 лет назад
can i use this analog stick and arduino to control a motor to turn in both directions
@jajes711
@jajes711 7 лет назад
I'm new to Arduino. Do you know if I have to solder the ends of the jumper wires to the Uno board, or if there is a special way to insert them?
@xaesthetics1769
@xaesthetics1769 4 года назад
Just connect them to the holes
@Tunnelsnakes
@Tunnelsnakes 2 года назад
How do you replace the cap on these? They seem stuck on the stick and I can't seem to get them out. Any advice on that?
@maxwellrobinson2924
@maxwellrobinson2924 5 лет назад
Curious, why in the setup did we need to declare the SW as an input, but didnt need to declare the Y or X analogs as inputs?
@perezr9623
@perezr9623 5 лет назад
cuz the switch is digital
@aaravs524
@aaravs524 5 лет назад
it keeps on telling me i need a redefinition for 'void setup()'
@roboarjun
@roboarjun 2 года назад
Thanks!
@perezr9623
@perezr9623 5 лет назад
what baud rate do we use, and why does it matter? I find that 9600 works for me better than 115200
@kannanramaswamy2519
@kannanramaswamy2519 5 лет назад
It is not a simple answer you need to understand the UART protocol and the serial communication that is happening. Here is my attempt at a simple answer, for a serial communication to happen the sender and receiver should know how long each bit is transmitted. For e.g. if say the agreed time is 1sec then if there is a high on the line for 3secs, then low for 2secs, then high(1sec), then low(2secs) then it would mean 11100100 was transmitted serially. This is the baud rate, which is the number of transitions per second. Please watch this video, and probably attend the course when you have time. I found it quite useful. www.coursera.org/learn/arduino-platform/lecture/OPTv7/lecture-2-1-uart-protocol
@ReynierGonzalez2
@ReynierGonzalez2 9 лет назад
I need help i want to move 5 servos with 3 joysticks but when i release the joysticks the servo restart the position, I need a code that when you release the joystick the servo Remain in position. please help me!
@MyDvR7
@MyDvR7 9 лет назад
Reynier Axel Hi, I would like to help you, but you should explain better what you want, because in every moment when you release the joystick, it is assuming new values, can you explain me your project a little more?
@carbony26
@carbony26 6 лет назад
No links for the items used :(
@ChristianKrause89
@ChristianKrause89 8 лет назад
So, I'm working on a robot that has four DC motors controlled by two motor driver chips. Am I correct in assuming I can use this joystick to control left, right, forward, and backward motion using a command interpreter and checking the range of these values? For example, if y-axis between A and B, turnLeft( ), where turnLeft( ) will be a function call with the logic to turn left. Thanks!
@BrainybitsCanada
@BrainybitsCanada 8 лет назад
+Christian Krause You are correct :) that would work just fine. When you detect that a joystick axis analog read is between 2 values that you choose, then you call a function that would make a specific DC motor turn. Good luck with your project and thanks for watching!
@ChristianKrause89
@ChristianKrause89 8 лет назад
+Brainy-Bits thanks man, appreciate the quick feedback. And thanks for the great videos too!
@kajaljain203
@kajaljain203 7 лет назад
can i get a Program to control the speed of dc motors ?? using joysticn?
@stoopidhaters
@stoopidhaters 4 года назад
Does this allow you to fix large deadzones in 3rd Party Controllers?
@victorgomez8506
@victorgomez8506 5 лет назад
Estén tiene de casualidad para códigos, atreves conectan con eso con luces los 5
@fernandoluis53
@fernandoluis53 8 лет назад
how are u getting a reading for X and Y axis if u didnt declare the pinmode
@BrainybitsCanada
@BrainybitsCanada 8 лет назад
Arduino (Atmega) pins default to inputs, so they don't need to be explicitly declared as inputs with pinMode() when you're using them as inputs. Hope that helps! Thanks for watching!
@jorgeantoniogonzalezestefa1391
but, what happen if i want use two analog joysticks?
@neverp3729
@neverp3729 6 лет назад
how can i use one joystick input to turn 2 servo motors in 2 different directions at the same time? like when the joystick is moving left... one of the servos moves left and the other right, simulataneously?
@BrainybitsCanada
@BrainybitsCanada 6 лет назад
I've made some tutorial videos on my channel on using Servo motors here is one of them: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-T3Tg0FAKcWI.html Hope that helps and thank you for watching.
@vedansh29
@vedansh29 5 лет назад
I liked the video and understood a lot. But man you should give the code link (present in the description) directly to the tutorial on your website. I searched a lot on your website but did not find the tutorial. Finally, I had to write the code in my arduino IDE by seeing the code in your video and then write it on the arduino IDE.
@vedansh29
@vedansh29 5 лет назад
I finally got the code on your website. Change the link in description to this - www.brainy-bits.com/arduino-joystick-tutorial/
@sriramchava8062
@sriramchava8062 4 года назад
Why did u choose a value of 115200 in serial begin
@amelliamendel2227
@amelliamendel2227 4 года назад
To sync the baud rate with the nrfl01
@rhidlor8577
@rhidlor8577 4 года назад
I don't see an nrfl01, am I missing something? (I'm new to arduino stuff)
@alexmighty693
@alexmighty693 5 лет назад
are the values its reading ohms?
@zazzle54321
@zazzle54321 5 лет назад
Is there any reason why everything would work except the x axis? I tried 8 different joysticks and they all only worked for up and down and the key
@elricho72
@elricho72 8 лет назад
Excelent explain ! so easy , thanks
@BrainybitsCanada
@BrainybitsCanada 8 лет назад
+elricho72 Always great to hear that these videos are helping others! Thanks for watching!
@wqdqwdwtffu63
@wqdqwdwtffu63 6 лет назад
WASDWASD BGRRRRRAAAMMARSIES21735WQSDQAWDSDAWDASDAwdasdawdasdasdawdasdqas
@wqdqwdwtffu63
@wqdqwdwtffu63 6 лет назад
ps it was good to
@abhayanimates4948
@abhayanimates4948 2 года назад
it helped me a lot it was so easy bro🤑🤑😱😱😱😱😱
@bureksasirom8773
@bureksasirom8773 8 лет назад
Guys , I am trying to connect this to a game I made in Unity. I know this video is old but I would love to hear your ideas! Is it even possible , and if so how? +Brainy-Bits ?
@BrainybitsCanada
@BrainybitsCanada 8 лет назад
Hi, to interface with a computer you might want to use a leonardo or micro Arduino since these can be configured to be recognized as a mouse or keyboard. Check out this other tutorial we did here: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-hFgSI0yykzk.html Hope that helps! Thanks for watching btw :)
@bureksasirom8773
@bureksasirom8773 8 лет назад
Thanks!! So it should work in my game as well then. Now I got to buy all this stuff.. Hope it works!
@bureksasirom8773
@bureksasirom8773 8 лет назад
Wait I just realised. If its a game I made on my computer I dont need an emulator do I?
@BrainybitsCanada
@BrainybitsCanada 8 лет назад
If your game is using keyboard keys for movement inside the game (AWSD) then the leornardo or micro Arduino can send those keystrokes when it's configured as a keyboard. There are ways to make a regular UNO do this, but it's much easier with the leornado or micro since they have these functions built in. Not sure what you mean by "emulator"?
@bureksasirom8773
@bureksasirom8773 8 лет назад
Thanks for the answers! So if it is possible to do with uno , do you have a tutorial or know a good one? Or I just should not bother?
@avinashdalal7063
@avinashdalal7063 7 лет назад
can we connect two joysticks to the UNO
@whotookgetinthebag
@whotookgetinthebag 3 года назад
Hi, I would be appreciative if someone can please explain this line: digitalWrite(SW_pin, HIGH); Is that to set the input as a pullup, rather than a pulldown?
@handlol
@handlol Год назад
I would like to know too
@whotookgetinthebag
@whotookgetinthebag Год назад
From memory after I used this code, I think it was a pull-up. I think the switch was an always closed or something like that. TLDR: It worked
@rakhibamboli7032
@rakhibamboli7032 6 лет назад
Can i use this joystick for 40v??...
@vicaya6141
@vicaya6141 2 года назад
Could this work with any kind of Arduino? I do not have acces to that exact model, the cheapest I can find is the Nano (and the page does not say what V it is sadly)
@EmbddedJiuSage
@EmbddedJiuSage 9 лет назад
I am trying to apply tiva instead of arduino, but the problem is that it doesn't have 5v Vcc, only 3.3, and I assume there is no way to make it work. because you need at least 75% of the voltage 5*75/100 = 3.75. So my question is if the joystick operates only on 5V vcc? and are there any of those that operate on 3.3 V?
@EmbddedJiuSage
@EmbddedJiuSage 9 лет назад
And btw, thank you very much for the tutorial, it was very helpful, keep it up.
@BrainybitsCanada
@BrainybitsCanada 8 лет назад
+Ruslan Nurimbetov Haven't found a joystick that works on 3.3v, sorry, but thanks for watching and for your comment :)
@michaeljoshuamanallo1742
@michaeljoshuamanallo1742 2 года назад
Sir I have a question what is the SW pin of joystick for?
@187781jason
@187781jason 8 лет назад
Nice. can I tap off an existing joystick and use the output signal to run say a motion simulator platform? will the output signal from the joystick still be strong enough to continue sending the signal to both the pc game as usual and the arduino simultaneously? cheers guys, your videos are a lifesaving compilation.
@BrainybitsCanada
@BrainybitsCanada 8 лет назад
+jason daysh That's a good question :). Not sure if it would work, since the Voltage and Ground connected to the joystick would not be coming from the Arduino. Maybe if you connect the Ground of the Arduino to the Joystick Ground pin (To have Ground Reference), omit connecting the Voltage of course (Since the joystick would be getting that from the other component already), and connect the X, Y signal pins as usual it might work. Never tried this so can't confirm or deny this would work. Maybe someone here on RU-vid can confirm or tell me how wrong I am :)
@187781jason
@187781jason 8 лет назад
+Brainy-Bits Thanks for the tips, I will give it a go when I get that far and let you know what the outcome was :)
@BrainybitsCanada
@BrainybitsCanada 8 лет назад
+jason daysh Cool! Curious to see the results :) Let me know what you find out...
@marctoonz813
@marctoonz813 Год назад
How do i make aiming smoother for fps games? i tried antimicro and joytokey
@cartwatson
@cartwatson 7 лет назад
After uploading the serial monitor keeps adding new text but it doesn't read the switch, x input, or y input. This is my code // Arduino pin numbers const int SW_pin = 2; // digital pin connected to switch output const int X_pin = 0; // analog pin connected to X output const int Y_pin = 1; // analog pin connected to Y output void setup() { pinMode(SW_pin, INPUT); digitalWrite(SW_pin, LOW); Serial.begin(115200); } void loop() { Serial.print("Switch: "); Serial.print(digitalRead(SW_pin)); Serial.print(" "); Serial.print("X-axis: "); Serial.print(analogRead(X_pin)); Serial.print(" "); Serial.print("Y-axis: "); Serial.println(analogRead(Y_pin)); Serial.print(" "); delay(500); } Thanks
@eeherr8558
@eeherr8558 7 лет назад
Why is only (analogRead(Y_pin)) a Serial.println and the other two are a Serial.print?
@AnimilesYT
@AnimilesYT 5 лет назад
I got 4 of these joysticks. 2 old ones and 2 new ones. None of them give any signal over the switch pin... What could I possibly do wrong? Or are they all coincidentally broken?
@perezr9623
@perezr9623 5 лет назад
make sure to plug the switch to digital and not analog
@myriadtechrepair1191
@myriadtechrepair1191 7 месяцев назад
Writing the switch pin HIGH doesn't work on my ESP32, I just had to add a pull-up resistor to 3.3V on the switch pin. :)
@abusekak1934
@abusekak1934 10 дней назад
My output just says weird zalgo symbols i dont know if an alien is the one showing the output but pls idk how to fix this in new to electronics
@IndianaStones1
@IndianaStones1 Год назад
why is it when i change the baud rate that the code isnt static anymore ?
@jeffbowyer4576
@jeffbowyer4576 3 года назад
Why is the digitalWrite necessary in setup?
@Jayjaymagician18
@Jayjaymagician18 2 года назад
Hi, did it can work to move for example a player on a game like minecraft? Because me I'm rn making a project about it and I want it to move my character on Roblox with a arduino keyboard too. But nice video btw :).
@tekone_
@tekone_ 2 года назад
accually you can but you need to adjust it diffrently for diffrent games
@Wadaruw
@Wadaruw 8 лет назад
Why in the constants you did not set 'A0' or 'A1' ?
@PietroNardelli
@PietroNardelli 6 лет назад
He did, X_pin is A0 and Y_pin is A1, he could have set them as OUTPUT, Arduino will do it if not specified, but he should have done it.
@kristianskrede9886
@kristianskrede9886 8 лет назад
I am actually working with it now. But what i meant whas that you could make a video where you uses the arduino uno (only or i used The makey makey beacuse i am not so good at hacking or stuffs like that) to controll the buttons up, down, left and right or w,a,s and d on the computer.
@kristianskrede9886
@kristianskrede9886 8 лет назад
+Kristian Skrede with the joystick*
@BrainybitsCanada
@BrainybitsCanada 8 лет назад
+Kristian Skrede Ok I see what you mean :) I'm guessing using a Leonardo or a Micro would work best for this, since those boards can emulate a USB Mouse or Keyboard right out of the box. But There's a way to do it on the UNO by changing the firmware. You can check our video here for a tutorial with the Leonardo: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-hFgSI0yykzk.html or let me know if you want to see a new video tutorial on the UNO firmware change to enable this! Thanks for the suggestion and let me know!
@jappie-fpv1809
@jappie-fpv1809 3 года назад
if it works one sime and then it spits out random caracters try serial monitor to 9600 worked for me
@25Aditya25
@25Aditya25 7 лет назад
Does any one has 8 pin analog joystick pinout.Please provide a link
Далее
You can learn Arduino in 15 minutes.
16:34
Просмотров 10 млн
How To Make A DIY Arduino Joystick Control Car At Home
6:34
DIY ARDUINO MOUSE JOYSTICK
2:14
Просмотров 130 тыс.
5 AXIS ANALOG JOYSTICK GAME CONTROLLER
3:01
Просмотров 152 тыс.
КРУТОЙ ТЕЛЕФОН
0:16
Просмотров 6 млн