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.
ActionEncoder.hpp
00001 /* 00002 * ActionEncoder.hpp 00003 * 00004 * Created on: 7 Mar 2018 00005 * Author: tung 00006 */ 00007 00008 #ifndef INCLUDE_ACTIONENCODER_HPP_ 00009 #define INCLUDE_ACTIONENCODER_HPP_ 00010 00011 #include <stdint.h> 00012 //#include <Serial.hpp> 00013 00014 class ActionEncoder 00015 { 00016 private: 00017 uint8_t count,i,done; 00018 union{ 00019 uint8_t data[24]; 00020 float val[6]; 00021 }posture; 00022 float xangle,yangle,zangle,pos_x,pos_y,angleSpeed,d_angle; 00023 float temp_zangle; 00024 bool newDataArrived; 00025 public: 00026 ActionEncoder(); 00027 void readEncoder(char); 00028 bool updated(); 00029 float getXangle(); 00030 float getYangle(); 00031 float getZangle(); 00032 float getXpos(); 00033 float getYpos(); 00034 float getAngleSpeed(); 00035 char * reset(); 00036 char * calibrate(); 00037 bool isAlive(); 00038 bool newDataAvailable(); 00039 uint32_t LastRead; 00040 00041 }; 00042 00043 00044 00045 00046 00047 00048 00049 #endif /* INCLUDE_ACTIONENCODER_HPP_ */
Generated on Thu Jul 14 2022 02:45:53 by
1.7.2