Complete code PS2 controller

Anything to do with programing the Arduino Platform.
Tjup
Posts: 11
Joined: Jul 30th, 2019, 9:53 am

Re: Complete code PS2 controller

Post by Tjup »

im stuck on MASTER, did you upload on a NodeMCU v3?i cant upload to NodeMCU, but fine on a Uno,but then i need to change code right?
Tjup
Posts: 11
Joined: Jul 30th, 2019, 9:53 am

Re: Complete code PS2 controller

Post by Tjup »

im about to give up, i uploaded both codes , slave to a Nano, and Master to another Nano, wired some wires, to see if a led lights up when i press buttons, but nothing at all, i dont know what im doing wrong :cry:
i wired them togheter as shown, TX to RX, vis versa, still nothing..
I noticed the Master Nano, is lid red and yellow, and the salve just yellow, is this correct? or something wrong?
User avatar
PhilA
Posts: 42
Joined: Oct 1st, 2017, 12:53 am
Location: Australia

Re: Complete code PS2 controller

Post by PhilA »

Both lights Tx/Rx on the master and slave Nano's should be flashing to show that it is sending and receiving. But the LED's connected to the Master actually operate independent of the slave. Their code is only written to the master nano, so will operate on/off regardless of comms between the master and slave.

I still think that if you haven't tried with a different PS2 controller then don't rule that out as being the issue.

I had trouble with different Nanos I got from China, but check the PS2 controller first.

Post a photo of your set up so we can see connections.
Tjup
Posts: 11
Joined: Jul 30th, 2019, 9:53 am

Re: Complete code PS2 controller

Post by Tjup »

i tryied whit 2 controllers, but to the same PS2, but none of em do anything, can it be because its Europe version or something?
i dosent mak sense 2 controllers dosent work
User avatar
PhilA
Posts: 42
Joined: Oct 1st, 2017, 12:53 am
Location: Australia

Re: Complete code PS2 controller

Post by PhilA »

Post a photo of your setup.
Tjup
Posts: 11
Joined: Jul 30th, 2019, 9:53 am

Re: Complete code PS2 controller

Post by Tjup »

orderd 2 new controllers, so i have to wait to them to arrive, i preciate all ur help so fare :)
Tjup
Posts: 11
Joined: Jul 30th, 2019, 9:53 am

Re: Complete code PS2 controller

Post by Tjup »

I give up, it simply cant be right 4 controllers aint working on this code, it totally pisses me of, so i better give up on this projekt.. :/
Ian MacKenzie
Posts: 160
Joined: Jan 3rd, 2014, 10:04 pm
Location: Vancouver B.C. Canada

Re: Complete code PS2 controller

Post by Ian MacKenzie »

Don't give up yet. I've been trying to get my project to work for 6 months, and it's not very complicated. Many times I've wanted to toss it out the window(I live on the 4th floor, so probably not a good idea). Have you tried asking for advice in any Arduino forums, or a robotics forum? I'd bet anything that you could get the answers you need.
User avatar
PhilA
Posts: 42
Joined: Oct 1st, 2017, 12:53 am
Location: Australia

Re: Complete code PS2 controller

Post by PhilA »

So without a picture to see your set up, try breaking it down to just getting an LED to turn on and off. Upload the 'master' code to the Arduino Nano which is connected to the PS2 controller (make sure there are no other connections to the second (Slave) Arduino Nano), ensure code compiles correctly and you have correct libraries installed. Wire up an LED with resistor to pin 2. Pressing the green triangle button will turn this led on/off.
Wolf91
Posts: 3
Joined: May 30th, 2019, 11:28 am

Re: Complete code PS2 controller

Post by Wolf91 »

Like PhilA says, break down your code. Also remember, with arduino you have the great option of using Serial for debugging (you can also attach leds to some ports and use them for debugging).

The easiest way is to write some code to print some text (or light an led) if the main code passes some point. If that works, then you know the problem is further on in the code.
Post Reply