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 A_NYP_humanoid by
main.cpp
00001 #include "mbed.h" 00002 #include "rtos.h" 00003 00004 #include "accgyro.h" 00005 //Serial pc(USBTX, USBRX); 00006 DigitalOut led2(LED2); 00007 Thread eventthread; 00008 EventQueue eventqueue; 00009 00010 int main() 00011 { 00012 ACCGYRO_init(); 00013 eventthread.start(callback(&eventqueue, &EventQueue::dispatch_forever)); 00014 //ACCGYRO_thread.start(ACCGYRO_init); 00015 //Thread::wait(osWaitForever); 00016 eventqueue.call_every(1000, ACCGYRO_task); 00017 //q.dispatch(); 00018 //eventqueue.call_every(1000,printf,"LSM6DSL [acc/mg]: %6ld\r\n", ACCGYRO_get_gyro_x()); 00019 //q.dispatch(); 00020 00021 00022 while(1) 00023 { 00024 eventqueue.call(printf,"LSM6DSL [acc/mg]: %6ld\r\n", ACCGYRO_get_gyro_x()); 00025 led2 = !led2; 00026 wait(1); 00027 //q.dispatch(); 00028 //q.call(printf, "*\n"); 00029 //printf("*"); 00030 //Thread::wait(1000); 00031 //printf("LSM6DSL [acc/mg]: %6ld\r\n", ACCGYRO_get_gyro_x()); 00032 //printf("LSM6DSL [gyro/mdps]: %6ld, %6ld, %6ld\r\n", axes[0], axes[1], axes[2]); 00033 } 00034 }
Generated on Sat Jul 23 2022 15:31:17 by
1.7.2
