Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arduino Ps3Data Example is wrong #9

Closed
SerEpicPanda opened this issue Jan 20, 2020 · 1 comment
Closed

Arduino Ps3Data Example is wrong #9

SerEpicPanda opened this issue Jan 20, 2020 · 1 comment

Comments

@SerEpicPanda
Copy link

SerEpicPanda commented Jan 20, 2020

The Ps3Data example doesn't compile as the check for the controller being connected line is wrong.
I have modified the code as shown below and it works fine.

#include <Ps3Controller.h>

void setup()
{
    Serial.begin(115200);
    Ps3.begin("01:02:03:04:05:06");
    Serial.println("Ready.");
}

void loop()
{
    if(Ps3.isConnected()){

        if( Ps3.data.button.cross ){
            Serial.println("Pressing the cross button");
        }

        if( Ps3.data.button.square ){
            Serial.println("Pressing the square button");
        }

        if( Ps3.data.button.triangle ){
            Serial.println("Pressing the triangle button");
        }

        if( Ps3.data.button.circle ){
            Serial.println("Pressing the circle button");
        }

    }
}
jvpernis added a commit that referenced this issue Jan 25, 2020
…ecause of an error in copy and pasting my test code (#9)
@jvpernis
Copy link
Owner

Good catch! I completely missed this while copy and pasting my development code into the example sketches. Whoops!

It has been fixed now, but if you need help with anything else, feel free to open another issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants