瀏覽代碼

Renaming / Refactoring

master
BinHong Lee 7 年之前
父節點
當前提交
e14f03f929
共有 1 個檔案被更改,包括 4 行新增4 行删除
  1. +4
    -4
      main.c

+ 4
- 4
main.c 查看文件

@@ -5,8 +5,8 @@
#include <wiringPiI2C.h>

//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)
{


Loading…
取消
儲存