First video of yours I've seen. I really appreciated the code-along-with-me explanation of what you were doing. Also, your explanation of bitwise operations and using a single integer to represent any combination of buttons was superb.
@engineerish6 жыл бұрын
David Beukes thank you! Glad you liked it 🙌
@ABSP57664 жыл бұрын
Finally an arduino project that is not only cool but also useful! !!! Thank you. I will definitely try this.
@stormix_co6 жыл бұрын
Great one day project! Will try it soon!
@vuk_ustipak3 жыл бұрын
How did it go?
@stormix_co3 жыл бұрын
@@vuk_ustipak pretty well actually
@tekanova7480 Жыл бұрын
Once uploaded to board, will the joystick show up on the the windows USB controllers calibration window. win11 H
@Portaboy-lc7ni5 жыл бұрын
i wired the buttons and joystick to the correct pins, used the right capacators for other stuff on the board but all i get in the serial monitor is an infinate stream of backwards question marks from the arduino. i have checked and double checked, there are no coding/spelling/wiring problems, please help
@engineerish5 жыл бұрын
Portaboy7921 hade you set the baud rate to 115200 in the serial monitor?
@ballamoto3 жыл бұрын
Right, after many hours (damn Python 3 updates throwing the coding off!) I have got my joystick working - my only problem is that it I cannot hold down the joystick. It only registers each direction input once. The readout on the Serial port is fine, the numbers are staying high if the joystick is pressed. But the python code seems to only allow a single press. It looks like this happens in the video at 11:22. Can you help?
@ballamoto3 жыл бұрын
Fixed, I just removed the line: "if key not in keysDown:". Otherwise once the key has been pressed and is added to KeysDown, the "pyautogui.keyDown(key)" will not run again, and the button will not be pressed again. I'll leave this here in case anyone has the same issue.
@loop57205 жыл бұрын
Can you make a project like this but make a case of it? Like put the Arduino inside a 3d printed case or make it out of a different material...
@seifmustafa20045 жыл бұрын
Great job, might this work if I connected my atemga 328 with an ft232rl as a usb adaptor(as the chip doesn't have a usb built-in)??
@GamerKnight193 жыл бұрын
Would pressing B+F be the same as C+E since they both equal 6??
@furank_i5 жыл бұрын
wouldnt it have been easier to use the keyboard library and let the arduino work as a keyboard?
@engineerish5 жыл бұрын
Franklin Rosales sure that’s another way of doing it - this gave me the ability to reprogram it in python rather than fiddling with arduino code
@MemeReacts129 ай бұрын
sir pls help me i have uploaded all your code and also it is not showing any error but i cannot use my funduino joystick shield, pls help
@theninjaitsu6 жыл бұрын
Awesome video and really helpful! But could you explain what you did in 8:38 - 8:50?
@engineerish6 жыл бұрын
Ninjaitsu thanks! What I’m doing there is parsing the data coming off the serial. I’m starting to look for an S, so that a I know I’m in the beginning of a message. Then I read another string until I find a comma and make that in to an integer - that will be my dx. Then the same thing for dy. Did that explain it?
@maxsandoval42463 жыл бұрын
Great VIdeo Is there a Way to use it connecting a HC-05 or something like that? Thank you
@ENDERLEGEND264 ай бұрын
Same query Did u find a soln?
@IcanCwhatUsay4 жыл бұрын
7:11 - Could you explain or translate that please? or at least direct me to what to google so I can find out what that means?
@engineerish4 жыл бұрын
Absolutely - I suggest you google "bitwize operations" (and the "
@IcanCwhatUsay4 жыл бұрын
for the first line I'm getting this error: arduino = serial.Serial('/dev/cu.usbmodem1461', 115200, timeout=.1) AttributeError: module 'serial' has no attribute 'Serial' Any idea why? For those looking for the answer to this question, the solution was to change the line from the above to the following: arduino = serial.Serial(port = 'COM3', baudrate = 115200, timeout = 0.1)
@MatiaSilver2 жыл бұрын
Hi, how did you find the answer? it doesnt work for me
@IcanCwhatUsay2 жыл бұрын
@@MatiaSilver I don’t recall. Probably brute force plug and chug. Sorry.
@chandanianjalika6798 Жыл бұрын
@@MatiaSilver check your port name
@bartyhall78785 жыл бұрын
So I uploaded the Arduino code onto my board but I do not understand how to put the python on. When I copied the code you wrote onto python, it said that there were a ton of errors. Can someone explain
@rajvirkaur14574 жыл бұрын
can I play modren combat 5 with it
@beelz10424 жыл бұрын
Are there like different types of arduinos ? Cause I never used one before and I want to try it , but idk what I need , should I like just look for an arduino ? Or is there a specific type that I need for this. And also , how to setup the buttons and joysticks and stuff on the arduino ?
@engineerish4 жыл бұрын
Yeah there are different kinds of Arduinos. This particular one is called ”Arduino UNO”, a very common type. The buttons/joystick are attached to a module called a ”shield” (which you buy fully assembled, all u need to do is to stick it on top of the UNO)
@sudhaj37626 жыл бұрын
bro i didn't understand about changing the port name
@androPoint10 ай бұрын
Aaaal fiiiin encuentro un video con todo lo necesario para usar el joystick shield como Gamepad!!!! Me he roto la cabeza tratando de lograr usarlo como un periférico pero no encontraba la manera y nunca se me ocurrió hacer un programa en Python (no se usarlo la verdad😅😅😅😅) you are brilliant!!!
@androPoint10 ай бұрын
Hi i'm tried the coding of arduino and worked just fine but the code of python it won't work. It release the mesage: Exception has occurred: ModuleNotFoundError No module named 'imp' File "\Funduino-JoyStick\Funduino-JoyStick.py", line 1, in import serial ModuleNotFoundError: No module named 'imp' i already instaled the serial and pyautogui libraries. i'm using the Visual Studio Code with the version 3.12 of python on windows 10. it's like it doesn't understand that it has to import the libraries and only read "imp" (that's what i understand of the error message). I have the program sublime text but i don know how to run it in tha program. if you can give me a hand to make it work i wil be really grateful. sorry for the writing i'm not use to write in english, hope its understand
@embaracuya5 жыл бұрын
Can you explain what steps you do before the import serial to be able to work your Arduino on Sublime Text? Im trying to copy what you are doing but I cant import the Arduino environment into Sublime Text.
@engineerish5 жыл бұрын
Nicolas Franco In sublime I’m programming a python script. The python script ”talks” to the Arduino by connecting to the serial port (on which Arduino is connected and will write). So there’s nothing Arduino going on within sublime text, pure python
@terrylarry56582 жыл бұрын
Im working with python 3.9.13, not sure which version of your python and serial is working on but i kept getting the error "ValueError: invalid literal for int() with base 10" after some research i figure out they might have change the output value to binary instead of just string, which may explains the reason why its impossible to convert to int or float Since the video had been made a long time now I don't think you would be replying to my comment anytime soon, however this is just to warn any python3.9 or future watcher about this issue. Unfortunately I still wasnt able to find the solution to this yet. I will be appreciated if anyone can give any possible solution to this one, thank you
@terrylarry56582 жыл бұрын
Update(solved) : just add a b behind the ',' , it works like a charmed The value is red as binary, so it must be read in b form
@mohamedaminesaidane7512 Жыл бұрын
how can i run it on ubuntu ??
@BroChris2256 жыл бұрын
My son really wants to start doing exactly this kind of thing. He's been getting into python, but we've never done anything with an Arduino. If we were to try to follow along with this video, could you give me links to things I would need to have?
@engineerish6 жыл бұрын
Chris Huff Awesome! Sure thing - if you already have python up and running, what you’ll need to do is to download the Arduino IDE from their website www.arduino.cc . Get an Arduino Uno microcontroller and the joystick shield (perhaps you have an electronics store around your area that sells them both). That’s it! If you’d like to see the source code I wrote, both the arduino and python code is available on github github.com/mattiasjahnke/arduino-projects/tree/master/arduino-pc-joystick
@BroChris2256 жыл бұрын
@@engineerish Thanks!
@rajvirkaur14574 жыл бұрын
and please also make a video on making ps 4 controller
@princechannel21545 жыл бұрын
When i reached the analog reading its appeared wasn't declared If i ears it it will work Can u help me
@engineerish5 жыл бұрын
PRINCEof ARAB hi, what’s not declared? arduino.read()?
@princechannel21545 жыл бұрын
@@engineerish yes when I reached. The x analogReading (x_pin) Error wasn't declared I'm using arduino the latest It might be the program it self But. The port and everything is ok If i erase the x analogReading it will work
@princechannel21545 жыл бұрын
Can i ask if u put ur own sketches so. I. Will just copy paste Hehehehe I will appreciate that from u That will help me to much Coz i spent 20 hours just to figure it out then i gave up I became a zombie now
@engineerish5 жыл бұрын
PRINCEof ARAB don’t quite understand what’s not declared.. the function call or the variable? Source code is available (I guess that’s what you’re referring to) so copy and paste all you want ;)
@princechannel21545 жыл бұрын
Please sir you gave the code source But not your own code
@danielezambelli97452 жыл бұрын
Does it work even on Android?
@Fabiuja5 жыл бұрын
Is there a way to use it with smartphones?
@beelz10424 жыл бұрын
I don't think so , cause the pyautogui library doesn't work for mobile
@borjaapaolazaemparanza62465 жыл бұрын
Congrats for your video, its really helpfull! I am thinking of applying this to control Recalbox on Raspberry Pi through bluetooth (HC05), but was unable to find the format I should be passing the data. Do you know if the bit operation you described would work?
@engineerish5 жыл бұрын
Thanks! Cool! The format I used in this video was just a protocol I came up with during development - in order to get it to work with Recalbox, you'd probably have to adhere to their protocol. Good luck!
@IcanCwhatUsay4 жыл бұрын
What does the [:-1] and [:-2] do?
@engineerish4 жыл бұрын
The remove the last ([:-1]) and the two last ([:-2]) characters from a string in Python. stackoverflow.com/questions/15478127/remove-final-character-from-string
@arjaya.escarieses33665 жыл бұрын
Can you teach me how to connect it to the games?
@jasoncharleshale4 жыл бұрын
I'm wondering the same thing, I'm thinking of running the python script when launching EmulationStation to map the buttons to the keyboard then use those in the RetroPi controller configuration
@curlybighead11116 жыл бұрын
Hey I tried to get it to work, but my macbook isn't picking up on the inputs from the joystick shield. I copied the code from the link to the source code
@curlybighead11116 жыл бұрын
Sorry it does recognise there are inputs on the arduino side of things, but nothing happens when I try to use it when I run the python script
@engineerish6 жыл бұрын
@@curlybighead1111 On the line with '/dev/cu.usbmodem1461' - make sure that that serial port corresponds with your Arduino. You can see what yours is called by going in to the Arduino IDE -> Tools -> Port
@curlybighead11116 жыл бұрын
@@engineerish I checked that and the port I have put down is the one I am using. What else could it be?
@engineerish6 жыл бұрын
curlybighead do you see data in the serial monitor in the arduino ide? Close down the serial monitor (since otherwize it will be hogging the serial port) and run the python script - try to just dump the data from the stream to the console in python - it should be the exact same thing as the serial monitor in the IDE
@yang.chengze20084 жыл бұрын
Will windows 10 wordk as well?
@engineerish4 жыл бұрын
Should work, haven’t tried it. You’ll need to modify some of the code ofc
@yang.chengze20084 жыл бұрын
@@engineerish thanks!
@mbcraftnl25576 жыл бұрын
i have trouble with the part with getting the button states it gives me a error
@engineerish6 жыл бұрын
MBCraftnl what’s the error?
@mrfox37394 жыл бұрын
Cannot get python to work ; (
@jns18075 жыл бұрын
python code not working at me. no errors, but simply not working. please answer quick, need this for my informatics project in school. (sry for bad english im from Germany)
@engineerish5 жыл бұрын
Johannes Krempels most likely it’s the port name that needs to be changed
@jns18075 жыл бұрын
I changed the Port already, still doesnt work
@engineerish5 жыл бұрын
So try figuring out where the problem is; if you print to the console (in the python script) do you receive data from the arduino? If you run the serial monitor in the arduino ide, do you see any output?
@jns18075 жыл бұрын
engineerish in the arduino ide the serial Monitor Works Great, but in the Python console i dont see anything.
@engineerish5 жыл бұрын
Ok, so it sounds like the python code can’t connect to the serial port. 1) make sure again you have the right port name. 2) make sure you are not running the serial monitor at the same time (because then the port will be busy) 3) try getting a simpler example to work (follow a tutorial or something and get a proof of concept up and running) and see if there’s any learnings you can draw from that. Given that so many people run in to this problem, I should probably add some error handling and troubleshooting to the script
@danielibrahim55325 жыл бұрын
help me I want a copy of the code please
@thorbjrnhellehaven57665 жыл бұрын
If you have an arduino with AT16U2 for USB, I would rather make it act as a USB-keyboard/mouse/gamepad
@engineerish5 жыл бұрын
Thorbjørn Hellehaven sure - that’s a way to do it. My way of looking at it is that this makes customization and mapping of keys a lot easier. Being able to quickly change a python script rather than having to reprogram the usb, upload c code and reprogram again. But either way would do it!
@themr_pop34946 жыл бұрын
what program you are using to code in python ?
@engineerish6 жыл бұрын
I used Sublime this time
@Harsh-xo8gb6 жыл бұрын
I don't know why but when I run the python script I don't get any results. I already uploaded the arduino code. Please reply fast. I think the python code is not working
@engineerish6 жыл бұрын
Make sure the string on line "arduino = serial.Serial('/dev/cu.usbmodem1461', 115200, timeout=.1)" is the correct name for your Arduino serial
@Harsh-xo8gb6 жыл бұрын
I checked it changed the port to COM9 as I am using windows
@juancamilocarmonasanchez32865 жыл бұрын
Does it work with arduino leonardo?
@engineerish5 жыл бұрын
juan camilo carmona sanchez I don’t know if this shield is compatible with the leonardo, check with your retailer
@Inanchi054 жыл бұрын
Think so they are pretty simular
@bartyhall78785 жыл бұрын
and how do you find out the port name
@SmaRderk2 жыл бұрын
arduino tools bar port
@sudhaj37626 жыл бұрын
will it work Just with joystick
@engineerish6 жыл бұрын
Electro Hithesh yeah no problem! You can use the same code and just have a single joystick connected to the Arduino
@sudhaj37626 жыл бұрын
engineerish does it run for gta sanandres
@sep93036 жыл бұрын
Bro, mine doesn't work. I took the code from the description. I am 12 years old.
@engineerish6 жыл бұрын
MNSR 1234 going to need a little more describtion than that in order to help out ;)
@sep93036 жыл бұрын
@@engineerish please help
@phuongpt12044 ай бұрын
Is that real
@arjaya.escarieses33665 жыл бұрын
What materials did you use?
@ademcakmakkaya24814 жыл бұрын
hi Great one day project
@aleksajandric44873 жыл бұрын
gy
@PhotonicallyProjectedAtoms3 жыл бұрын
Your not an actor this isnt a show just give us the info with out all the theatrics please for God's sake