User avatar
bucker
Posts: 107
Joined: Thu May 23, 2013 4:33 pm
Location: Uberlandia, Brazil

Re: Gameboy Retropie Portable

Mon Aug 10, 2015 10:17 pm

Djinny wrote:Curious how you have the chargers and power connected. i don't believe they can be connected in parallel.
it seems it will do the job, since it's 2 USB outputs and 1 micro USB 1a for chargers, the batteries are in parallel on a case box and goes straight to the upper part of the charger module. These boards seems to be largely used in mobile power banks. I hope the juice will be enough for the Pi and the LCD, i'm thinking about your wireless on/off idea to save some power also.

here is the board: http://s27.postimg.org/j36nmq4cz/P15971 ... 0vhf3r.jpg
Winning is for losers.

Pi Zero W (inside a Pikachu case ;) ) with DietPi running Sonarr,Couchpotato,Pi-hole,Pi-VPN
Pi B running Home Assistant
Pi 2B & HiFiBerry DAC+ running Volumio OS
Pi 3B (inside a genesis case 8-) ) running RetroPie
--

User avatar
Djinny
Posts: 122
Joined: Sat Jul 05, 2014 12:21 am
Contact: Website

Re: Gameboy Retropie Portable

Tue Aug 11, 2015 4:07 am

oooh ok, i misunderstood. whew.
I thought you were using 2 separate chargers in parallel to charge the batteries. like if 1A charge rate isn't enough, connecting a second to try to get 2A charge rate.. which won't work.
whew.. had me worried there. Still haven't found an actual 2amp lipo charging module for single cell batteries. Since my lipo can charge at 3Ah.
My RPi needs a fan, heat will leech into the battery, so people saying I don't need a fan, don't understand how Li-Po batteries are affected by high temps. Cool pi = cool battery.
I would very much so like to see a Pi2/Pi3 Zero, power and size.

User avatar
bucker
Posts: 107
Joined: Thu May 23, 2013 4:33 pm
Location: Uberlandia, Brazil

Re: Gameboy Retropie Portable

Wed Oct 07, 2015 3:31 pm

Djinny wrote:oooh ok, i misunderstood. whew.
I thought you were using 2 separate chargers in parallel to charge the batteries. like if 1A charge rate isn't enough, connecting a second to try to get 2A charge rate.. which won't work.
whew.. had me worried there. Still haven't found an actual 2amp lipo charging module for single cell batteries. Since my lipo can charge at 3Ah.
Hey Djinny, i ended up getting a Teensy 2.0 just like yours, i have a couple questions, if you dont mind:

1- How do i wire my pad to the Teensy, im so confused about this, i read some tutorials teaching how to wire a retro snes pad, but the Wii U pad is different, with all the conductive strip thing, can you give me a clue on how to do this?

2- When using the Teensy, do i have to worry about resistors and stuff or its just straight soldering pad to board?

thx in advance!
Winning is for losers.

Pi Zero W (inside a Pikachu case ;) ) with DietPi running Sonarr,Couchpotato,Pi-hole,Pi-VPN
Pi B running Home Assistant
Pi 2B & HiFiBerry DAC+ running Volumio OS
Pi 3B (inside a genesis case 8-) ) running RetroPie
--

User avatar
Djinny
Posts: 122
Joined: Sat Jul 05, 2014 12:21 am
Contact: Website

Re: Gameboy Retropie Portable

Fri Oct 09, 2015 9:01 pm

Ok, for wiring buttons, you just need a common ground between all the buttons, and then when you ground the pins, it triggers the button. As for analog sticks, you need 5v to any analog sticks, make sure they are 5v tolerant, and then have the signal pin go to the teensy's analog pins, and again, sharing a common ground.
Here's my pinout: i only have 1 analog stick. But you can convert turbo/menu buttons to more axis pins, i don't know what the next 2 axes are called, Z, Zrotate? something like that. Test it in windows before you solder it all in. :D
Image

This is my exact code, just copy/pasted. It debounces all the pins, which is important, if you just use normal code, it'll show ALL buttons as pressed, gotta debounce them. Keep in mind, P0 = Button 1, P23=button 24, i don't use the interior Pin24, even though it's there, but you can.
With this code, it's very plug'n'play, i wish i had more Teensy 2.0s, as i'd make way more custom controllers and stuff.

Code: Select all

/* Basic USB Joystick Example
   Teensy becomes a USB joystick

   You must select Joystick from the "Tools > USB Type" menu

   Pushbuttons should be connected to digital pins 0 and 1.
   Wire each button between the digital pin and ground.
   Potentiometers should be connected to analog inputs 0 to 1.

   This example code is in the public domain.
*/
#include <Bounce.h>

// Create Bounce objects for each button.  The Bounce object
// automatically deals with contact chatter or "bounce", and
// it makes detecting changes very simple.
Bounce button0 = Bounce(0, 10);
Bounce button1 = Bounce(1, 10);  // 10 = 10 ms debounce time
Bounce button2 = Bounce(2, 10);  // which is appropriate for
Bounce button3 = Bounce(3, 10);  // most mechanical pushbuttons
Bounce button4 = Bounce(4, 10);
Bounce button5 = Bounce(5, 10);
Bounce button6 = Bounce(6, 10);
Bounce button7 = Bounce(7, 10);
Bounce button8 = Bounce(8, 10);
Bounce button9 = Bounce(9, 10);
Bounce button10 = Bounce(10, 10);
Bounce button11 = Bounce(11, 10);  // 10 = 10 ms debounce time
Bounce button12 = Bounce(12, 10);  // which is appropriate for
Bounce button13 = Bounce(13, 10);  // most mechanical pushbuttons
Bounce button14 = Bounce(14, 10);
Bounce button15 = Bounce(15, 10);
Bounce button16 = Bounce(16, 10);
Bounce button17 = Bounce(17, 10);
Bounce button18 = Bounce(18, 10);
Bounce button19 = Bounce(19, 10);
Bounce button22 = Bounce(22, 10);
Bounce button23 = Bounce(23, 10);
Bounce button24 = Bounce(24, 10);

void setup() {
  pinMode(0, INPUT_PULLUP);
  pinMode(1, INPUT_PULLUP);
  pinMode(2, INPUT_PULLUP);
  pinMode(3, INPUT_PULLUP);
  pinMode(4, INPUT_PULLUP);
  pinMode(5, INPUT_PULLUP);
  pinMode(6, INPUT_PULLUP);
  pinMode(7, INPUT_PULLUP);
  pinMode(8, INPUT_PULLUP);
  pinMode(9, INPUT_PULLUP);
  pinMode(10, INPUT_PULLUP);
  pinMode(11, INPUT_PULLUP);
  pinMode(12, INPUT_PULLUP);
  pinMode(13, INPUT_PULLUP);
  pinMode(14, INPUT_PULLUP);
  pinMode(15, INPUT_PULLUP);
  pinMode(16, INPUT_PULLUP);
  pinMode(17, INPUT_PULLUP);
  pinMode(18, INPUT_PULLUP);
  pinMode(19, INPUT_PULLUP);
  pinMode(22, INPUT_PULLUP);
  pinMode(23, INPUT_PULLUP);   
  pinMode(24, INPUT_PULLUP); 
}

void loop() {
  // read analog inputs and set X-Y position
  Joystick.X(analogRead(0));
  Joystick.Y(analogRead(1));

  // Update all the buttons.  There should not be any long
  // delays in loop(), so this runs repetitively at a rate
  // faster than the buttons could be pressed and released.
  button0.update();
  button1.update();
  button2.update();
  button3.update();
  button4.update();
  button5.update();
  button6.update();
  button7.update();
  button8.update();
  button9.update();
  button10.update();
  button11.update();
  button12.update();
  button13.update();
  button14.update();
  button15.update();
  button16.update();
  button17.update();
  button18.update();
  button19.update();
  button22.update();
  button23.update();
  button24.update();

  // Check each button for "falling" edge.
  // Update the Joystick buttons only upon changes.
  // falling = high (not pressed - voltage from pullup resistor)
  //           to low (pressed - button connects pin to ground)
  if (button0.fallingEdge()) {
    Joystick.button(1, 1);
  }
  if (button1.fallingEdge()) {
    Joystick.button(2, 1);
  }
  if (button2.fallingEdge()) {
    Joystick.button(3, 1);
  }
  if (button3.fallingEdge()) {
    Joystick.button(4, 1);
  }
  if (button4.fallingEdge()) {
    Joystick.button(5, 1);
  }
  if (button5.fallingEdge()) {
    Joystick.button(6, 1);
  }
  if (button6.fallingEdge()) {
    Joystick.button(7, 1);
  }
  if (button7.fallingEdge()) {
    Joystick.button(8, 1);
  }
  if (button8.fallingEdge()) {
    Joystick.button(9, 1);
  }
  if (button9.fallingEdge()) {
    Joystick.button(10, 1);
  }
  if (button10.fallingEdge()) {
    Joystick.button(11, 1);
  }
  if (button11.fallingEdge()) {
    Joystick.button(12, 1);
  }
  if (button12.fallingEdge()) {
    Joystick.button(13, 1);
  }
  if (button13.fallingEdge()) {
    Joystick.button(14, 1);
  }
  if (button14.fallingEdge()) {
    Joystick.button(15, 1);
  }
  if (button15.fallingEdge()) {
    Joystick.button(16, 1);
  }
  if (button16.fallingEdge()) {
    Joystick.button(17, 1);
  }
  if (button17.fallingEdge()) {
    Joystick.button(18, 1);
  }
  if (button18.fallingEdge()) {
    Joystick.button(19, 1);
  }
  if (button19.fallingEdge()) {
    Joystick.button(20, 1);
  }
  if (button22.fallingEdge()) {
    Joystick.button(21, 1);
  }
  if (button23.fallingEdge()) {
    Joystick.button(22, 1);
  }
  if (button24.fallingEdge()) {
    Joystick.button(23, 1);
  }
  // Check each button for "rising" edge
  // Update the Joystick buttons only upon changes.
  // rising = low (pressed - button connects pin to ground)
  //          to high (not pressed - voltage from pullup resistor)
  if (button0.risingEdge()) {
    Joystick.button(1, 0);
  }
  if (button1.risingEdge()) {
    Joystick.button(2, 0);
  }
  if (button2.risingEdge()) {
    Joystick.button(3, 0);
  }
  if (button3.risingEdge()) {
    Joystick.button(4, 0);
  }
  if (button4.risingEdge()) {
    Joystick.button(5, 0);
  }
  if (button5.risingEdge()) {
    Joystick.button(6, 0);
  }
  if (button6.risingEdge()) {
    Joystick.button(7, 0);
  }
  if (button7.risingEdge()) {
    Joystick.button(8, 0);
  }
  if (button8.risingEdge()) {
    Joystick.button(9, 0);
  }
  if (button9.risingEdge()) {
    Joystick.button(10, 0);
  }
  if (button10.risingEdge()) {
    Joystick.button(11, 0);
  }
  if (button11.risingEdge()) {
    Joystick.button(12, 0);
  }
  if (button12.risingEdge()) {
    Joystick.button(13, 0);
  }
  if (button13.risingEdge()) {
    Joystick.button(14, 0);
  }
  if (button14.risingEdge()) {
    Joystick.button(15, 0);
  }
  if (button15.risingEdge()) {
    Joystick.button(16, 0);
  }
  if (button16.risingEdge()) {
    Joystick.button(17, 0);
  }
  if (button17.risingEdge()) {
    Joystick.button(18, 0);
  }
  if (button18.risingEdge()) {
    Joystick.button(19, 0);
  }
  if (button19.risingEdge()) {
    Joystick.button(20, 0);
  }  
  if (button22.risingEdge()) {
    Joystick.button(21, 0);
  }  
  if (button23.risingEdge()) {
    Joystick.button(22, 0);
  }
  if (button24.risingEdge()) {
    Joystick.button(23, 0);
  }
}
My RPi needs a fan, heat will leech into the battery, so people saying I don't need a fan, don't understand how Li-Po batteries are affected by high temps. Cool pi = cool battery.
I would very much so like to see a Pi2/Pi3 Zero, power and size.

Return to “Gaming”