WII U RASPBERRY PI 3 FINISHED

Want to show off your own project? Want to keep a build log of it? Post it here!
User avatar
banjokazooie
Posts: 207
Joined: Thu May 19, 2016 1:14 pm
Been thanked: 160 times

Re: WII U RASPBERRY PI 3 FINISHED

Post by banjokazooie » Mon Jun 03, 2019 4:05 pm

jbenedetto84 wrote:
Sun Jun 02, 2019 4:47 pm
banjokazooie wrote:
Sun Jun 02, 2019 10:17 am
Put a cheap ac filter on the power input to the audio amplifier to get rid of any noise :)
https://www.ebay.co.uk/itm/COILCRAFT-BU ... 0010.m2109
Thanks! I will try that and let you know how it goes.

Just to confirm, I would wire it like this:

Image

If so, does it matter which is "in" and which is "out"?

ALSO - I plan on making a second one of these for a friend. Where do you guys get the (i assume 36awg) hook up wire? The smallest I can find is 30 but the wires you have to your teensy look much smaller.
It does not matter which way is connected just make sure not to make shortcircuit.

Wrapping wire
https://www.aliexpress.com/item/PCB-Sol ... st=ae803_4

djobbydjobba
Posts: 8
Joined: Tue Mar 26, 2019 6:45 am
Has thanked: 2 times

Re: WII U RASPBERRY PI 3 FINISHED

Post by djobbydjobba » Thu Jun 06, 2019 12:19 pm

Hi Banjokazooie ! I have just finished my build and I'm using your code. I experience a strange behavior with the analog sticks. My left stick works flawless, up and down on the right stick too but left and right are recognised like left and right of the other stick...
My first thought was a bad solder that could be in contact with another pin, resoldered everything, same result.
Then I took an analog stick from another spare working wiiU gamepad, same result.
Then I used a brand new teensy, same result.
Then I tried different analog pins on the teensy and changed the code accordingly, same result...
It's driving me ****ing crazy ! Needless to say I double checked any short with my controller...
Have any of you heard about such a thing ? I'm lost !

Here is my actual code:
SpoilerShow
const int MODE = 8; // the pin that the pushbutton is attached to
const int LED = 23;

int buttonPushCounter = 0; // counter for the number of button presses
int buttonState = 0; // current state of the button
int lastButtonState = 0;

void setup() {


pinMode(15, INPUT_PULLUP); // 01 Left Shoulder
pinMode(14, INPUT_PULLUP); // 02 Lelf Trigger
pinMode(13, INPUT_PULLUP); // 03 Right
pinMode(12, INPUT_PULLUP); // 04 Left
pinMode(11, INPUT_PULLUP); // 05 Up
pinMode(22, INPUT_PULLUP); // 06 Down
pinMode(3, INPUT_PULLUP); // 07 B
pinMode(6, INPUT_PULLUP); // 08 A
pinMode(5, INPUT_PULLUP); // 09 Right Trigger
pinMode(LED, OUTPUT); // LED
pinMode(1, INPUT_PULLUP); // 13 Start
pinMode(2, INPUT_PULLUP); // 14 Select
pinMode(0, INPUT_PULLUP); // 15 Y
pinMode(MODE, INPUT_PULLUP); // HOME Button
pinMode(20, INPUT_PULLUP); // 19 Left Joystick Button
pinMode(21, INPUT_PULLUP); // 20 Right Joystick Button
pinMode(4, INPUT_PULLUP); // 23 Right Shoulder
pinMode(7, INPUT_PULLUP); // 24 X
pinMode(9, INPUT_PULLUP); // TV Button

// Serial.begin(9600);

}

