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
    About the element14 Community
  • 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
element14's The Ben Heck Show
  • Challenges & Projects
  • element14 presents
  • element14's The Ben Heck Show
  • More
  • Cancel
element14's The Ben Heck Show
Forum push button mouse on raspberry pi
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join element14's The Ben Heck Show to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Not Answered
  • Replies 8 replies
  • Subscribers 31 subscribers
  • Views 903 views
  • Users 0 members are here
Related

push button mouse on raspberry pi

pi.minecraft
pi.minecraft over 11 years ago

could you help me make a mouse using push buttons

  • Sign in to reply
  • Cancel
Parents
  • gadget.iom
    0 gadget.iom over 11 years ago

    You could use a device such as the Teensy to simulate a USB mouse. Buttons can be added to the GPIO as necessary.

     

    https://www.pjrc.com/teensy/td_mouse.html

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • pi.minecraft
    0 pi.minecraft over 11 years ago in reply to gadget.iom

    If I was going to use an analog joystick what would the code be and the pin outs on the Teensy

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • pi.minecraft
    0 pi.minecraft over 11 years ago in reply to gadget.iom

    If I was going to use an analog joystick what would the code be and the pin outs on the Teensy

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
  • gadget.iom
    0 gadget.iom over 11 years ago in reply to pi.minecraft

    imageimage

    /*
      Analog Input
     Demonstrates analog input by reading an analog sensor on analog pin 0 and
     turning on and off a light emitting diode(LED)  connected to digital pin 13. 
     The amount of time the LED will be on and off depends on
     the value obtained by analogRead(). 
     
     The circuit:
     * Potentiometer attached to analog input 0
     * center pin of the potentiometer to the analog pin
     * one side pin (either one) to ground
     * the other side pin to +5V
     * LED anode (long leg) attached to digital output 13
     * LED cathode (short leg) attached to ground
     
     * Note: because most Arduinos have a built-in LED attached 
     to pin 13 on the board, the LED is optional.
     
     
     Created by David Cuartielles
     modified 30 Aug 2011
     By Tom Igoe
     
     This example code is in the public domain.
     
     http://arduino.cc/en/Tutorial/AnalogInput
     
     */
    
    int sensorPin = A0;    // select the input pin for the potentiometer
    int ledPin = 13;      // select the pin for the LED
    int sensorValue = 0;  // variable to store the value coming from the sensor
    
    void setup() {
      // declare the ledPin as an OUTPUT:
      pinMode(ledPin, OUTPUT);  
    }
    
    void loop() {
      // read the value from the sensor:
      sensorValue = analogRead(sensorPin);    
      // turn the ledPin on
      digitalWrite(ledPin, HIGH);  
      // stop the program for <sensorValue> milliseconds:
      delay(sensorValue);          
      // turn the ledPin off:        
      digitalWrite(ledPin, LOW);   
      // stop the program for for <sensorValue> milliseconds:
      delay(sensorValue);                  
    }

     

    Useful information can be found on the following page: http://arduino.cc/en/Tutorial/AnalogInput

    The Teensy can be programmed with the Arduino IDE.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • 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 © 2026 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