Тёмный

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

Print 'N Play
Подписаться 8 тыс.
Просмотров 28 тыс.
50% 1

I thought it would be fun to showcase the HID abilities of the Raspberry Pi Pico. And what better way to do that than make a USB to NES adapter with one?
CircuitPython for Raspberry Pi Pico:
circuitpython.org/board/raspb...
CircuitPython Library collection:
circuitpython.org/libraries
NES2USB Source Code:
github.com/printnplay/Pico-Mi...
Pick up your board here!
www.raspberrypi.org/products/...
Interested in Print N Play Merch? Check it out here!
www.redbubble.com/people/Prin...
-- Like what I'm doing here? Want early access to content, models, and more? Check me out on Patreon !
www.patreon.com/jcprintnplay
-- Follow me on the Intrawebs! --
Twitter - @jcprintnplay
Instagram - @jcprintnplay
Facebook - / jcprintnplay
Thingiverse - www.thingiverse.com/jcprintnp...
Reddit - / printnplayyt
Print n Play In Detail -
/ @printnplayindetail2415
Print n Play Shortz -
/ @printnplayshortz9489
Music from incompetech.com/music/
"Getting it Done" Kevin MacLeod (incompetech.com)
Licensed under Creative Commons: By Attribution 4.0 License
creativecommons.org/licenses/b...
"Newer Wave" Kevin MacLeod (incompetech.com)
Licensed under Creative Commons: By Attribution 4.0 License
creativecommons.org/licenses/b...
#RaspberryPi #Pico #CircuitPython

Наука

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

 

5 авг 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 110   
@adambrassard9268
@adambrassard9268 3 года назад
Actually really really cool! can't wait to see more
@bc4198
@bc4198 2 года назад
Yes!!! The keyboard mapping is **exactly** what I was hoping for!
@PrintNPlay
@PrintNPlay 2 года назад
Glad it was helpful!
@UDoIt2
@UDoIt2 3 года назад
Such a great video James! I actually feel like I can do this now.
@cbmeeks
@cbmeeks Год назад
Exactly what I was looking for. Thanks!
@evilbobbins
@evilbobbins 3 года назад
Fantastic :) can’t wait to give this a try :)
@R3D_R41D3R
@R3D_R41D3R Год назад
awesome guide helped me figure a few things out
@vonsilverhagen
@vonsilverhagen 29 дней назад
Love this, building my own retropie handheld and the teensy lc is hard to find nowadays
@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.
@pileofstuff
@pileofstuff 3 года назад
Cool implementation.
@SusanAmberBruce
@SusanAmberBruce 3 года назад
standby dopamine hit! Awesome job thanks.
@PrintNPlay
@PrintNPlay 3 года назад
Thanks Susan!
@lucas.oliveira.pessoal
@lucas.oliveira.pessoal 3 месяца назад
'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.
@mdmuntaharul6795
@mdmuntaharul6795 Год назад
hey can i use respberry pi pico as a usb to ttl converter for upgrade other device firmware
@evilskunk1
@evilskunk1 Месяц назад
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.
@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.
@luizmaximino
@luizmaximino Год назад
would you like to adapt the code for snes and being for two controls ?
@arenwatts
@arenwatts Год назад
Helpme when executing the code I get this error: ModuleNotFoundError: No module named 'digitalio'
@polyghoneoff
@polyghoneoff Год назад
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 ?
@javiernaranjo2395
@javiernaranjo2395 Год назад
Nice video, but is it possible to have a gamepad and keyboard at the same time?
@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
@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....
@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!
@-Chrome-
@-Chrome- 17 дней назад
Would this work on a Nintendo Switch?
@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 2 года назад
I think the pico is over kill, a stm32 bluepill and arduino nano can do the same thing.
@n3xuus217
@n3xuus217 2 года назад
the file is missing adafruit_hid.gamepad, pleas help
@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! ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-yN1M8ZCN3x8.html
@gggg-bk7md
@gggg-bk7md 2 года назад
hola... es posible utilizar 2 controles NES con esa Raspi Pico?? Excelente Video!!!
@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.
@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.
@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 11 месяцев назад
It will work with retropie as is, just shows up as a game pad
@user-xf8xk6hw9m
@user-xf8xk6hw9m 10 месяцев назад
how much of this information is applicable to an atari controller and can i use a normal raspberry pi to do that?
@PrintNPlay
@PrintNPlay 10 месяцев назад
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 10 месяцев назад
@@PrintNPlay i see, thank you.
@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!
@BitwiseMobile
@BitwiseMobile Год назад
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 Год назад
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 Год назад
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. ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-__QZQEOG6tA.html
@elbromas1777
@elbromas1777 Год назад
excuse me how to fix missing gamepad library problem?
@bondjovi4595
@bondjovi4595 2 года назад
MacGyver: Give me a N64 controller, Nes Controller, and a Raspberry Pico. lol
@Undar8ed03
@Undar8ed03 Год назад
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 2 месяца назад
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 2 месяца назад
@@fgregerfeaxcwfeffece ah I gotcha! Thanks for the reply
@dazealex
@dazealex 2 года назад
Amazing!11111
@logannosleep5
@logannosleep5 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 Год назад
I end here searching for a Snes software for the pico to use with Snes Controllers...... I cant find anything (only for arduino)
@logannosleep5
@logannosleep5 Год назад
@@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.
@DaimondRus
@DaimondRus Год назад
Is it possible to connect multiple gamepads (at least 2) with 1 Raspberry Pi Pico?
@PrintNPlay
@PrintNPlay Год назад
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 Год назад
Thats would be great! My idea is make a NES controller hub for PC with two ports at least.
@PrintNPlay
@PrintNPlay Год назад
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.
@W4TRI
@W4TRI 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
@ixoidyougo7113
@ixoidyougo7113 Год назад
can you do this with a ps/2 keyboard?
@PrintNPlay
@PrintNPlay 11 месяцев назад
Should be possible, but I haven't tried yet.
@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.
@J-D_
@J-D_ 3 года назад
What is your favorite nes game?
@PrintNPlay
@PrintNPlay 3 года назад
I would say Mario 3... It's so solid!
@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...
@elbromas1777
@elbromas1777 Год назад
Snes controller?
@LordOfWizardurl
@LordOfWizardurl 3 года назад
Print n play
@mattilaska3980
@mattilaska3980 Год назад
this is sicccccck! is it possible to do this with other console pads? ...up to ps2/n64?
@PrintNPlay
@PrintNPlay Год назад
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 Год назад
@@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
@BlackJaguarGX64
@BlackJaguarGX64 Год назад
i wonder how 2 player gamepad works
@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 Год назад
@@PrintNPlay same problem. Gamepad is not found ...... im unable to fix it
@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.
@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!
@godzillakaijugkalt3358
@godzillakaijugkalt3358 3 года назад
Kid n Play
Далее
🎸РОК-СТРИМ без ФАНЕРЫ🤘
3:12:10
Просмотров 1,4 млн
Making Sense of SNACs on the MiSTer FPGA
17:22
Просмотров 7 тыс.
PicoMite: Running BASIC on a Raspberry Pi Pico
19:29
Просмотров 145 тыс.
Turning a Raspberry Pi Pico into a GPU!
16:42
Просмотров 105 тыс.
Transform an old broken Keyboard to a Macro Keyboard
8:11
These Keys Shouldn't Exist | Nostalgia Nerd
19:32
Просмотров 654 тыс.
The new Raspberry Pi Pico W is just $6
7:56
Просмотров 434 тыс.