Connect with us

How to add button?

Discussion in 'General Electronics Discussion' started by aurora, Apr 24, 2016.

  1. aurora

    aurora

    1
    0
    Apr 24, 2016
    Hello,

    How to connect button to computer port via microcontroller between them? The button should start Linux shell command. How to program the chip? What programmer device to use? What IDE to write the program? C++?

    Thank you.

    Angel
     
  2. donkey

    donkey

    1,286
    56
    Feb 26, 2011
  3. Gryd3

    Gryd3

    4,098
    875
    Jun 25, 2014
    Donkey has a good starting point above.

    You are really starting from ground zero though... you only really have two options...
    Option 1 :
    - Look into vUSB based kayboard/gamepad projects. Most commonly, microcontrollers are used to make small gaming keypads or full-blown custom keyboards. Look into these projects and use a micro-controller to monitor a button, and carry out a 'macro' . For windows, this could be something like 'Win+R <pause> cmd <enter>'
    The problem with this, is that the input from your device may interrupt, or get interrupted by the user's keyboard. This is the easiest method to get what you want though...

    Option 2 :
    - This is a little trickier to program and requires drivers to be installed on the host computer to talk to the microcontroller via USB. This give you ultimate control over what the microcontroller can do though, and you don't have to worry about a user's mouse or keyboard input interrupting or conflicting with your device.

    In either case... you have a long road ahead of you. It's not as simple as buying a couple devices and hitting 'go' . You will need to do your research into which method you prefer, which microcontroller to use, and how to build your circuit.
    I'm not a fan of dropping the name 'arduino' so freely because there are lots of alternatives I feel are more robust, but arduino will be much easier for you to pick up and run with if you want to use Option 1. Setup costs are also much smaller. However... if you want to use option 2, you may find a steep learning curve to either program arduino at the lower level required, or to program a lower level device like an AVR or PIC. They are all good options, but considering your perceived skill set I would most certainly suggest Arduino unless Option 1 is unacceptible... in which case I would strongly suggest you do more reading and research into writing driver for the host OS you want to use your device with.
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-