• Recent
  • Tags
  • Popular
  • Home
  • Docs
  • Register
  • Login
RetroPie forum home
  • Recent
  • Tags
  • Popular
  • Home
  • Docs
  • Register
  • Login

Help needed for a Handheld Project

Scheduled Pinned Locked Moved Projects and Themes
controllerteensypcbbuttonswires
18 Posts 2 Posters 6.2k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M
    moosepr @Jiehfeng
    last edited by 15 Jan 2017, 16:48

    @Jiehfeng your analog stick seems to have 5 pins. They normally work like variable resistors, which have 3 pins. One will be connected to +ve, one to -ve, and the this is connected somewhere in between. Your teensy will measure the voltage from the middle pin, which will change depending on it angle of the stick.

    https://www.arduino.cc/en/Tutorial/AnalogInput

    You will basically have 1 analog input for each stick direction.

    want to get a tft into your project, look no further than here https://retropie.org.uk/forum/topic/7464/ili9341-tft-screen-guide

    1 Reply Last reply Reply Quote 1
    • M
      moosepr @Jiehfeng
      last edited by 15 Jan 2017, 16:50

      @Jiehfeng

      stix

      want to get a tft into your project, look no further than here https://retropie.org.uk/forum/topic/7464/ili9341-tft-screen-guide

      J 1 Reply Last reply 15 Jan 2017, 16:57 Reply Quote 1
      • J
        Jiehfeng @moosepr
        last edited by 15 Jan 2017, 16:57

        @moosepr What is +ve or -ve? Or where is that?

        alt text

        So to put it in perspective, what colour wires do I wire exactly from the 5 pins to the Teensy LC? (kinda noob so don't understand yet)

        J 1 Reply Last reply 15 Jan 2017, 17:02 Reply Quote 0
        • J
          Jiehfeng @Jiehfeng
          last edited by 15 Jan 2017, 17:02

          @Jiehfeng That arduino tutorial has many different parts I don't have, so I don't really know how to understand it with my own parts.

          M 1 Reply Last reply 16 Jan 2017, 09:40 Reply Quote 0
          • M
            moosepr @Jiehfeng
            last edited by 16 Jan 2017, 09:40

            @Jiehfeng ah sorry, on the sticks, +ve is the pwr and -ve is the gnd. Connecting to the teensy you will want to connect the pwr pin on the stick to the 3.3v on the teensy, and gnd to gnd.

            you will then want to connect the dir pins (dirH and dirV), into analog pins on the teensy (they are the a0-a9 pins). and for a final bonus, you could attach the click pin from the sticks into any of the digital pins (the grey ones on the diagram) you could always assign them to start/select so you dont need the extra buttons

            your code on the teensy will then read the voltage from the analog pins, which will range from 0 to 3.3v over the range of movement of the stick

            want to get a tft into your project, look no further than here https://retropie.org.uk/forum/topic/7464/ili9341-tft-screen-guide

            J 1 Reply Last reply 16 Jan 2017, 10:41 Reply Quote 1
            • J
              Jiehfeng @moosepr
              last edited by Jiehfeng 16 Jan 2017, 10:41

              @moosepr Thanks a bunch, that's 90% of the info I need to finish my project. The other 10% is the wires. I understand completely where the pins connect to the teensy, but what colour wires for what pins?

              GND - Black
              PWR - Red
              Dir H - Yellow?
              Dir V - Green?
              Click - White?

              Do buttons use red or white wire?

              M 1 Reply Last reply 16 Jan 2017, 11:08 Reply Quote 0
              • M
                moosepr @Jiehfeng
                last edited by moosepr 16 Jan 2017, 11:08

                @Jiehfeng technically speaking, the colour of the wires is irrelevant. as long as you know what colour does what, your golden. Most people do tend to stick with red for power, and black for ground, but nothing is set in stone

                want to get a tft into your project, look no further than here https://retropie.org.uk/forum/topic/7464/ili9341-tft-screen-guide

                1 Reply Last reply Reply Quote 1
                • J
                  Jiehfeng
                  last edited by 9 Feb 2017, 17:21

                  Hey, I just got the Teensy LC with a few momentary push button switches. I put a button onto the PCB and soldered it on, then put a red wire to the top left pin and the black wire to the bottom left pin (soldered), and connected the black to the GND on the Teensy and the red to the 0 digital pin.
                  But for some reason my button isn't working? I tried the basic example and button example on teensyduino but the button won't respond.

                  M 1 Reply Last reply 9 Feb 2017, 21:32 Reply Quote 0
                  • M
                    moosepr @Jiehfeng
                    last edited by 9 Feb 2017, 21:32

                    @Jiehfeng do you have access to a multimeter?

                    On the push buttons, there are normally 4 pins, but some are connected and some switch.

                    linky

                    If you look at the bottom right part of the image, the top 2 pins are always connected together, and the bottom pins are connected together, then all 4 are connected together when the button is pressed

                    want to get a tft into your project, look no further than here https://retropie.org.uk/forum/topic/7464/ili9341-tft-screen-guide

                    J 1 Reply Last reply 10 Feb 2017, 04:50 Reply Quote 0
                    • J
                      Jiehfeng @moosepr
                      last edited by 10 Feb 2017, 04:50

                      @moosepr No sadly not.
                      I'll try switching the wires up to every possible pin and see if it works. The switch is SPST btw.

                      J 1 Reply Last reply 10 Feb 2017, 07:13 Reply Quote 0
                      • J
                        Jiehfeng @Jiehfeng
                        last edited by 10 Feb 2017, 07:13

                        @Jiehfeng Just tried with another button, works fine. I guess that button was faulty. Thanks again. :)

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post

                        Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

                        Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.

                          [[user:consent.lead]]
                          [[user:consent.not_received]]