How to use Bluetooth Controllers with Python on Raspberry Pi

  Переглядів 52,182

Core Electronics

Core Electronics

День тому

If you’ve used the RetroPie operating system before, you’ll know how easy it is to integrate USB and Bluetooth gamepads as controllers. But let’s say you’ve got a robot that you want to control with a joystick, or in my case, I’m building an LED Matrix to use for retro games and I want to use the awesome 8Bitdo controllers for it. Well, it’s not quite as simple as connecting it and watching the magic happen.
Fortunately, though, it’s a fairly straight forward process, and we’re going to walk through it step by step. It'll work with any Pi board with either Bluetooth or USB, but the Pi 3 and Pi Zero W make it especially easy.
The full tutorial for this video (with images and step-by-step tips) core-electronics.com.au/tutor...
Core Electronics is your home in Australia for:
Raspberry Pi core-electronics.com.au/raspb...
8Bitdo core-electronics.com.au/brand...
RetroPie core-electronics.com.au/brand...

КОМЕНТАРІ: 46
@denisseromero4026
@denisseromero4026 5 років тому
Thank you! it was a really good explanation. I'm a beginner so I'm happy to find a tutorial easy to understand like this one.
@Walikanani
@Walikanani 3 роки тому
thanks for the info, had to make a few modifications for my joystick, but pretty straightforward.
@tarnis3d
@tarnis3d 6 років тому
This looks like exactly what I've been looking for...trying to control a robot over wifi and this looks like the missing link and simpler then PyGame.
@metaeditors
@metaeditors 5 років тому
Excellent starter Tutorial got hot with PI and Python
@Illyrium_sacrum
@Illyrium_sacrum 7 місяців тому
I like the video, respect from Albania
@Sal19
@Sal19 10 місяців тому
Hands down the best tutorial out there, easy and straight to the point. Thanks
@nejcpocrvina3630
@nejcpocrvina3630 2 місяці тому
were you ableto install 'python-dev' , because i cant and i says that the packages replace it: python-dav-is-python3. So do i need to replace 'python-dev' with 'python-dav-is-python3' or something else?
@lgbonfim
@lgbonfim 2 роки тому
Very useful! Thank you very much!
@kevinduffy86
@kevinduffy86 5 років тому
Thank you, really helpful video. I want to set up 2 SNES type controllers for 2 player pong game. How will this work for the 2nd controller, will it get its own unique values or will I need to reference the event() before the controller value?
@TheWesterwaelder
@TheWesterwaelder Рік тому
Thank you for the instructions. For me it helped me to read PS5 controller
@xmendes1212
@xmendes1212 6 років тому
i got with codes of btns .. but with the axes control i cant. can u post a python code to read axes buttons? tks
@newretrorockets
@newretrorockets 6 років тому
awesome tutorial! thanks! I used this to get an xbox one s controller reading into python on an RPI3 perfectly. Now Im just wondering if there is a way to handle the controller going to sleep (event 40) from within that for loop...as is, this causes the program to crash... any suggestions? thanks!
@jilljessurun2897
@jilljessurun2897 3 роки тому
damn good tutorial thanks very much man
@paulb8264
@paulb8264 5 років тому
Great video. So straight forward. I have only just started to work on my project (Meccanum drive robot) I'll be using a xbox 360 controller, my 8bitdo NESPro30 does not want to connect no matter what I do. You mentioned button holding. Are you planning to make a second video about that or possible the other input types? Ideally I want to use the joysticks for navigation with my project.
@KJ7JHN
@KJ7JHN 4 роки тому
Beauty. Thank you for this tutorial.
@andym3695
@andym3695 4 роки тому
thank you
@jacobzweig6446
@jacobzweig6446 6 років тому
what do i change if i want to hold down the buttons on the 8bitdo?
@shuha3216
@shuha3216 3 роки тому
Thanks! How to control rpi gpios via android like bluetooth controller?
@IbarsDaniel
@IbarsDaniel 3 роки тому
hey Sam, I'm following your tutorial with a Raspberry pi Zero W, I want to connect a generic PS3 controller but it turns out that when I hit the Bluetooth scan my raspberry disconnects me from ssh session
@vihangpathak9759
@vihangpathak9759 4 роки тому
Hey can we use ssh to use joystick ?
@Koolkole27
@Koolkole27 Рік тому
How do you do it with thumb sticks on the controller?
@RyuuzakiJulio
@RyuuzakiJulio 5 років тому
What if you want to make your pi discoverable by other devices like iOS or Android? Is it even possible?
@NickTheHunter
@NickTheHunter 6 років тому
Thank you for the video! Good explanation! I shall try to connect the PS3 controller to my RPi :3
@xandernorton2690
@xandernorton2690 4 роки тому
did this work for your ps3 controller?
@msholly4608
@msholly4608 3 роки тому
My controller (8bitdo sf30) won't show up as an even in ls /dev/inputs. plz help
@owenbrook320
@owenbrook320 4 роки тому
Hi, I was wondering if this script would work with a PS3 controller and pi, and if so how to use the inputs in writing a program for a robot? Thans
@msholly4608
@msholly4608 3 роки тому
I'm a noob but I figured I'd give my thoughts. if you find the inputs for your controller you should be able to have your py script take those inputs from the controller to an if statement that would utilize the GPIO pins on the pi to make robot go brrr
@justinlin441
@justinlin441 2 роки тому
Cannot get the hold info. Should it event.value == 2? My gamepad didn't get it. Does any anyone know why?
@jhou-cyunsu6526
@jhou-cyunsu6526 2 роки тому
Thanks a lot
@Core-Electronics
@Core-Electronics 2 роки тому
Happy to help
@bobyau8755
@bobyau8755 10 місяців тому
Does it work for python 3?
@user-vj3up1kh3n
@user-vj3up1kh3n 2 роки тому
can this work on mac?
@panzerfaustnl
@panzerfaustnl 2 роки тому
Oh this is a movie from 2017, ok no problem, is this usable with Pygame?
@iand6309
@iand6309 4 роки тому
I was following along fine until I started using python. I got a no module named evdev import error. Please Help! Also I just realized I have python 3.7 not 2. How do i get python 2 working?
@jojojorisjhjosef
@jojojorisjhjosef 4 роки тому
I made it work for python 3 by installing it with pip3 (pip3 install evdev) then, I also got the "no module" error, which I solved by making python's path variable point towards it like this: import sys sys.path.append('/home/pi/.local/lib/python3.7/site-packages/') if your directory is something else you'd change it inside the brackets accordingly.
@olimac938
@olimac938 3 роки тому
@@jojojorisjhjosef Ohhh god, you help me a lot. thanks for the answer really help me
@stinkyjutsu
@stinkyjutsu 2 роки тому
so where's the follow up explaining which values to use and how to write the script to test the motor control?
@VecterProd
@VecterProd 6 років тому
Hi hi. [bluetooth]# power on Failed to set power on: org.bluez.Error.Blocked I checked the net, didnt find any solution, any idea?
@alfredcornflake5032
@alfredcornflake5032 5 років тому
I had the same problem. Use the command "sudo rfkill unblock bluetooth" , then do "sudo bluetoothctl" , "power on".
@ionheart9313
@ionheart9313 4 роки тому
Alfred Cornflake help it’s not working
@tomueirin
@tomueirin 5 років тому
No one will ever reply to this but how do we know which one is the controller?
@fvgoya
@fvgoya 5 років тому
I think you just need to do what he did at 5:50
@Myrslokstok
@Myrslokstok 3 роки тому
Turn it on and off.
Raspberry Pi GPIO - Getting Started with gpiozero
48:40
DroneBot Workshop
Переглядів 428 тис.
Drone Programming With Python Course | 3 Hours | Including x4 Projects | Computer Vision
3:33:03
Murtaza's Workshop - Robotics and AI
Переглядів 6 млн
McDonald’s MCNUGGET PURSE?! #shorts
00:11
Lauren Godwin
Переглядів 22 млн
Godzilla Attacks Brawl Stars!!!
00:39
Brawl Stars
Переглядів 4 млн
I Can Save You Money! - Raspberry Pi Alternatives
15:04
Linus Tech Tips
Переглядів 3,2 млн
12 New AI Projects using Raspberry-Pi, Jetson Nano & more
7:50
ToP Projects Compilation
Переглядів 598 тис.
Build your OWN retro game console with a Raspberry Pi!
17:12
Jeff Geerling
Переглядів 498 тис.
Automating My Life with Python: The Ultimate Guide | Code With Me
11:26
Tiff In Tech
Переглядів 737 тис.
Tour of A Hacker's Backpack (My EDC)
24:58
Cole Kraten
Переглядів 2 млн
Why Waste Money?! FREE Retro Emulation Setup For 2023!
9:22
Madlittlepixel
Переглядів 539 тис.
How To Reverse Engineer A Bluetooth Device
11:53
Hacking Modern Life
Переглядів 39 тис.
McDonald’s MCNUGGET PURSE?! #shorts
00:11
Lauren Godwin
Переглядів 22 млн