Lab1:LEDControlZigbeXmotehasRed,Yellow,.**ZigbeXLED**LEDinZigbeXUseofLEDInordertocheckwhethercertaindevice’.**()–()-RedLEDOn. ()-RedLEDOFF. ()-()-GreenLEDOn. ()-GreenLEDOFF. ()-()-YellowLEDOn. ()-YellowLEDOFF. ()-YellowLEDtoggling.**LEDsampleprogam**ponentnamed“Blink”.Forconfigurationandmodule,&:\Programfiles\UCB\cygwin\opt\tinyos‐\contrib\zigbex\Blink\&**,LedSc,{}implementation{ componentsMain,BlinkM,LedsC; ‐>; ‐>LedsC; }**(1)moduleBlinkM{ provides{ interfaceStdControl; } uses{ interfaceLeds; }}implementation{ taskvoidled_task(); (){ (); ESS; }-declaredby“provide”interfaceand“uses”interfaceInimplementationblockisforuserprogrammingtask(functionw/oparameter):declarationStdControlinit(),start(),stop()sequence.-()()toinitializeLedsC.**((){ postled_task(); ESS; } (){ ESS; } taskvoidled_task(){ inti; for(i=0;i<10;i++){ (); TOSH_uwait(30000); (); } }}(),()(),definedby“task”led_task()iscalledby“post”header.-Nospecificimplemet
Lab1LEDControl 来自淘豆网www.taodocs.com转载请标明出处.