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 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 SERVO_init(); 00013 ACCGYRO_init(); 00014 eventthread.start(callback(&eventqueue, &EventQueue::dispatch_forever)); 00015 //ACCGYRO_thread.start(ACCGYRO_init); 00016 //Thread::wait(osWaitForever); 00017 //eventqueue.call_every(1000, SERVO_task); 00018 eventqueue.call_every(1000, ACCGYRO_task); 00019 //q.dispatch(); 00020 //eventqueue.call_every(1000,printf,"LSM6DSL [acc/mg]: %6ld\r\n", ACCGYRO_get_gyro_x()); 00021 //q.dispatch(); 00022 00023 00024 while(1) 00025 { 00026 eventqueue.call(printf,"LSM6DSL [acc/mg]: %6ld\r\n", ACCGYRO_get_gyro_x()); 00027 led2 = !led2; 00028 wait(1); 00029 //q.dispatch(); 00030 //q.call(printf, "*\n"); 00031 //printf("*"); 00032 //Thread::wait(1000); 00033 //printf("LSM6DSL [acc/mg]: %6ld\r\n", ACCGYRO_get_gyro_x()); 00034 //printf("LSM6DSL [gyro/mdps]: %6ld, %6ld, %6ld\r\n", axes[0], axes[1], axes[2]); 00035 } 00036 }
Generated on Sat Jul 16 2022 18:16:34 by
1.7.2
