Raspberry Pi Pico Keyboard and Gamepad HID with an NES Controller!

  Рет қаралды 31,102

Print 'N Play

Print 'N Play

Күн бұрын

Пікірлер: 114
@adambrassard9268
@adambrassard9268 3 жыл бұрын
Actually really really cool! can't wait to see more
@Mitch3D
@Mitch3D 3 жыл бұрын
HID option on the pico make it great. I wish the standard micropython had better support than the circuitpython version. I'm sure more support and libraries will come to the pico.
@PrintNPlay
@PrintNPlay 3 жыл бұрын
Absolutely. I'm sure it just a matter of time.
@bc4198
@bc4198 2 жыл бұрын
Yes!!! The keyboard mapping is **exactly** what I was hoping for!
@PrintNPlay
@PrintNPlay 2 жыл бұрын
Glad it was helpful!
@vonsilverhagen
@vonsilverhagen 6 ай бұрын
Love this, building my own retropie handheld and the teensy lc is hard to find nowadays
@Squeezy01
@Squeezy01 4 ай бұрын
I am really big into simracing and recently built my first steering wheel using arduino pro micro but I was really limited with the number of pins on it. This looks like a simple solution with a few more GPIO pins
@UDoIt2
@UDoIt2 3 жыл бұрын
Such a great video James! I actually feel like I can do this now.
@lucas.oliveira.pessoal
@lucas.oliveira.pessoal 9 ай бұрын
've already installed CircuitPython on my Raspberry Pico. I'm encountering an error where Thonny can't find the digitalio module. It also happens with the board module. I've tried using Visual Studio Code (VSC) as well, but it didn't work either.
@BitwiseMobile
@BitwiseMobile 2 жыл бұрын
This has been a super frustrating experience for me. It seems that none of the later CircuitPython libraries contain the Gamepad class. I found some source code from an older library and added that into my adafruit_hid folder. That solved the compilation problem I was seeing in Repl. Okay, I thought, maybe I need to downgrade. I'm not bleeding edge, but I do have latest which is 7.x. Maybe they took the library out of 7 for whatever reason? Okay, so I downgrade to 6.3 which is the last version 6 that was released before 7 was released, so it should be latest and greatest with all bug fixes and everything for version 6. The UF2 installed just fine, but again, the Gamepad class is missing from the 6.x library files. I had to go pull them from the S3 bucket, since they aren't available on the download site any longer. Still the class is missing! I tried adding the class manually, and like before it compiled just fine, but my computer is not recognizing it as a gamepad. Is this a linux only HID device? I'm fairly certain that there are HID reports on Windows. When I plug in my joystick I see it as a game controller. I'm not seen the Pico as a game controller. I'm seeing it as a keyboard (and looking at the device list just about every HID device the pico supports), but no gamepad descriptor anywhere. I'm trying to use the Pico so I can use a game controller built for the Pi on my computer. I want to use it with MAME. It's just an old school joystick with microswitches, and a bunch of arcade buttons. It's the Pimoroni Arcade box if you are familiar with it. I can make this work in 2 seconds with my Teensy, but I'm stubborn and I want to make use of these new fangled RP2040s ;). I have a Pico, an Adafruit Feather (which is essentially a Pico), and a Nano. I struggled with Platform IO to get the HID drivers to work correctly, and I found some promising stuff in Python, but alas, no luck for me yet. I'm half tempted to just wire up my Teensy and be done with it, but I see videos like this and other people have shown similar results, so I know it's possible.
@BitwiseMobile
@BitwiseMobile 2 жыл бұрын
Haha, right after I wrote that wall of text, I deleted the old USB record, unplugged, and plugged the device back in and it worked. I was reading somewhere that sometimes on Windows the old record can be sticky, so you sometimes have to just delete the entire device and re-install it. That worked for me. I am now seeing a gamepad.
@PrintNPlay
@PrintNPlay 2 жыл бұрын
Haha glad you made progress! If you are interested, here is a usb game pad built with a Pico on the latest version of circuit python. kzbin.info/www/bejne/lZC0i4R7hKxpqqM
@elbromas1777
@elbromas1777 Жыл бұрын
excuse me how to fix missing gamepad library problem?
@frednocontrole
@frednocontrole 3 ай бұрын
Have you tried using the Pi Pico to adapt another controller from another console, at least on the channel I haven't seen it. The video was fantastic.
@RegularOldDan
@RegularOldDan 3 жыл бұрын
Wishing I still had some of my old controllers... but I wonder if I should consider a custom keyboard?
@PrintNPlay
@PrintNPlay 3 жыл бұрын
I have parts on order to do just that!
@arenwatts
@arenwatts 2 жыл бұрын
Helpme when executing the code I get this error: ModuleNotFoundError: No module named 'digitalio'
@evilskunk1
@evilskunk1 6 ай бұрын
Nice project. I may try this myself. Also, bit off topic, a thought crossed my mind of would it be possible to enhance an actual NES console with a Raspberry Pi Pico though the expansion port for a plug and play upgrade? If so, maybe it could be used for homebrew developers to rid of problems like sprite flicker and slowdown on actual hardware. Mind you the games would have to have a patch library to take advantage of the enhancements. With the added horsepower, it may be possible to port Shovel Knight little to no compromise outside of widescreen support.
@SusanAmberBruce
@SusanAmberBruce 3 жыл бұрын
standby dopamine hit! Awesome job thanks.
@PrintNPlay
@PrintNPlay 3 жыл бұрын
Thanks Susan!
@COOLGUY-tb7ob
@COOLGUY-tb7ob 3 жыл бұрын
What would be the easiest way to connect the nes controller wires to a pico on a breadboard? I don't have a soldering kit so I can't solder it. Could I strip the wires and then plug it in to a breadboard directly?
@PrintNPlay
@PrintNPlay 3 жыл бұрын
I think the connections would be a little spotty in this case, but it might work. If you have some male jumper cables, you could cut them, and then twist them together with the wires from the NES controller connector, then wrap them in tape. If you have female jumper cables, you could do the same thing but connect them directly to the Pi. Let me know if any of those work for you
@montaguemonro565
@montaguemonro565 3 жыл бұрын
Hi, love your videos mate! I'm not sure if this is a silly request but i'd love to see a video on using an sd card with the pico. I'm currently building a self watering garden and want to create csv files for making graphs but cannot find anything online!
@PrintNPlay
@PrintNPlay 3 жыл бұрын
It's on my list! Just waiting for some SD card adapters to arrive!
@montaguemonro565
@montaguemonro565 3 жыл бұрын
@@PrintNPlay legend
@PrintNPlay
@PrintNPlay 3 жыл бұрын
As promised! kzbin.info/www/bejne/r3-UfmuQeLNmrpo
@skbabasaba
@skbabasaba 3 жыл бұрын
Amazing job. Keep up the good work. I am working on a project and need your expert opinion on that. I am trying to use pico/raspberry pi zero (w) with a barcode scanner to build a stand-only system that can be linked with the app using a smartphone. I am not sure whether I can use raspberry pi pico for that or not? Can you please share your thoughts on that.
@PrintNPlay
@PrintNPlay 3 жыл бұрын
As it stands, the pico lacks wireless or Bluetooth connectivity. You would have to buy one of the upcoming boards that offers more wireless communication, or code to connect to a separate wifi or Bluetooth adapter. The zero w would offer the functionality out of the box. What types of barcodes do you want to scan?
@skbabasaba
@skbabasaba 3 жыл бұрын
@@PrintNPlay I am planning to scan barcodes of retail items in my store. My plan is to use raspberry pi zero with a basic barcode reader and register the transactions on the web/mobile phone.
@Mitch3D
@Mitch3D 3 жыл бұрын
You can get an OTG adapter and use a generic USB 2D barcode scanner to read barcode ascii as a keyboard on most phones (Android at least)
@PrintNPlay
@PrintNPlay 3 жыл бұрын
Exactly what I was thinking. Could probably also use the camera on the phone to capture the barcode.
@pileofstuff
@pileofstuff 3 жыл бұрын
Cool implementation.
@javiernaranjo2395
@javiernaranjo2395 2 жыл бұрын
Nice video, but is it possible to have a gamepad and keyboard at the same time?
@andypyne
@andypyne 3 жыл бұрын
Is there any benefit / disadvantage to use a pico over an arduino for this type of implementation - in particular in regards to latency, presenting multiple gamepads, and other devices like arcade spinners etc?
@PrintNPlay
@PrintNPlay 3 жыл бұрын
If we get down to the technicalities, the polling speed in circuit python for the Pico isn't as fast as other languages. I'd have to double check the numbers, but we could be talking with a 1 - 2ms versus, say, an Arduino micro implementation. In execution, it seemed to be as responsive as any of the other usb devices I've used over the years. Multiple devices shouldn't cause any issues, the USB bus would be the limiting factor at that point and I don't think the Pico is giving it an amount of overhead that would cause issues. All of this is, of course, to the best of my knowledge :)
@cubbucca
@cubbucca 3 жыл бұрын
I think the pico is over kill, a stm32 bluepill and arduino nano can do the same thing.
@R3D_R41D3R
@R3D_R41D3R Жыл бұрын
awesome guide helped me figure a few things out
@cbmeeks
@cbmeeks 2 жыл бұрын
Exactly what I was looking for. Thanks!
@gggg-bk7md
@gggg-bk7md 2 жыл бұрын
thanks for your answer... would the code be the same as the one used in this tutorial?
@PrintNPlay
@PrintNPlay 2 жыл бұрын
The code would be a fair bit different, since the input method between an Atari joystick and nes controller are different. I can build an example in my spare time if you wish
@gggg-bk7md
@gggg-bk7md 2 жыл бұрын
@@PrintNPlay I'd appreciate it a lot. I'm starting a basic Python course and I'm not ready to write the code yet. Thanks!!
@gggg-bk7md
@gggg-bk7md 2 жыл бұрын
I will immediately buy a Raspi Pico to remember my childhood playing Atari. YES, I'm a "little" older than you... ;-)
@PrintNPlay
@PrintNPlay 2 жыл бұрын
@@gggg-bk7md haha! Perhaps not as much as you think! But I'd be glad to help you do that. Give me a little time to gather the parts I need.
@gggg-bk7md
@gggg-bk7md 2 жыл бұрын
@@PrintNPlay LOL... Thanks!! All the time you need...
@methanoid
@methanoid 3 жыл бұрын
How about doing same for using a USB mouse with an Atari ST or Commodore Amiga? MANY people would love a cheap alt to those crazy overpriced adapters ($20-30) that ONLY work on USB mice that use the PS2 protocol over USB....
@mdmuntaharul6795
@mdmuntaharul6795 2 жыл бұрын
hey can i use respberry pi pico as a usb to ttl converter for upgrade other device firmware
@user-xf8xk6hw9m
@user-xf8xk6hw9m Жыл бұрын
how much of this information is applicable to an atari controller and can i use a normal raspberry pi to do that?
@PrintNPlay
@PrintNPlay Жыл бұрын
It's somewhat transferable. Atari controllers just have all their buttons as contacts in the connector, so you'd have to connect those individually and check them individually. There are libraries that work on the Raspberry Pi to allow you to use the GPIO as a gamepad.
@user-xf8xk6hw9m
@user-xf8xk6hw9m Жыл бұрын
@@PrintNPlay i see, thank you.
@evilbobbins
@evilbobbins 3 жыл бұрын
Fantastic :) can’t wait to give this a try :)
@luizmaximino
@luizmaximino 2 жыл бұрын
would you like to adapt the code for snes and being for two controls ?
@noicthebrave
@noicthebrave Ай бұрын
Finally managed to get it working with Circuit Python Ver. 6.3 (and ver. 6.x for the HID lib -something like that) - however, for some reason when I press the right controller button, it acts like I am pressing right and A at the same time. Every other button including A act normally tho. Anyone know why that might be? More accurately, how to fix it? Not sure if this is a hardware issue or a code issue. The controller itself when re-wired and plugged back into the NES still works as normal, leading me to believe it may be a software issue... Thoughts?
@DaimondRus
@DaimondRus 2 жыл бұрын
Is it possible to connect multiple gamepads (at least 2) with 1 Raspberry Pi Pico?
@PrintNPlay
@PrintNPlay 2 жыл бұрын
I haven't tested it myself yet, but you can, in theory, create multiple usb game pad devices on one Pico. In a similar way to it being a keyboard, mouse, and game pad. It's a little more involved than that but I can try to put together a quick tutorial if you like
@DaimondRus
@DaimondRus 2 жыл бұрын
Thats would be great! My idea is make a NES controller hub for PC with two ports at least.
@PrintNPlay
@PrintNPlay 2 жыл бұрын
That's something that's been in my list for a while! I am hoping to do with connection for NES and SNES, since the communication methods for the two controller types are essentially identical. I'm a little swamped at the moment, but I'll try and get it done asap.
@zergmare7
@zergmare7 Жыл бұрын
First off, AWESOME video my dude! I want to make a portable retropie handheld and I wanted to use this pico to be its buttons. How can I hook this up to a pi 4 use the pico as the butttons and joysticks. Could you tell me how?
@PrintNPlay
@PrintNPlay Жыл бұрын
It will work with retropie as is, just shows up as a game pad
@TheOriginalVersatile
@TheOriginalVersatile 2 жыл бұрын
Cool concept or use nes controller with USB adapter to pc instead?
@PrintNPlay
@PrintNPlay 2 жыл бұрын
Can absolutely use a pre-built adapter. But this gives you control over how it works. You can add turbo, build in the ability to use macro keys, use keyboard emulation to allow you to use it in old computer emulators that used keyboard input instead of joystick. And it also demonstrates how NES / SNES controllers were able to accomplish inputs while using so few wires! Plus, now if you want to build a Pico project and use an NES controller with it, now you know how to!
@gggg-bk7md
@gggg-bk7md 2 жыл бұрын
hello. can this be done with raspberry pi pico?
@gggg-bk7md
@gggg-bk7md 2 жыл бұрын
sorry... i mean using two atari joysticks...
@PrintNPlay
@PrintNPlay 2 жыл бұрын
You could definitely build an Atari to usb adapter. Atari controllers are actually more simplistic. They're essentially 5 buttons, 1 for each direction, and one for the button. So you would connect each to a GPIO pin on the Pico, as well as ground. Then you can just check the Pi s to see if the button is pressed.
@nathanlevigraves
@nathanlevigraves 3 жыл бұрын
Forgive my ignorance, but is the pico connected to the raspberry pi/computer/etc via usb?
@PrintNPlay
@PrintNPlay 3 жыл бұрын
Yes it is
@nathanlevigraves
@nathanlevigraves 3 жыл бұрын
@@PrintNPlay thanks!
@-Chrome-
@-Chrome- 5 ай бұрын
Would this work on a Nintendo Switch?
@MotownBatman
@MotownBatman Жыл бұрын
New Sub!! Dryden, MI Excellent Job! I was looking into this yesterday & now this popped up as a Suggestion... Creepy In the Early 2000s, I figured out with some Help Online how to Wire OEM controllers to the Parallel Port on a Win 9x Machine. In Particular up to 5 NES controllers: Using a DirectX 5 Driver.
@gggg-bk7md
@gggg-bk7md 2 жыл бұрын
hola... es posible utilizar 2 controles NES con esa Raspi Pico?? Excelente Video!!!
@LoganE01
@LoganE01 2 жыл бұрын
tried this with the SNES 2 player console port, matching the Clock, latch, 5v, Ground, and Data.. hoping they'd be enough alike....spoiler alert, it didnt work... the red light lit up tho... Also by the way, where would I start if i was trying to make this into a "dedicated adapter"?
@goyetus
@goyetus 2 жыл бұрын
I end here searching for a Snes software for the pico to use with Snes Controllers...... I cant find anything (only for arduino)
@LoganE01
@LoganE01 2 жыл бұрын
@@goyetus honestly it shouldn't be that difficult and that project might be easily translated to the Pico. I'm not very good with software I'm more of a hardware guy. I'm actually learning to breadboard some hardware out right now using the SNES.
@gardud7
@gardud7 2 жыл бұрын
I am trying to do this with a Xbox duke controller. Im not sure how to wire the USB wires to the pico. The wires are similar to yours in the video but still unsure. I want to make it bluetooth. I already have the Bluetooth part working
@PrintNPlay
@PrintNPlay 2 жыл бұрын
So, if we're looking at the original Duke controller from the original Xbox, the controller is essentially a USB game pad, with the proprietary Xbox connector at the end. Connecting it to the Pico in the same fashion as the NES controller isn't possible, as they communicate differently. The Pico is capable as acting as a USB host and talking to the controller, but I haven't played with that at all yet. I guess the first step would be to convert the Xbox controller into a USB controller, then look at how the Pico can communicate with USB devices when acting as the host. If I find anything that will help, I'll add another comment here.
@W4TRI_Ronny
@W4TRI_Ronny 3 жыл бұрын
Found out last week I get to wait another month or more for my Pico board! Ohh well. Keep the printers melting!
@PrintNPlay
@PrintNPlay 3 жыл бұрын
Aww man, that sucks! Well, you will have a long list of things to do with it by the time you get it!
@tracz99
@tracz99 3 жыл бұрын
I feel your pain. I finally got mine a couple of days ago after ordering it in February
@mattilaska3980
@mattilaska3980 2 жыл бұрын
this is sicccccck! is it possible to do this with other console pads? ...up to ps2/n64?
@PrintNPlay
@PrintNPlay 2 жыл бұрын
I believe so. The actual communication between different controllers is different, but I believe it's possible for the Pico to talk to pretty much all of them. Some might need a low level converter to switch from 5v to 3.3v input/output. Other than that, it's just knowing how they various devices communicate.
@mattilaska3980
@mattilaska3980 2 жыл бұрын
@@PrintNPlay thank you so much, i love your vids... if I find code online somewhere I'll defo give it a go... i'm a novice
@n3xuus217
@n3xuus217 2 жыл бұрын
the file is missing adafruit_hid.gamepad, pleas help
@Undar8ed03
@Undar8ed03 2 жыл бұрын
Awesome video but I have a question. Could I use 2 Picos for 2 controllers on the same PC for 2 player games??
@fgregerfeaxcwfeffece
@fgregerfeaxcwfeffece 8 ай бұрын
Yes, but keyboards are not handled like that by the OS. Gamepad mode no problem no matter how many you connect. For keyboards the OS does not differentiate from which one the input came so you would have to do different mappings.
@Undar8ed03
@Undar8ed03 8 ай бұрын
@@fgregerfeaxcwfeffece ah I gotcha! Thanks for the reply
@polyghoneoff
@polyghoneoff 2 жыл бұрын
Hi, got a little problem. I tried and did the same moves as you and it turned out that... my raspberry pi couldn't find adafruit_hid.gamepad. Can someone help me please ?
@J-D_
@J-D_ 3 жыл бұрын
What is your favorite nes game?
@PrintNPlay
@PrintNPlay 3 жыл бұрын
I would say Mario 3... It's so solid!
@bondjovi4595
@bondjovi4595 3 жыл бұрын
MacGyver: Give me a N64 controller, Nes Controller, and a Raspberry Pico. lol
@ixoidyougo7113
@ixoidyougo7113 Жыл бұрын
can you do this with a ps/2 keyboard?
@PrintNPlay
@PrintNPlay Жыл бұрын
Should be possible, but I haven't tried yet.
@RanbirRatti
@RanbirRatti 3 жыл бұрын
I dont have a Controller any alternative pls?
@PrintNPlay
@PrintNPlay 3 жыл бұрын
Absolutely. Do you have any buttons and a breadboard?
@RanbirRatti
@RanbirRatti 3 жыл бұрын
@@PrintNPlay 2 buttons and a breadboard
@PrintNPlay
@PrintNPlay 3 жыл бұрын
So you can replace the code where I check the controller for button presses by just connecting your buttons up to pins on the gpio of the pico. You will probably want more than two buttons, though
@RanbirRatti
@RanbirRatti 3 жыл бұрын
@@PrintNPlay I did not get you can you send your email I will give my number there and you can message me for help
@PrintNPlay
@PrintNPlay 3 жыл бұрын
I'm afraid I can't do phone calls or text messaging for support.
@elbromas1777
@elbromas1777 Жыл бұрын
Snes controller?
@gggg-bk7md
@gggg-bk7md 2 жыл бұрын
hi... ill try your code.. line to line... but Thonny show this error warning.. "Traceback (ultima llamada reciente): Archivo "", línea 5, en ImportError: ningún módulo se llama 'adafruit_hid.gamepad'
@PrintNPlay
@PrintNPlay 2 жыл бұрын
Did you save the boot.py to the Pico and unplug it / plug it back in?
@gggg-bk7md
@gggg-bk7md 2 жыл бұрын
im using CircuitPython 6.2.0 and lib Bundle 6.x (Adafruit)
@PrintNPlay
@PrintNPlay 2 жыл бұрын
Oh, my bad, I thought you were replying to the other video! It's possible that they dropped the game pad support files from the bundle. Let me check it out tomorrow and see if I can see where things went wrong!
@goyetus
@goyetus 2 жыл бұрын
@@PrintNPlay same problem. Gamepad is not found ...... im unable to fix it
@BlackJaguarGX64
@BlackJaguarGX64 2 жыл бұрын
i wonder how 2 player gamepad works
@LordOfWizardurl
@LordOfWizardurl 3 жыл бұрын
Print n play
@randysmith7094
@randysmith7094 Жыл бұрын
USB adapter? But I thought this could emulate NES and play full resolution Doom. Unless... no, those other couple videos couldn't be fake? Huh? No!
@dazealex
@dazealex 2 жыл бұрын
Amazing!11111
@ATASamoraii
@ATASamoraii 2 ай бұрын
how can give me 10 usdt,s I want to make this but I dont have money 😢
@timemachine80stoy2k
@timemachine80stoy2k 3 жыл бұрын
Kid n Play
@raspberrypi Pico SD Card Tutorial - Read, Write, and Log Data
5:02
Сестра обхитрила!
00:17
Victoria Portfolio
Рет қаралды 958 М.
Support each other🤝
00:31
ISSEI / いっせい
Рет қаралды 81 МЛН
Why You Need To Put A Raspberry Pi Pico Inside Your XBOX Right Now!
17:37
Macho Nacho Productions
Рет қаралды 306 М.
Raspberry Pi Pico - DIY Macro Keyboard
16:00
Novaspirit Tech
Рет қаралды 102 М.
CONTROL ARCADE Tipo: HITBOX, 250 dólares? mejor lo HACEMOS
59:55
Mundo Yakara
Рет қаралды 46 М.
The most complex city-building simulator
17:23
StopGame
Рет қаралды 437 М.
Assembly guide for the Pico Voltex Controller
11:10
tokaku
Рет қаралды 45 М.
Raspberry Pi Pico - USB HID Auto Clicker with Circuit Python
11:53
Novaspirit Tech
Рет қаралды 77 М.
When Did Raspberry Pi become the villain?
21:54
Jeff Geerling
Рет қаралды 1,8 МЛН