void loop_joystick() {

if (digitalRead(0) == LOW)
{
Joystick.button(15, 1);
}
else
{
Joystick.button(15, 0);
}

if (digitalRead(1) == LOW)
{
Joystick.button(13, 1);
}
else
{
Joystick.button(13, 0);
}

if (digitalRead(2) == LOW)
{
Joystick.button(14, 1);
}
else
{
Joystick.button(14, 0);
}

if (digitalRead(3) == LOW)
{
Joystick.button(7, 1);
}
else
{
Joystick.button(7, 0);
}

if (digitalRead(4) == LOW)
{
Joystick.button(23, 1);
}
else
{
Joystick.button(23, 0);
}

if (digitalRead(5) == LOW)
{
Joystick.button(9, 1);
}
else
{
Joystick.button(9, 0);
}

if (digitalRead(6) == LOW)
{
Joystick.button(8, 1);
}
else
{
Joystick.button(8, 0);
}

if (digitalRead(7) == LOW)
{
Joystick.button(24, 1);
}
else
{
Joystick.button(24, 0);
}

if (digitalRead(9) == LOW)
{
Keyboard.press(KEY_ESC);
}
else
{
Keyboard.release(KEY_ESC);
}

if (digitalRead(11) == LOW)
{
Joystick.button(5, 1);
}
else
{
Joystick.button(5, 0);
}

if (digitalRead(12) == LOW)
{
Joystick.button(4, 1);
}
else
{
Joystick.button(4, 0);
}

if (digitalRead(13) == LOW)
{
Joystick.button(3, 1);
}
else
{
Joystick.button(3, 0);
}

if (digitalRead(14) == LOW)
{
Joystick.button(2, 1);
}
else
{
Joystick.button(2, 0);
}


if (digitalRead(15) == LOW)
{
Joystick.button(1, 1);
}
else
{
Joystick.button(1, 0);
}

if (digitalRead(20) == LOW)
{
Joystick.button(19, 1);
}
else
{
Joystick.button(19, 0);
}

if (digitalRead(21) == LOW)
{
Joystick.button(20, 1);
}
else
{
Joystick.button(20, 0);
}

if (digitalRead(22) == LOW)
{
Joystick.button(6, 1);
}
else
{
Joystick.button(6, 0);
}

int rX = analogRead(5);
rX = (rX - 512) * 1.8 + 512;
if (rX > 1023)
rX=1023;
if (rX < 0)
rX = 0;

int rY = analogRead(4);
rY = (rY - 512) * 1.8 + 512;
if (rY > 1023)
rY=1023;
if (rY < 0)
rY = 0;
rY=abs(1023-rY);

int rL = analogRead(2);
rL = (rL - 512) * 1.8 + 512;
if (rL > 1023)
rL=1023;
if (rL < 0)
rL = 0;

int rR = analogRead(3);
rR = (rR - 512) * 1.8 + 512;
if (rR > 1023)
rR=1023;
if (rR < 0)
rR = 0;
//rR=abs(1023-rR);

Joystick.X(rX);
Joystick.Y(rY);
Joystick.sliderLeft(rL);
Joystick.sliderRight(rR);
}


void loop_keyboard() {

if (digitalRead(11) == LOW)
{
Keyboard.press(KEY_UP);
}
else
{
Keyboard.release(KEY_UP);
}

if (digitalRead(22) == LOW)
{
Keyboard.press(KEY_DOWN);
}
else
{
Keyboard.release(KEY_DOWN);
}

if (digitalRead(12) == LOW)
{
Keyboard.press(KEY_LEFT);
}
else
{
Keyboard.release(KEY_LEFT);
}

if (digitalRead(13) == LOW)
{
Keyboard.press(KEY_RIGHT);
}
else
{
Keyboard.release(KEY_RIGHT);
}

//buttons
if (digitalRead(15) == LOW)
{
Keyboard.press(KEY_ENTER);
}
else
{
Keyboard.release(KEY_ENTER);
}
if (digitalRead(14) == LOW)
{
Keyboard.press(KEY_ESC);
}
else
{
Keyboard.release(KEY_ESC);
}

if (digitalRead(4) == LOW)
{
Keyboard.press(KEY_LEFT_CTRL);
}
else
{
Keyboard.release(KEY_LEFT_CTRL);
}

if (digitalRead(5) == LOW)
{
Keyboard.press(KEY_LEFT_ALT);
}
else
{
Keyboard.release(KEY_LEFT_ALT);
}

if (digitalRead(6) == LOW)
{
Keyboard.press(KEY_A);
}
else
{
Keyboard.release(KEY_A);
}
if (digitalRead(3) == LOW)
{
Keyboard.press(KEY_B);
}
else
{
Keyboard.release(KEY_B);
}
if (digitalRead(0) == LOW)
{
Keyboard.press(KEY_Y);
}
else
{
Keyboard.release(KEY_Y);
}
if (digitalRead(7) == LOW)
{
Keyboard.press(KEY_X);
}
else
{
Keyboard.release(KEY_X);
}

if (digitalRead(1) == LOW)
{
Keyboard.press(KEY_F12);
}
else
{
Keyboard.release(KEY_F12);
}
if (digitalRead(2) == LOW)
{
Keyboard.press(KEYPAD_5);
}
else
{
Keyboard.release(KEYPAD_5);
}

}


