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.
Fork of humanoid by
Diff: main.cpp
- Revision:
- 0:0ea84b3cf851
- Child:
- 2:7d574b1ab3cd
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Mon Apr 30 09:43:36 2018 +0000
@@ -0,0 +1,34 @@
+#include "mbed.h"
+#include "rtos.h"
+
+#include "accgyro.h"
+//Serial pc(USBTX, USBRX);
+DigitalOut led2(LED2);
+Thread eventthread;
+EventQueue eventqueue;
+
+int main()
+{
+ ACCGYRO_init();
+ eventthread.start(callback(&eventqueue, &EventQueue::dispatch_forever));
+ //ACCGYRO_thread.start(ACCGYRO_init);
+ //Thread::wait(osWaitForever);
+ eventqueue.call_every(1000, ACCGYRO_task);
+ //q.dispatch();
+ //eventqueue.call_every(1000,printf,"LSM6DSL [acc/mg]: %6ld\r\n", ACCGYRO_get_gyro_x());
+ //q.dispatch();
+
+
+ while(1)
+ {
+ eventqueue.call(printf,"LSM6DSL [acc/mg]: %6ld\r\n", ACCGYRO_get_gyro_x());
+ led2 = !led2;
+ wait(1);
+ //q.dispatch();
+ //q.call(printf, "*\n");
+ //printf("*");
+ //Thread::wait(1000);
+ //printf("LSM6DSL [acc/mg]: %6ld\r\n", ACCGYRO_get_gyro_x());
+ //printf("LSM6DSL [gyro/mdps]: %6ld, %6ld, %6ld\r\n", axes[0], axes[1], axes[2]);
+ }
+}
\ No newline at end of file
