PS3 CONTROLLER TO ARDUINO TUTORIAL - use a playstation 3 to control your arduino projects
HTML-код
- Опубликовано: 10 сен 2024
- In this video i show you how you can use a ps3 controller with an arduino to control your projects
Support me on Patreon: / a_tech
Hi, I prefer to use the PS3 controller as an actual video game controller on PC but the input lag sucks. I was thinking about using the shell/buttons with the micro pro + arduino software to "recreate" the controller but could I use a simpler method? I don't not need BT as it will increase input lag. Thanks for your help.
hi, i tried to make a controller but couldn't do it with any less lag than the ps3 one, apparently ps5 ones are pretty good on pc
Hi I'm getting an OSC did not start error for my controller
did you get it working?
Sir, great tutorial about how to use a PlayStation to control your Arduino projects. Sir, can you make a video on youtube on making a video about an Xbox-controlled 6-dof robotic arm car using the Xbox 360 controller and give me the circuit diagram and the code for the Xbox-controlled 6-dof robotic arm car using the Xbox 360 controller?
Sir, can you make a video on youtube on making a video about how to interface an Xbox controller to control your Arduino Uno?
hi, the reason I used ps3 is because I had some lying around, if I can get an old xbox controller i will do the same for that, thanks
Hi, I can’t seem to understand how to link this video with the hoverboard one. Like how do I get the connected ps3 controller to output to the DAC script and control the hoverboard?
hi, yes control the output of the DAC with the ps3 controller, it will be outputting a voltage, you can test it by plugging the DAC output into an analog pin and reading the voltage when sending different signals to confirm its working, hope this helps
Hi, thanks for the video! What range do you get for your BT-controlled hoverboard vehicle?
hi, its around 15 - 20m so not very far
Do you still need to use the dacs with the controller, like in your other video?
hi, thats right yes, you use the dacs to mimic the potentiometer, so you can use them with so many things, thanks
I would like to connect my PS3 controller to my MKR 1010 shield. It does not have a port for connecting a USB hub. Is it imperative to connect the controller with a cable to the board to pair the devices?
It appears that the PS3BT library cannot be compiled with a MKR 1010 board selected.
@@adamsolovay51 ok, i would say it does need the cable to be paired, unless you can split the wires and join them up to something
this looks very cool. so what i am thinking is, if i build a racing wheel for a ps3, full of buttons potentiometer, hall effect sensors and leds. if you can send code from the ps3 controller which i want be using. once the steering wheel is all mapped to your code, could the code then send driver inputs to the ps3 console thus then driving a car, without a ps3 controller? this would be a hugh project for me but a great learning curve
I don’t think it would work because the steering wheel is usb?
Which pins can i use as output for LED or something?
I think pins 2,3,4,5 and possibly 6 are free
Hello, I uploaded the BT code and was able to connect my controller using usb hard cable but when I use my Bluetooth dongle my controller connects but I am not seeing any data in my serial monitor. Any ideas on what is wrong, thanks.
do you have the serial speed set the same as in the code?
I did set the baud rate in my code to 115200 as well as in the serial monitor
@@christianaristigue2374 ok once its connected, upload the ps3bt code
Nice video and great repurpose of PS3 controller. Any ideas of how to interrupt on a button push so I can put set a flag for Loop to read? I want this part of a larger controller code for my bot, so can't have it constantly polling (I think).
hi, so you only want it to read all the control functions when it detects a button press or a change? its not a bad idea to make the code run faster, i find using less functions works too, not sure if this helps?
@@A-tech My biggest problem is finding a Bluetooth dongle that works!!!! gone thru 3 so far. anyone know a good source?
@@JohnMacGuy hi, the ones i use are very cheap, looks like a small black block on the end of the usb plug with CSR V4.0 printed on it, hope this helps
@@A-tech Thanks for the reply...Can yo tell me where you got them?
@@JohnMacGuy hi ye sure I got them off ebay
I dont seem to get it to work. Im new to this programming, so i might do something wrong. but i have tried 2 different USB bluetooth dungles and both a ps3 and ps4 controller (for the ps4 controller i did use PS4USB and PS4BT). Both controllers work when i connect them via cable, they do give an output in the serial monitor, but they wont connect via bluetooth with the dongle. Do you have any tips or ideas i could try?
did you comment out a line of the code like i showed in the video?
@@A-tech yes, I did. I'm gonna try it again today, but I'm sure I did everything from your video
@@A-tech also, im not sure if its thanks to the code, but when i connect my controller with the arduino and load the PS3USB on it, when i try the serial monitor it doesnt show like you have "cross" or "Square", it just writes some question marks and all kinds of symbols. I though it might be that i use a 3th part controller, but when i tried my official ps4 controler with the ps4 programming it still doesnt work any way. Could it be that i installed the worng libary, eventhough i am sure i used the one in this video?
@@WimpieObama ok i would say get hold of an official ps3 controller and go from there, thanks
@@WimpieObama the serial monitor normally puts up lots of question marks when the serial speed settings are not matched ... i see this is 3 years old so i assume you found the problem?
I've been messing with Arduino for the 1st time today and since I happened to have a PS3 controller, the same BT dongle, and USB host shield (where I had to do some bridging) I figured I'll try follow your example. It seems to be working, except on my monitor I get some gibberish instead of "button up"... it's appearing as I press the buttons (the circle vibrates as well) but makes no sense. It's mostly question marks but other special characters too. Any idea what might be the cause of it?
solved. Dunno yet what the "baud" number under the serial monitor is, but it was set to different from what was in the example code "Serial.begin(115200)" setting it to the same number now gives me propper results
hi, yes i was just going to say that sounds like serial speed mismatch, good you figured it out
Interested in that ps3 "move navigation" controller. Did you ever play with that?
hi, yes they are good but you dont get many buttons, ideal if its only for a basic robot
Nice thanks for posting, shame to hear the arduino freezes with hoverboard
I have used an arduino to control over dac for a scratch built remote tank little bigger one you have shown still wip
I've gotten the ps3 controller to connect to a hoverboard, and work flawlessly using and esp32 and my own code.
@gazznewphone I know this is old, but do you happen to have a example code for this project?
@tuber8363 , yes still have the code for most of the projects ive had a play with, will have to refresh me on which one inparticular, is this hc12 comms with arduino to output dac output as theres 3 sets of code for that project, transmitter, receiver and hoverboard code/ firmware
@@gazznewphone I'm interested in the Arduino to output dac output and hoverboard code.
It would be nice if you can share the source code of this project
its all in the ps3bt example, get the library and it will be there
Nice!
Thanks!
Why i get the error: ''no matching function for call to 'PS3BT::getAnalogButton(Button)'' constantly? What do i have to do to upload correctly the code?
ok i think it should be something like this "getAnalogButton(CROSS)", hope that helps
@@A-tech Oke i understand but i don't see ''getAnalogButton(Button)'' even in the code. Only in the error. In the code it is ''getAnalogButton(L2)'' and ''getAnalogButton(R2)''
@@A-tech I used exactly the same code as you from USB_Host_Shield_Library_2_0-1.3.2 and in all videos i watch there is no problem with uploading but i don't understand why the error comes by me
@@jelmer7806 ok only thing i can think of is library maby? do the example sketches work?
@@A-tech How do you mean?
Very nice tutorial!! Is it possible use RF module?? If possible, can u give me source code?
hi, thanks, unfortunately the ps3 controller only uses bluetooth, if you have to use rf, you can make an rf transmitter that can receive the bluetooth from the controller, i did something like that with the rc tank mk2
Is this possible with the PS4 controller
i think so but you would need the ps4bt library
Any chance you paste links to purchase the parts in the project?
its literally an arduino uno, uno usb shield, usb bluetooth adapter and a ps3 controller, thanks
@@A-tech I was struggling to find a USB shield for a long time, was able to find one since (was out of stock in many places)
Nice work!, can you please post your hoverboard code?
hi, i would but there is a problem that i dont want others to have, something happens with the ps3 control and causes the arduino to freeze and the hoverboard motors keep going! so at the moment its not safe, thanks
No problem, thanks for your reply.
Very nice work & video, could you pls share the source code. Thanks in advance.
hi, have a look in the BTPS3 example, there us lots of code in there you can cut out, thanks
How to connect a motor sheild to it
hi, im not sure if you can, the usb shield uses some of the pins for its thing, depending on what pins the motor shield uses it might be ok, im pretty sure pins 2,3,4,5 and 6 are ok to use, thanks
Can u share the source code
there is an example with the library