This repository has been archived on 2025-10-20. You can view files and clone it, but cannot push or open issues or pull requests.
Files
2bki21/INF/libraries/PS3_Controller_Host/examples/Ps3Accelerometer/Ps3Accelerometer.ino
danielvici123 b6eafc20e5 irgendwas
2025-01-22 10:10:30 +01:00

32 lines
558 B
C++

#include <Ps3Controller.h>
void notify()
{
Serial.print(Ps3.data.sensor.accelerometer.x);
Serial.print(" ");
Serial.print(Ps3.data.sensor.accelerometer.y);
Serial.print(" ");
Serial.print(Ps3.data.sensor.accelerometer.z);
/* Uncomment the following if you also want
to display the gryoscope data: */
// Serial.print(" ");
// Serial.print(Ps3.data.sensor.gyroscope.z);
Serial.println();
}
void setup()
{
Serial.begin(115200);
Ps3.attach(notify);
Ps3.begin("01:02:03:04:05:06");
}
void loop()
{
}