please publish my library

Fork of accelerometer by Aisyah Syahana

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Accelerometer.h Source File

Accelerometer.h

00001 #ifndef ACCELEROMETER_H
00002 #define ACCELEROMETER_H
00003 
00004 #include "mbed.h"
00005 
00006 class Accel  {
00007 public:
00008     /** create a accelerometer Object
00009      *
00010      * @param xpin analogin pin to connect to for x axis
00011      * @param ypin analogin pin to connect to for y axis
00012      * @param zpin analogin pin to connect to for z axis**/
00013      
00014  Accel(PinName xpin, PinName ypin, PinName zpin);
00015  float readx();
00016     /** read analog value from pin y axis
00017     * @param Percent voltage/ref voltage- full range (0.0 - 1.0)
00018      */
00019     float ready();
00020     /** read analog value from pin z axis
00021      *
00022      * @param Percent voltage/ref voltage- full range (0.0 - 1.0)
00023      */
00024     float readz();
00025     /** read analog value from all pins xy&z
00026      *
00027      * @param Percent voltage/ref voltage- full range (0.0 - 1.0)
00028      */
00029      float readall();
00030      
00031 private :
00032     AnalogIn _zpin;
00033     AnalogIn _ypin;
00034     AnalogIn _xpin;
00035     
00036  };
00037  #endif        
00038       
00039