void loop() {

buttonState = digitalRead(MODE);
if (buttonState != lastButtonState) {
if (buttonState == HIGH) {
buttonPushCounter++;
// Serial.println("on");
// Serial.print("number of button pushes: ");
// Serial.println(buttonPushCounter);
}
else {
// Serial.println("off");
}
}
lastButtonState = buttonState;

if (buttonPushCounter % 2 == 0) {
digitalWrite(LED, HIGH);
} else {
digitalWrite(LED, LOW);
}


if (digitalRead(LED) == LOW)
{
loop_joystick();
}
else
{

loop_keyboard();
}
}
Last edited by Helder on Tue Jul 02, 2019 4:36 am, edited 1 time in total.
Reason: use a spoiler next time so the post isn't huge.

User avatar
banjokazooie
Posts: 207
Joined: Thu May 19, 2016 1:14 pm
Been thanked: 160 times

Re: WII U RASPBERRY PI 3 FINISHED

Post by banjokazooie » Fri Jun 07, 2019 2:06 am

djobbydjobba wrote:
Thu Jun 06, 2019 12:19 pm
Hi Banjokazooie ! I have just finished my build and I'm using your code. I experience a strange behavior with the analog sticks. My left stick works flawless, up and down on the right stick too but left and right are recognised like left and right of the other stick...
My first thought was a bad solder that could be in contact with another pin, resoldered everything, same result.
Then I took an analog stick from another spare working wiiU gamepad, same result.
Then I used a brand new teensy, same result.
Then I tried different analog pins on the teensy and changed the code accordingly, same result...
It's driving me ****ing crazy ! Needless to say I double checked any short with my controller...
Have any of you heard about such a thing ? I'm lost !

Here is my actual code:

Wiring issue, double check connections, rewire or change the code .

djobbydjobba
Posts: 8
Joined: Tue Mar 26, 2019 6:45 am
Has thanked: 2 times

Re: WII U RASPBERRY PI 3 FINISHED

Post by djobbydjobba » Fri Jun 07, 2019 12:01 pm

Ok. Don't know how it is even possible but it turned out to be a software issue with emulation station. Fresh installed and everything's fine. Sorry to bother you.

Noxta
Posts: 10
Joined: Wed Apr 17, 2019 4:54 pm
Has thanked: 1 time
Been thanked: 2 times

Re: WII U RASPBERRY PI 3 FINISHED

Post by Noxta » Thu Jun 27, 2019 9:10 am

Hi, I'm almost finishing my project. Everything is fine, but I have a question with the audio.

Is the connector that carries the DAC that I have removed it valid for the circuit?

I want that when I connect the headphones the audio is passed to these and that the speakers stop working and when I remove the headphones the sound returns to the speakers.

If the one with the DAC is not valid, which one do you recommend?

The diagram that I send is a bit so you can see how I plan to connect it. I'm not saying that the drawing with the connections is fine
Attachments
IMG_20190627_170241.jpg
IMG_20190627_170241.jpg (2.72 MiB) Viewed 655 times

User avatar
banjokazooie
Posts: 207
Joined: Thu May 19, 2016 1:14 pm
Been thanked: 160 times

Re: WII U RASPBERRY PI 3 FINISHED

Post by banjokazooie » Thu Jun 27, 2019 3:55 pm

Noxta wrote:
Thu Jun 27, 2019 9:10 am
Hi, I'm almost finishing my project. Everything is fine, but I have a question with the audio.

Is the connector that carries the DAC that I have removed it valid for the circuit?

I want that when I connect the headphones the audio is passed to these and that the speakers stop working and when I remove the headphones the sound returns to the speakers.

If the one with the DAC is not valid, which one do you recommend?

The diagram that I send is a bit so you can see how I plan to connect it. I'm not saying that the drawing with the connections is fine
It will not work with the green audio jack as you need 5 pin connector

Noxta
Posts: 10
Joined: Wed Apr 17, 2019 4:54 pm
Has thanked: 1 time
Been thanked: 2 times

Re: WII U RASPBERRY PI 3 FINISHED

Post by Noxta » Tue Jul 02, 2019 4:27 am

Could the USB DAC be removed and connected to the jack connector of the pi itself?

User avatar
Mewcancraft
Posts: 5
Joined: Mon Jul 09, 2018 11:28 am
Location: Belgium

Re: WII U RASPBERRY PI 3 FINISHED

Post by Mewcancraft » Tue Jul 02, 2019 10:06 am

Hi Banjo. I was wondering whether the code in the first post of this thread is up to date and functional as-is; when I try to verify in the Arduino IDE, namely, it says "Joystick" does not exist (makes sense, since it's never imported or anything). Furthermore, the code and code comments don't match the Teensy figure in the post.

I'm also wondering why the code mentions an LED, and what the difference is between "joystick mode" and "keyboard mode", which can be switched between by pressing the home button.

User avatar
banjokazooie
Posts: 207
Joined: Thu May 19, 2016 1:14 pm
Been thanked: 160 times

Re: WII U RASPBERRY PI 3 FINISHED

Post by banjokazooie » Tue Jul 02, 2019 4:31 pm

Mewcancraft wrote:
Tue Jul 02, 2019 10:06 am
Hi Banjo. I was wondering whether the code in the first post of this thread is up to date and functional as-is; when I try to verify in the Arduino IDE, namely, it says "Joystick" does not exist (makes sense, since it's never imported or anything). Furthermore, the code and code comments don't match the Teensy figure in the post.

I'm also wondering why the code mentions an LED, and what the difference is between "joystick mode" and "keyboard mode", which can be switched between by pressing the home button.
The code was used in my first build and is fully functional. The picture diagram of teensy board is just for general idea of the connections and might not match the final code changed during build ( that is the beauty of teensy and arduino code ;) ).
For joystick function you have to install libraries and pick the proper teensy mode within arduino (joystick, keyboard, serial device).

const int LED = 11; you can omit this constant and use pin number instead.
Joystick mode = analog joystick and buttons
Keyboard mode = buttons acts as keyboard

Noxta
Posts: 10
Joined: Wed Apr 17, 2019 4:54 pm
Has thanked: 1 time
Been thanked: 2 times

Re: WII U RASPBERRY PI 3 FINISHED

Post by Noxta » Wed Jul 03, 2019 12:45 am

Good morning, I have a problem with the project.

First of all I'm doing it as Veterangamer all the connections and parts as he recommends. I am also using the wii plate or last one that created helder with all the components welded correctly.

The thing is that I have everything connected, then nothing turns on, I press the power button and the PI turns on, but after two seconds it turns off. Also the screen.

I tried to connect everything to retro psu and it turns on perfectly, but if I try to turn it on from the wii u helder board it shuts down at the moment
Attachments
IMG_20190703_221512.jpg
IMG_20190703_221512.jpg (2.73 MiB) Viewed 489 times
IMG_20190703_221618.jpg
IMG_20190703_221618.jpg (2.9 MiB) Viewed 489 times

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest