API for the MMA7455 Accelerometer.  
 More...
- ID: mma7455 
 
- Name: MMA7455 Accelerometer Sensor 
 
- Category: accelerometer 
 
- Manufacturer: generic 
 
- Connection: i2c
 
This file defines the MMA7455 interface for libmma7455
 
    
    short x, y, z;
    while (!doWork) {
        sensor->readData(&x, &y, &z);
        std::cout << "Accelerometer X(" << x << ") Y(" << y << ") Z(" << z << ")" << std::endl;
        usleep (100000);
    }
 
 | 
|   | MMA7455 (int bus=0, int devAddr=0x1D) | 
|   | 
|   | ~MMA7455 () | 
|   | 
| std::string  | name () | 
|   | 
| mraa_result_t  | calibrate () | 
|   | 
| mraa_result_t  | readData (short *ptrX, short *ptrY, short *ptrZ) | 
|   | 
| int  | ic2ReadReg (unsigned char reg, unsigned char *buf, unsigned char size) | 
|   | 
| mraa_result_t  | ic2WriteReg (unsigned char reg, unsigned char *buf, unsigned char size) | 
|   | 
      
        
          | MMA7455  | 
          ( | 
          int  | 
          bus = 0,  | 
        
        
           | 
           | 
          int  | 
          devAddr = 0x1D  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Instantiates an MMA7455 object
- Parameters
 - 
  
    | bus | Number of the used bus  | 
    | devAddr | Address of the used I2C device  | 
  
   
 
 
MMA7455 object destructor; basically, it closes the I2C connection. 
 
 
Returns the name of the component 
 
 
      
        
          | mraa_result_t calibrate  | 
          ( | 
          void  | 
           | ) | 
           | 
        
      
 
 
      
        
          | mraa_result_t readData  | 
          ( | 
          short *  | 
          ptrX,  | 
        
        
           | 
           | 
          short *  | 
          ptrY,  | 
        
        
           | 
           | 
          short *  | 
          ptrZ  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Reads X-axis, Y-axis, and Z-axis acceleration data
- Parameters
 - 
  
    | ptrX | X-axis  | 
    | ptrY | Y-axis  | 
    | ptrZ | Z-axis  | 
  
   
 
 
      
        
          | int ic2ReadReg  | 
          ( | 
          unsigned char  | 
          reg,  | 
        
        
           | 
           | 
          unsigned char *  | 
          buf,  | 
        
        
           | 
           | 
          unsigned char  | 
          size  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
- Parameters
 - 
  
    | reg | Register address  | 
    | buf | Register data buffer  | 
    | size | Buffer size  | 
  
   
 
 
      
        
          | mraa_result_t ic2WriteReg  | 
          ( | 
          unsigned char  | 
          reg,  | 
        
        
           | 
           | 
          unsigned char *  | 
          buf,  | 
        
        
           | 
           | 
          unsigned char  | 
          size  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
- Parameters
 - 
  
    | reg | Register address  | 
    | buf | Register data buffer  | 
    | size | Buffer size  | 
  
   
 
 
The documentation for this class was generated from the following files:
- /var/lib/jenkins/workspace/upm-doc-stable/src/mma7455/mma7455.h
 
- /var/lib/jenkins/workspace/upm-doc-stable/src/mma7455/mma7455.cxx