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.
Revision 0:274ec880d172, committed 2018-06-27
- Comitter:
- animesh44
- Date:
- Wed Jun 27 04:28:59 2018 +0000
- Commit message:
- A simple program that changes the brightness of the red led according to the value of X - axis from MMA8451Q accelerometer.
Changed in this revision
diff -r 000000000000 -r 274ec880d172 MMA8451Q.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MMA8451Q.lib Wed Jun 27 04:28:59 2018 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/emilmont/code/MMA8451Q/#c4d879a39775
diff -r 000000000000 -r 274ec880d172 main.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Wed Jun 27 04:28:59 2018 +0000
@@ -0,0 +1,12 @@
+#include "mbed.h"
+#include "MMA8451Q.h"
+#define MMA8451_I2C_ADDRESS(0X1d<<1)
+
+int main() {
+ MMA8451Q acc(PTE25,PTE24,MMA8451_I2C_Address);
+ PwmOut myled(LED1);
+ while(1) {
+ myled=1-abs(acc.getAccX());
+ wait(0.1);
+ }
+}
diff -r 000000000000 -r 274ec880d172 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Wed Jun 27 04:28:59 2018 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/a7c7b631e539 \ No newline at end of file