標(biāo)題: 可穿戴下肢控制研究 簡(jiǎn)單仿真和單片機(jī)程序 [打印本頁(yè)]

作者: heoll    時(shí)間: 2017-5-25 12:40
標(biāo)題: 可穿戴下肢控制研究 簡(jiǎn)單仿真和單片機(jī)程序

可穿戴下肢控制的proteus仿真原理圖如下:



單片機(jī)源程序如下:
  1. #include <reg52.h>

  2. #define uchar unsigned char

  3. #define uint unsigned int

  4. void delay(uchar ms)                //????

  5. {

  6.          uchar ii,jj;

  7.          for(ii=0;ii<ms;ii++)

  8.                  for(jj=0;jj<40;jj++);

  9. }

  10. void leftmove()                   //??

  11. {

  12.         P0=0x11;


  13. }

  14. void rightmove()               

  15. {

  16.         P0=0x24;



  17. }



  18. main()

  19. {

  20.         P0=0;

  21.         while(1)

  22.         {

  23.                 switch(P1)                                       //????

  24.                 {



  25.                         case 0xfe:leftmove();break;

  26.                         case 0xfd:rightmove();break;

  27.                                           
  28.                                           
  29.                                           
  30.                                             case 0xfc:
  31.                                                 {
  32.                          P0=0x35;break;
  33.                                             }
  34.                                                  case 0xff:
  35.                                                 {
  36.                                                 P0=0;break;
  37.                                             }

  38.                 }                                                         

  39.         }        

  40. }


復(fù)制代碼

仿真工程文件下載:
可穿戴下肢控制研究.zip (21.23 KB, 下載次數(shù): 12)







歡迎光臨 (http://www.torrancerestoration.com/bbs/) Powered by Discuz! X3.1