#include <std.h>#include <limits.h>Go to the source code of this file.
Defines | |
| #define | MAX_VALUE ULONG_MAX |
| #define | OVERFLOW ULONG_MAX |
| #define | PIN_ADXL_UOUT PIN_B4 |
| Pin the u-axis out is connected to, PIN_B4.. | |
| #define | PIN_ADXL_XOUT PIN_B6 |
| Pin the x-axis out is connected to, PIN_B6. | |
| #define | PIN_ADXL_YOUT PIN_B5 |
| Pin the y-axis out is connected to, PIN_B5.. | |
| #define | PIN_ADXL_ZOUT PIN_B3 |
| Pin the z-axis out is connected to, PIN_B3.. | |
Functions | |
| unsigned long | get_accelerationU () |
| unsigned long | get_accelerationX () |
| unsigned long | get_accelerationY () |
| unsigned long | get_accelerationZ () |
| unsigned int | get_accU () |
| unsigned int | get_accX () |
| unsigned int | get_accY () |
| unsigned int | get_accZ () |
|
|
Definition at line 41 of file adxl202je.h. |
|
|
Definition at line 40 of file adxl202je.h. |
|
|
Pin the u-axis out is connected to, PIN_B4..
Definition at line 50 of file adxl202je.h. Referenced by get_accelerationU(). |
|
|
Pin the x-axis out is connected to, PIN_B6.
Definition at line 44 of file adxl202je.h. Referenced by get_accelerationX(). |
|
|
Pin the y-axis out is connected to, PIN_B5..
Definition at line 46 of file adxl202je.h. Referenced by get_accelerationY(). |
|
|
Pin the z-axis out is connected to, PIN_B3..
Definition at line 48 of file adxl202je.h. Referenced by get_accelerationZ(). |
|
|
Definition at line 255 of file adxl202je.h. References PIN_ADXL_UOUT. Referenced by get_accU(). 00256 {
00257 unsigned long x_t1,x_t3,scaledacc,counter;
00258 counter =0;
00259 //restart_wdt();
00260 // wait for adx = low
00261 while( input(PIN_ADXL_UOUT) &&(counter<OVERFLOW) ) {++counter;};
00262 counter =0;
00263 //restart_wdt();
00264 // wait for adx = high
00265 while( !input(PIN_ADXL_UOUT)&&(counter<OVERFLOW) ) {++counter;};
00266 x_t1=0;
00267 //restart_wdt();
00268 // count duration
00269 while( input(PIN_ADXL_UOUT) &&(x_t1 <OVERFLOW) ) {++x_t1;};
00270 x_t3=0;
00271 //restart_wdt();
00272 // count duration
00273 while( !input(PIN_ADXL_UOUT)&&(x_t3 <OVERFLOW) ) {++x_t3;};
00274 if ( (x_t1==OVERFLOW) || (x_t1==OVERFLOW) )
00275 {
00276 return 0;
00277 }
00278 //now scale the results (could be better - but this is small)
00279 x_t3=x_t3+x_t1;
00280 //restart_wdt();
00281 // max return value
00282 counter=MAX_VALUE;
00283 scaledacc=0;
00284 while (counter>x_t3)
00285 {
00286 scaledacc=scaledacc+x_t1;
00287 counter=counter-x_t3;
00288 }
00289 return(scaledacc);
00290 }
|
|
|
Definition at line 128 of file adxl202je.h. References PIN_ADXL_XOUT. Referenced by get_accX(). 00129 {
00130 unsigned long x_t1,x_t3,scaledacc,counter;
00131 float val;
00132 counter =0;
00133 //restart_wdt();
00134 // wait for adx = low
00135 while( input(PIN_ADXL_XOUT) &&(counter<OVERFLOW) ) {++counter;};
00136 counter =0;
00137 //restart_wdt();
00138 // wait for adx = high
00139 while( !input(PIN_ADXL_XOUT)&&(counter<OVERFLOW) ) {++counter;};
00140 x_t1=0;
00141 //restart_wdt();
00142 // count duration
00143 while( input(PIN_ADXL_XOUT) &&(x_t1 <OVERFLOW) ) {++x_t1;};
00144 x_t3=0;
00145 //restart_wdt();
00146 // count duration
00147 while( !input(PIN_ADXL_XOUT)&&(x_t3 <OVERFLOW) ) {++x_t3;};
00148 if ( (x_t1==OVERFLOW) || (x_t1==OVERFLOW) )
00149 {
00150 return 0;
00151 }
00152 //now scale the results (could be better - but this is small)
00154 x_t3=x_t3+x_t1;
00155 val = (((float)x_t1 / (float)x_t3)-0.5);
00157 // max return value
00158 counter=MAX_VALUE;
00159 scaledacc=0;
00160 //restart_wdt();
00161 while (counter>x_t3)
00162 {
00163 scaledacc=scaledacc+x_t1;
00164 counter=counter-x_t3;
00165 }
00166 return(scaledacc);
00167 }
|
|
|
Definition at line 173 of file adxl202je.h. References PIN_ADXL_YOUT. Referenced by get_accY(). 00174 {
00175 unsigned long x_t1,x_t3,scaledacc,counter;
00176 counter =0;
00177 //restart_wdt();
00178 // wait for adx = low
00179 while( input(PIN_ADXL_YOUT) &&(counter<OVERFLOW) ) {++counter;};
00180 counter =0;
00181 //restart_wdt();
00182 // wait for adx = high
00183 while( !input(PIN_ADXL_YOUT)&&(counter<OVERFLOW) ) {++counter;};
00184 x_t1=0;
00185 //restart_wdt();
00186 // count duration
00187 while( input(PIN_ADXL_YOUT) &&(x_t1 <OVERFLOW) ) {++x_t1;};
00188 x_t3=0;
00189 //restart_wdt();
00190 // count duration
00191 while( !input(PIN_ADXL_YOUT)&&(x_t3 <OVERFLOW) ) {++x_t3;};
00192 if ( (x_t1==OVERFLOW) || (x_t1==OVERFLOW) )
00193 {
00194 return 0;
00195 }
00196 //now scale the results (could be better - but this is small)
00197 x_t3=x_t3+x_t1;
00198 //restart_wdt();
00199 // max return value
00200 counter=MAX_VALUE;
00201 scaledacc=0;
00202 while (counter>x_t3)
00203 {
00204 scaledacc=scaledacc+x_t1;
00205 counter=counter-x_t3;
00206 }
00207 return(scaledacc);
00208 }
|
|
|
Definition at line 214 of file adxl202je.h. References PIN_ADXL_ZOUT. Referenced by get_accZ(). 00215 {
00216 unsigned long x_t1,x_t3,scaledacc,counter;
00217 counter =0;
00218 //restart_wdt();
00219 // wait for adx = low
00220 while( input(PIN_ADXL_ZOUT) &&(counter<OVERFLOW) ) {++counter;};
00221 counter =0;
00222 //restart_wdt();
00223 // wait for adx = high
00224 while( !input(PIN_ADXL_ZOUT)&&(counter<OVERFLOW) ) {++counter;};
00225 x_t1=0;
00226 //restart_wdt();
00227 // count duration
00228 while( input(PIN_ADXL_ZOUT) &&(x_t1 <OVERFLOW) ) {++x_t1;};
00229 x_t3=0;
00230 //restart_wdt();
00231 // count duration
00232 while( !input(PIN_ADXL_ZOUT)&&(x_t3 <OVERFLOW) ) {++x_t3;};
00233 if ( (x_t1==OVERFLOW) || (x_t1==OVERFLOW) )
00234 {
00235 return 0;
00236 }
00237 //now scale the results (could be better - but this is small)
00238 x_t3=x_t3+x_t1;
00239 //restart_wdt();
00240 // max return value
00241 counter=MAX_VALUE;
00242 scaledacc=0;
00243 while (counter>x_t3)
00244 {
00245 scaledacc=scaledacc+x_t1;
00246 counter=counter-x_t3;
00247 }
00248 return(scaledacc);
00249 }
|
|
|
Definition at line 115 of file adxl202je.h. References get_accelerationU(). 00116 {
00117 unsigned long a;
00118 unsigned int as;
00119 a=get_accelerationU();
00120 as = make8(a,1);
00121 return as;
00122 }
|
|
|
Definition at line 76 of file adxl202je.h. References get_accelerationX(). 00077 {
00078 unsigned long a;
00079 unsigned int as;
00080 a=get_accelerationX();
00081 as = make8(a,1);
00082 return as;
00083 }
|
|
|
Definition at line 89 of file adxl202je.h. References get_accelerationY(). 00090 {
00091 unsigned long a;
00092 unsigned int as;
00093 a=get_accelerationY();
00094 as = make8(a,1);
00095 return as;
00096 }
|
|
|
Definition at line 102 of file adxl202je.h. References get_accelerationZ(). 00103 {
00104 unsigned long a;
00105 unsigned int as;
00106 a=get_accelerationZ();
00107 as = make8(a,1);
00108 return as;
00109 }
|
1.3.9.1