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.
Dependencies: ADXL345_I2C QEI SDFileSystem mbed
Revision 4:1ec5063fb20e, committed 2017-02-07
- Comitter:
- ojityan
- Date:
- Tue Feb 07 19:52:56 2017 +0000
- Parent:
- 3:de6579180af2
- Child:
- 5:473edb6558fa
- Commit message:
- ?????????????
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Tue Feb 07 19:06:35 2017 +0000
+++ b/main.cpp Tue Feb 07 19:52:56 2017 +0000
@@ -38,7 +38,7 @@
Ticker save;
FILE *fp;
Timer t;
-
+int intrrupt_cnt = 0;
static char i2c_addr = 0x80;
@@ -159,6 +159,7 @@
void savedata(void)
{
flag = 1;
+ intrrupt_cnt++;
}
@@ -270,6 +271,7 @@
static double F_1;
static double F_2;
static double F_3;
+ static int intrrupt_checker = 5;
//---reading acceleration and control---
@@ -287,8 +289,15 @@
*duty_output = 1.0;
myled4 = 1;
}
-// duty.write(*duty_output);
- duty.write(1.00);
+
+ if(intrrupt_checker == intrrupt_cnt){
+ *duty_output = *duty_output + 0.05;
+ intrrupt_checker = intrrupt_checker + 5;
+ }
+
+
+ duty.write(*duty_output);
+// duty.write(1.00);
F_3 = F_2;
F_2 = *F;
// debug.printf("%i,%f,%f\n", (int16_t)readings[0],*v,*duty_output);