From 135ecb444644079983de7123a0fdf0c21fa68a14 Mon Sep 17 00:00:00 2001 From: HampusM Date: Mon, 20 Dec 2021 20:36:51 +0100 Subject: style: fix line endings --- .clang-format | 24 ++++++++-------- .gitignore | 2 +- THIRDPARTY | 2 +- src/gyro.cpp | 92 +++++++++++++++++++++++++++++------------------------------ 4 files changed, 60 insertions(+), 60 deletions(-) diff --git a/.clang-format b/.clang-format index 5facbda..4491708 100644 --- a/.clang-format +++ b/.clang-format @@ -1,12 +1,12 @@ -BasedOnStyle: LLVM -UseTab: Always -IndentWidth: 4 -TabWidth: 4 -AllowShortBlocksOnASingleLine: Empty -BreakBeforeBraces: Allman -AllowShortIfStatementsOnASingleLine: false -IndentCaseLabels: false -ColumnLimit: 0 -AccessModifierOffset: -4 -NamespaceIndentation: All -FixNamespaceComments: false +BasedOnStyle: LLVM +UseTab: Always +IndentWidth: 4 +TabWidth: 4 +AllowShortBlocksOnASingleLine: Empty +BreakBeforeBraces: Allman +AllowShortIfStatementsOnASingleLine: false +IndentCaseLabels: false +ColumnLimit: 0 +AccessModifierOffset: -4 +NamespaceIndentation: All +FixNamespaceComments: false diff --git a/.gitignore b/.gitignore index 1899660..5acb669 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ build -.vscode \ No newline at end of file +.vscode diff --git a/THIRDPARTY b/THIRDPARTY index f108950..b967e1b 100644 --- a/THIRDPARTY +++ b/THIRDPARTY @@ -537,4 +537,4 @@ necessary. Here is a sample; alter the names: That's all there is to it! -========================================================================== \ No newline at end of file +========================================================================== diff --git a/src/gyro.cpp b/src/gyro.cpp index 78498bc..668cef1 100644 --- a/src/gyro.cpp +++ b/src/gyro.cpp @@ -1,46 +1,46 @@ -#include "Arduino.h" -#include "GY521.h" - -GY521 sensor(0x68); - -void setup() -{ - Serial.begin(9600); - - // Wait for Serial because the Arduino Leonardo is weird - while (!Serial) {} - - Wire.begin(); - - delay(100); - while (!sensor.wakeup()) - { - Serial.print(millis()); - Serial.println("Error: Could not connect to the GY521 sensor. Retrying after 2000 milliseconds..."); - delay(2000); - } - sensor.setAccelSensitivity(2); // 8g - sensor.setGyroSensitivity(1); // 500 degrees/s - - sensor.setThrottle(); - Serial.println("start..."); - - // Calibration values - sensor.axe = 0.198; - sensor.aye = -0.018; - sensor.gxe = 0.780; - sensor.gye = -1.495; -} - -void loop() -{ - sensor.read(); - float pitch = sensor.getPitch(); - float roll = sensor.getRoll(); - - Serial.print("Pitch: "); - Serial.print(pitch, 3); - Serial.print(" Roll: "); - Serial.print(roll, 3); - Serial.println(); -} \ No newline at end of file +#include "Arduino.h" +#include "GY521.h" + +GY521 sensor(0x68); + +void setup() +{ + Serial.begin(9600); + + // Wait for Serial because the Arduino Leonardo is weird + while (!Serial) {} + + Wire.begin(); + + delay(100); + while (!sensor.wakeup()) + { + Serial.print(millis()); + Serial.println("Error: Could not connect to the GY521 sensor. Retrying after 2000 milliseconds..."); + delay(2000); + } + sensor.setAccelSensitivity(2); // 8g + sensor.setGyroSensitivity(1); // 500 degrees/s + + sensor.setThrottle(); + Serial.println("start..."); + + // Calibration values + sensor.axe = 0.198; + sensor.aye = -0.018; + sensor.gxe = 0.780; + sensor.gye = -1.495; +} + +void loop() +{ + sensor.read(); + float pitch = sensor.getPitch(); + float roll = sensor.getRoll(); + + Serial.print("Pitch: "); + Serial.print(pitch, 3); + Serial.print(" Roll: "); + Serial.print(roll, 3); + Serial.println(); +} -- cgit v1.2.3-18-g5258