From e14f03f929bf08ad1af40224b5fb2f38c6944bdd Mon Sep 17 00:00:00 2001 From: BinHong Lee Date: Mon, 17 Apr 2017 08:42:03 -0700 Subject: [PATCH] Renaming / Refactoring --- main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main.c b/main.c index 69d9de3..e5c0bb8 100644 --- a/main.c +++ b/main.c @@ -5,8 +5,8 @@ #include //Preset information about MPU3050 (gyro sensor) -#define MPU3050_I2C (0x69) -#define MPU3050_REG (0x21) +#define GYRO_I2C (0x69) +#define GYRO_REG (0x21) //Preset buzzer WiringPi port #define BUZZER 0 @@ -71,7 +71,7 @@ int main() //Setup ISR (button) and I2C (gyro sensor) int isrSetup = wiringPiISR(BUTTON, INT_EDGE_FALLING, &buttonInterrupt); - int i2cSetup = wiringPiI2CSetup(MPU3050_I2C); + int i2cSetup = wiringPiI2CSetup(GYRO_I2C); //Check if setups are successful if (i2cSetup < 0||isrSetup < 0) @@ -96,7 +96,7 @@ int main() while (1) { //Get gyro sensor input - gyroInput = wiringPiI2CReadReg8(i2cSetup, MPU3050_REG); + gyroInput = wiringPiI2CReadReg8(i2cSetup, GYRO_REG); if (gyroInput == 0) {