element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Raspberry Pi
  • Products
  • More
Raspberry Pi
Raspberry Pi Forum Setting up the GPIO Pins as keyboard Controls for Chameleon
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
Raspberry Pi Wishlist
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 5 replies
  • Subscribers 674 subscribers
  • Views 1174 views
  • Users 0 members are here
  • helpme
  • pi
  • gpio
  • learning
  • cartridge
  • atari_2600
  • atari
  • innovation
Related

Setting up the GPIO Pins as keyboard Controls for Chameleon

Former Member
Former Member over 12 years ago

So basically I have been setting up an emulation station on my Pi for the past few months. I am getting very close to finishing this project. It will be housed in an Atari 2600 Sears Sixer case. Play games for NES, SNES, MAME, and the Atari 2600. Well actually let me rephrase that, currently it emulates NES, SNES and MAME. It plays actual Atari 2600 cartridges. Like plug in your cartridge and go play it with 100% compatibility as far as I can tell (With over 100 of my personal games it works with no glitches or problems).

 

Anyway, on to my question. Everything works fine and dandy with my keyboard. But that is lame. Its supposed to use actual Atari 2600 Joysticks. The Chameleon program only allows the use of a Keyboard for controls. Ive spent a few hours looking without a definite answer on how to set up the GPIO pins to correspond to Keyboard inputs.

 

So like I map it out and connect it to the D-Sub port for atari joysticks. When I press up on the joystick the Pi thinks im pressing up on the keyboad etc.

 

It boots straight to Chameleon too, there are no other Images on the SD card (Like desktops, or other things)

 

 

Im not looking for links to other forums i've seen all of that already. This is the final part of my project and im just all out of brain juice and need step by step help with this. If you also know how to change what buttons do what in Chameleon let me know too, thanks.

  • Sign in to reply
  • Cancel
  • shabaz
    shabaz over 12 years ago

    Hi Connor,

     

    I think you're saying you have some application called Chameleon, which accepts keyboard input,  but you'd like to emulate keyboard input using pins configured as inputs?

    If so, I've not tried it, but it looks like this URL has what you need. Download, compile (i.e. type 'make'), and follow the instructions in the README (keyboard settings are to be placed in a config file that it mentions).

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 12 years ago in reply to shabaz

    shabaz wrote:

     

    but you'd like to emulate keyboard input using pins configured as inputs?

    No need to emulate anything

    I've not tried it, but it looks like this URL has what you need.

    I didn't dig too deeply into that, but I can't quite come up with any use case for it other than NIH syndrome.

     

    The kernel provides this sort of stuff for you, from Documentation/gpio.txt in the kernel source

     

    Note that standard kernel drivers exist for common "LEDs and Buttons"

    GPIO tasks:  "leds-gpio" and "gpio_keys", respectively.  Use those

    instead of talking directly to the GPIOs; they integrate with kernel

    frameworks better than your userspace code could.

     

    These days there are actually two drivers:

     

    config KEYBOARD_GPIO

            tristate "GPIO Buttons"

            depends on GENERIC_GPIO

            help

              This driver implements support for buttons connected

              to GPIO pins of various CPUs (and some other chips).

     

              Say Y here if your device has buttons connected

              directly to such GPIO pins.  Your board-specific

              setup logic must also provide a platform device,

              with configuration data saying which GPIOs are used.

     

              To compile this driver as a module, choose M here: the

              module will be called gpio_keys.

     

    config KEYBOARD_GPIO_POLLED

            tristate "Polled GPIO buttons"

            depends on GENERIC_GPIO

            select INPUT_POLLDEV

            help

              This driver implements support for buttons connected

              to GPIO pins that are not capable of generating interrupts.

     

              Say Y here if your device has buttons connected

              directly to such GPIO pins.  Your board-specific

              setup logic must also provide a platform device,

              with configuration data saying which GPIOs are used.

     

              To compile this driver as a module, choose M here: the

              module will be called gpio_keys_polled.

     

    These drivers are mostly used by Arm devices or other embedded boards precisely to make gpio based buttons appear as if they are just another keyboard to all userspace applications. The obvious advantages are that your app can't tell the difference and that they're properly integrated, so can be configured with the standard tools i.e. you can remap your gpio keys just like remapping your normal keyboard from UK to French to German etc.

     

    I gave up counting the number of Arm boards using gpio_keys when I passed 100....  plenty of example code to copy, just grep -r -i 'gpio_keys.h' arch/arm/* in the kernel source.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 12 years ago

    I appreciate the responses. But like I said I'm out. I'm post op and will be on meds for a while. Right now I can't make much sense of this and thank goodness for autocorrect t right now. I just want to play my childhood games on my tv. If someone could kindly make a nice little Image of this and chameleon so I can just install it and have my buddy wire it up for me that would be great. I'm stuck on the couch and one can only watch so many episodes of judge Judy before you lose your mind

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 12 years ago in reply to Former Member

    that is funny !!!!!!!!!!!   thanks for the laugh !  lol  image   but I do hope you are Ok buddy !... Sincerely,

    Chuck... U.S.A.  Delaware state,

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 12 years ago in reply to Former Member

    Sorry, as I was trying to say. Can someone please reconfigure this so I can play my Atari 2600 games. Set it up so player 1 and 2 have the 4 directions and fire? Then just make a nice little image for me to download

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube