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

Поділитися
Вставка
  • Опубліковано 27 сер 2024

КОМЕНТАРІ • 111

  • @bc4198
    @bc4198 2 роки тому +3

    Yes!!! The keyboard mapping is **exactly** what I was hoping for!

  • @Mitch3D
    @Mitch3D 3 роки тому +11

    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 роки тому +5

      Absolutely. I'm sure it just a matter of time.

  • @adambrassard9268
    @adambrassard9268 3 роки тому +5

    Actually really really cool! can't wait to see more

  • @vonsilverhagen
    @vonsilverhagen Місяць тому +1

    Love this, building my own retropie handheld and the teensy lc is hard to find nowadays

  • @SusanAmberBruce
    @SusanAmberBruce 3 роки тому +1

    standby dopamine hit!
    Awesome job thanks.

  • @UDoIt2
    @UDoIt2 3 роки тому +4

    Such a great video James! I actually feel like I can do this now.

  • @Squeezy01
    @Squeezy01 8 днів тому

    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

  • @evilbobbins
    @evilbobbins 3 роки тому +2

    Fantastic :) can’t wait to give this a try :)

  • @pileofstuff
    @pileofstuff 3 роки тому +1

    Cool implementation.

  • @cbmeeks
    @cbmeeks Рік тому

    Exactly what I was looking for. Thanks!

  • @R3D_R41D3R
    @R3D_R41D3R Рік тому

    awesome guide helped me figure a few things out

  • @lucas.oliveira.pessoal
    @lucas.oliveira.pessoal 4 місяці тому +1

    '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.

  • @montaguemonro565
    @montaguemonro565 3 роки тому +4

    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 роки тому +2

      It's on my list! Just waiting for some SD card adapters to arrive!

    • @montaguemonro565
      @montaguemonro565 3 роки тому +2

      @@PrintNPlay legend

    • @PrintNPlay
      @PrintNPlay  3 роки тому +3

      As promised!
      ua-cam.com/video/yN1M8ZCN3x8/v-deo.html

  • @arenwatts
    @arenwatts Рік тому +1

    Helpme
    when executing the code I get this error: ModuleNotFoundError: No module named 'digitalio'

  • @W4TRI
    @W4TRI 3 роки тому +2

    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 роки тому +1

      I feel your pain. I finally got mine a couple of days ago after ordering it in February

  • @BitwiseMobile
    @BitwiseMobile Рік тому +4

    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 Рік тому +1

      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. ua-cam.com/video/__QZQEOG6tA/v-deo.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

  • @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.

  • @RegularOldDan
    @RegularOldDan 3 роки тому +2

    Wishing I still had some of my old controllers... but I wonder if I should consider a custom keyboard?

    • @PrintNPlay
      @PrintNPlay  3 роки тому +2

      I have parts on order to do just that!

  • @methanoid
    @methanoid 3 роки тому +1

    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....

  • @J-D_
    @J-D_ 3 роки тому +2

    What is your favorite nes game?

    • @PrintNPlay
      @PrintNPlay  3 роки тому +1

      I would say Mario 3... It's so solid!

  • @javiernaranjo2395
    @javiernaranjo2395 Рік тому

    Nice video, but is it possible to have a gamepad and keyboard at the same time?

  • @skbabasaba
    @skbabasaba 3 роки тому +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 роки тому +2

      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.

  • @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.

  • @-Chrome-
    @-Chrome- Місяць тому

    Would this work on a Nintendo Switch?

  • @COOLGUY-tb7ob
    @COOLGUY-tb7ob 3 роки тому +1

    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

  • @user-xf8xk6hw9m
    @user-xf8xk6hw9m 11 місяців тому +1

    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.

  • @andypyne
    @andypyne 3 роки тому +1

    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 роки тому +1

      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.

  • @mdmuntaharul6795
    @mdmuntaharul6795 2 роки тому

    hey can i use respberry pi pico as a usb to ttl converter for upgrade other device firmware

  • @gggg-bk7md
    @gggg-bk7md 2 роки тому +1

    hello. can this be done with raspberry pi pico?

    • @gggg-bk7md
      @gggg-bk7md 2 роки тому +1

      sorry... i mean using two atari joysticks...

    • @PrintNPlay
      @PrintNPlay  2 роки тому +1

      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.

  • @luizmaximino
    @luizmaximino Рік тому

    would you like to adapt the code for snes and being for two controls ?

  • @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

  • @nathanlevigraves
    @nathanlevigraves 3 роки тому +1

    Forgive my ignorance, but is the pico connected to the raspberry pi/computer/etc via usb?

  • @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 ?

  • @DaimondRus
    @DaimondRus Рік тому +1

    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 Рік тому +1

      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.

  • @gggg-bk7md
    @gggg-bk7md 2 роки тому

    hola... es posible utilizar 2 controles NES con esa Raspi Pico?? Excelente Video!!!

  • @LordOfWizardurl
    @LordOfWizardurl 3 роки тому +1

    Print n play

  • @logannosleep5
    @logannosleep5 2 роки тому +1

    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.

  • @n3xuus217
    @n3xuus217 2 роки тому

    the file is missing adafruit_hid.gamepad, pleas help

  • @elbromas1777
    @elbromas1777 Рік тому

    Snes controller?

  • @ixoidyougo7113
    @ixoidyougo7113 Рік тому

    can you do this with a ps/2 keyboard?

    • @PrintNPlay
      @PrintNPlay  Рік тому

      Should be possible, but I haven't tried yet.

  • @gggg-bk7md
    @gggg-bk7md 2 роки тому +1

    thanks for your answer... would the code be the same as the one used in this tutorial?

    • @PrintNPlay
      @PrintNPlay  2 роки тому +1

      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 роки тому +1

      @@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 роки тому +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 роки тому +1

      @@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 роки тому +1

      @@PrintNPlay LOL... Thanks!!
      All the time you need...

  • @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

  • @TheOriginalVersatile
    @TheOriginalVersatile 2 роки тому

    Cool concept or use nes controller with USB adapter to pc instead?

    • @PrintNPlay
      @PrintNPlay  2 роки тому +1

      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!

  • @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.

  • @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 3 місяці тому +1

      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 3 місяці тому +1

      @@fgregerfeaxcwfeffece ah I gotcha! Thanks for the reply

  • @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!

  • @BlackJaguarGX64
    @BlackJaguarGX64 2 роки тому

    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 роки тому +1

    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.

  • @dazealex
    @dazealex 2 роки тому

    Amazing!11111

  • @godzillakaijugkalt3358
    @godzillakaijugkalt3358 3 роки тому

    Kid n Play