#include #include "gyroscope.hpp" /* Stops the execution of any more instructions. */ void stop() { while (1) ; } Gyroscope gyroscope; void setup() { Serial.begin(9600); // Wait for Serial because the Arduino Leonardo is weird while (!Serial) ; int gyroscope_id = Gyroscope::initialize(); // Verifiy the gyroscope id if (gyroscope_id == -1) { Serial.println("Error: Failed to communicate with gyroscope component"); stop(); } gyroscope.setup(gyroscope_id); Serial.println("Finished setup"); } void loop() { int16_t x, y, z; gyroscope.readCoordinates(&x, &y, &z); Serial.print("X: "); Serial.print((int)x); Serial.print(" Y: "); Serial.print((int)y); Serial.print(" Z: "); Serial.println((int)z); delay(1000); }