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 HX711 MPU6050 PCF8563
main.cpp
00001 #include "mbed.h" 00002 #include "rtos.h" 00003 00004 00005 Thread thread_HmiRefresh;// 00006 // thread_ExtMeasureRecv, 00007 // thread_HmiRecv, 00008 // thread_HmiRefresh, 00009 // thread_Key, 00010 // thread_Main, 00011 // thread_MotorCtrl, 00012 // thread_Rs485Recv, 00013 // thread_TempCtrl, 00014 // thread_USBRecv, 00015 // thread_WifiRecv; 00016 00017 00018 extern void vExtMeasureRecvTask( ); 00019 extern void vHmiRecvTask( ); 00020 extern void vHmiRefreshTask( ); 00021 extern void vKeyTask( ); 00022 extern void vMainTask( ); 00023 extern void vMotorCtrlTask( ); 00024 extern void vRs485RecvTask( ); 00025 extern void vTempCtrlTask( ); 00026 extern void vUSBRecvTask( ); 00027 extern void vWifiRecvTask( ); 00028 00029 int main() 00030 { 00031 // thread_ExtMeasureRecv.start(vExtMeasureRecvTask); 00032 // thread_HmiRecv.start(vHmiRecvTask); 00033 thread_HmiRefresh.start(vHmiRefreshTask); 00034 // thread_Key.start(vKeyTask); 00035 // thread_Main.start(vMainTask); 00036 // thread_MotorCtrl.start(vMotorCtrlTask); 00037 // thread_Rs485Recv.start(vRs485RecvTask); 00038 // thread_TempCtrl.start(vTempCtrlTask); 00039 // thread_USBRecv.start(vUSBRecvTask); 00040 // thread_WifiRecv.start(vWifiRecvTask); 00041 00042 00043 while (true) { 00044 00045 Thread::wait(500); 00046 } 00047 } 00048 00049 00050 00051 //#include "mbed.h" 00052 //#include "rtos.h" 00053 //#include "HX711.h" 00054 //#include "ADXL345_I2C.h" 00055 //#include "MPU6050.h" 00056 //#include "PCF8563.h" 00057 // 00058 //Serial usart2(USBTX,USBRX); 00059 //DigitalOut led1(PB_15); 00060 //HX711 hx711(PC_0,PC_1); 00061 //ADXL345_I2C adxl(PB_7, PB_6); 00062 //MPU6050 mpu6050; 00063 //PCF8563 pcf8563(PB_7,PB_6); 00064 //InterruptIn rtcInt(PC_15); 00065 // 00066 //int interrupt=0; 00067 //void timeInt() 00068 //{ 00069 // interrupt=1; 00070 //} 00071 // 00072 //void print_thread(void const *argument) 00073 //{ 00074 // while (true) { 00075 // Thread::wait(500); 00076 // usart2.printf("hx711 %ld \r\n",hx711.getValue()); 00077 //// usart2.printf("mpu6050 %d \r\n",mpu6050.getAccelerationX()); 00078 // // usart2.printf("adxl %d \r\n",adxl.getDevId()); 00079 //// time_t seconds=pcf8563.now(); 00080 //// usart2.printf("pcf8563 %s \r\n",ctime(&seconds)); 00081 // if(interrupt) 00082 // { 00083 // usart2.printf("pcf856 "); 00084 // interrupt=0; 00085 // } 00086 // } 00087 //} 00088 // 00089 //int main() 00090 //{ 00091 // mpu6050.initialize(); 00092 // rtcInt.fall(&timeInt); 00093 // Thread thread(print_thread, NULL, osPriorityNormal, DEFAULT_STACK_SIZE); 00094 // while (true) { 00095 // led1 = !led1; 00096 // Thread::wait(500); 00097 // } 00098 //}
Generated on Wed Jul 20 2022 22:14:06 by
1.7.2