Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
MPU.h
00001 #ifndef MBED_MPU_H 00002 #define MBED_MPU_H 00003 00004 #include "mbed.h" 00005 00006 #define ADDRESS (0x68<<1)//iako je adresa 7 bitna mora biti shiftana za jedno mjesto u lijevo 00007 #define WHO_AM_I_REG 0x75// vraća adresu 00008 #define PWR_MGMT_1_REG 0x6B// podešavanje power mode i izvora sata 00009 #define CONFIG_REG 0x1A//konfiguracija 00010 #define GYRO_CONFIG_REG 0x1B//konfiguracija žiroskopa 00011 #define ACCELERO_CONFIG_REG 0x1C//konfiguracija akcelerometra 00012 #define GYRO_XOUT_H_REG 0x43 00013 #define ACCEL_XOUT_H_REG 0x3B 00014 #define TEMP_H_REG 0x41 00015 00016 class Senzor{ 00017 public: 00018 Senzor(PinName Sda, PinName Scl); 00019 char testConnection (); 00020 void setBW (char command); 00021 void setPowerManagement (char command); 00022 void GYRO_CONFIG(char command); 00023 void ACCEL_CONFIG(char command); 00024 void getAccel(float *accel); 00025 void getGyro(float *gyro); 00026 void getAccAngle(float *angle); 00027 void getOffset(float *accOffset, float *gyroOffset, int sample); 00028 void finalAngle (float *angle); 00029 float getTemp(); 00030 00031 private: 00032 I2C mpu; 00033 00034 }; 00035 #endif
Generated on Wed Jul 13 2022 08:57:40 by
1.7.2