{"id":255542,"date":"2015-04-19T21:40:02","date_gmt":"2015-04-19T17:40:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=255542"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=255542","title":{"rendered":"\u041f\u0440\u043e\u0448\u0438\u0432\u043a\u0430 \u0434\u043b\u044f \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u0438\u043a\u0438 3D \u0441\u043a\u0430\u043d\u0435\u0440\u0430"},"content":{"rendered":"<p>     \t\u042f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u044e, \u0430 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435\u0439 \u043d\u0430\u0432\u0435\u0440\u043d\u043e\u0435 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u044e \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0441\u0430\u043c\u043e\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e 3D \u0441\u043a\u0430\u043d\u0435\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u044b\u043b \u043e\u043f\u0438\u0441\u0430\u043d \u0432 <a href=\"http:\/\/habrahabr.ru\/post\/247423\/\">\u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435<\/a>. \u0412\u043e\u043e\u0431\u0449\u0435 \u043f\u043e\u0447\u0442\u0438 \u0434\u0432\u0430 \u0433\u043e\u0434\u0430 \u043d\u0430\u0437\u0430\u0434, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u043b\u0438 \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0435\u043a\u0442, \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0441\u043a\u0430\u043d\u0435\u0440\u043e\u0432 \u0431\u044b\u043b\u043e \u043d\u0435 \u0442\u0430\u043a \u043c\u043d\u043e\u0433\u043e, \u043a\u0430\u043a \u0441\u0435\u0433\u043e\u0434\u043d\u044f. \u0422\u0430\u043a \u0447\u0442\u043e \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043c\u0435\u0445\u0430\u043d\u0438\u043a\u0443 \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430 (\u043e\u043d\u0430 \u0443 \u0432\u0441\u0435\u0445 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0441\u043a\u0430\u043d\u0435\u0440\u043e\u0432 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u0430), \u0430 \u0441\u043e\u0444\u0442\u0432\u0430\u0440\u043d\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u043f\u0438\u0441\u0430\u043b \u043d\u0435 \u044f. \u0410 \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u0435\u0449\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043c\u043e\u0447\u044c \u0442\u0435\u043c, \u043a\u0442\u043e \u0432\u0441\u0435-\u0436\u0435 \u0440\u0435\u0448\u0438\u0442 \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u0441\u043a\u0430\u043d\u0435\u0440 \u0441\u0430\u043c. \u0414\u043b\u044f \u043d\u0438\u0445 \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f.<br \/>  <a name=\"habracut\"><\/a> <\/p>\n<h4>\u041e \u0447\u0435\u043c<\/h4>\n<p>  \u0422\u0443\u0442 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043a\u0430\u0440\u0442\u0438\u043d\u043e\u043a, \u0441\u0445\u0435\u043c \u0438\u043b\u0438 \u0434\u0430\u0436\u0435 \u043a\u043e\u0442\u0438\u043a\u043e\u0432. \u0425\u043e\u0442\u044f \u043d\u0435\u0442. \u0411\u0443\u0434\u0443\u0442.<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/ec5\/179\/d61\/ec5179d61a80de461877d9492063b04d.jpg\" alt=\"image\"\/><\/p>\n<p>  \u0410 \u0432\u0441\u0435 \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0434\u0430\u043b\u044c\u0448\u0435 \u0431\u0443\u0434\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u0434. \u0417\u0434\u0435\u0441\u044c \u044f \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0447\u0435\u0442\u0432\u0435\u0440\u0442\u043e\u0433\u043e \u0441\u043a\u0430\u043d\u0435\u0440\u0430, \u0438\u0431\u043e \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0430 \u0442\u0440\u0435\u0442\u044c\u0435\u0433\u043e \u0441\u043a\u0430\u043d\u0435\u0440\u0430 \u0443\u0442\u0435\u0440\u044f\u043d\u0430 (\u0438\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u0441\u043b\u0443\u0447\u0430\u044f \u044f \u0438 \u0441\u0442\u0430\u043b \u0434\u0435\u043b\u0430\u0442\u044c \u0431\u044d\u043a\u0430\u043f\u044b). <a href=\"http:\/\/habrahabr.ru\/post\/255371\/\">\u041a\u0430\u043a \u0432\u044b \u043d\u0430\u0432\u0435\u0440\u043d\u043e\u0435 \u043f\u043e\u043c\u043d\u0438\u0442\u0435<\/a> \u043d\u0430 \u043f\u043b\u0430\u0442\u0435 \u0434\u043b\u044f \u0447\u0435\u0442\u0432\u0435\u0440\u0442\u043e\u0433\u043e \u0441\u043a\u0430\u043d\u0435\u0440\u0430 \u0441\u0442\u043e\u0438\u0442 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 STM32F401RE, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0434\u043b\u044f \u0441\u0435\u043c\u0435\u0439\u0441\u0442\u0432\u0430 F4 \u0438 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u043a\u043e\u0434. <\/p>\n<h4>\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/h4>\n<p>  \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/b><\/p>\n<div class=\"spoiler_text\">#include \u00abstm32f4xx.h\u00bb<br \/>  #include \u00abstm32f4xx_exti.h\u00bb<br \/>  #include \u00abstm32f4xx_gpio.h\u00bb<br \/>  #include \u00abstm32f4xx_rcc.h\u00bb<br \/>  #include \u00abstm32f4xx_tim.h\u00bb<br \/>  #include \u00abstm32f4xx_usart.h\u00bb<br \/>  #include \u00abmisc.h\u00bb  <\/div>\n<\/div>\n<p>  \u0418\u0437 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u043e\u043d\u0438 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0435 \u0434\u043b\u044f \u0432\u0441\u0435\u0433\u043e \u0441\u0435\u043c\u0435\u0439\u0441\u0442\u0432\u0430 STM32F4 (\u0430 \u0437\u043d\u0430\u0447\u0438\u0442 \u043a\u043e\u0434 \u0431\u0435\u0437 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043d\u0430 \u043b\u044e\u0431\u043e\u0439 \u0434\u0440\u0443\u0433\u043e\u0439 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u044d\u0442\u043e\u0433\u043e \u0441\u0435\u043c\u0435\u0439\u0441\u0442\u0432\u0430. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043d\u0430 STM32F407VB). \u0412\u0442\u043e\u0440\u043e\u0435, \u0447\u0442\u043e \u0432\u0438\u0434\u043d\u043e \u0438\u0437 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0439 \u2014 \u044d\u0442\u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u0435\u0440\u0438\u0444\u0435\u0440\u0438\u0438, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u044d\u0442\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043d\u0443\u0436\u043d\u044b. \u041e\u0441\u043e\u0431\u043d\u044f\u043a\u043e\u043c \u0441\u0442\u043e\u0438\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 misc.h. \u042d\u0442\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043d\u0443\u0436\u043d\u0430 \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0439.<\/p>\n<h4>\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0435\u0440\u0438\u0444\u0435\u0440\u0438\u0438 \u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445<\/h4>\n<p>  \u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435<\/b><\/p>\n<div class=\"spoiler_text\">int Step;<br \/>  int DelayTime=100000;<br \/>  char ConfigState;<br \/>  uint8_t StepsPerComand=1;<br \/>  uint8_t LaserPower = 0;<br \/>  uint8_t LightPower = 0;  <\/div>\n<\/div>\n<p>  \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f Step \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u043d\u0430 \u043a\u0430\u043a\u043e\u043c \u0448\u0430\u0433\u0435 \u0441\u0435\u0439\u0447\u0430\u0441 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043c\u043e\u0442\u043e\u0440. DelayTime \u0437\u0430\u0434\u0430\u0435\u0442 \u0432\u0440\u0435\u043c\u044f \u043c\u0435\u0436\u0434\u0443 \u0448\u0430\u0433\u0430\u043c\u0438. \u042d\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043c\u043e\u0442\u043e\u0440 \u0443\u0441\u043f\u0435\u0432\u0430\u043b \u043f\u0440\u043e\u043a\u0440\u0443\u0442\u0438\u0442\u044c \u0432\u0430\u043b. \u0417\u0430\u0434\u0430\u0435\u0442\u0441\u044f \u0432 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 \u0442\u0430\u043a\u0442\u043e\u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430. \u041f\u0440\u043e ConfigState \u0438 StepsPerComand \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043f\u043e\u043f\u043e\u0437\u0436\u0435. LaserPower \u0438 LightPower \u0437\u0430\u0434\u0430\u044e\u0442 \u043c\u043e\u0449\u043d\u043e\u0441\u0442\u044c \u043b\u0430\u0437\u0435\u0440\u0430 \u0438 \u043f\u043e\u0434\u0441\u0432\u0435\u0442\u043a\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e (\u043f\u043e\u0434\u0441\u0432\u0435\u0442\u043a\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u043d\u0435 \u0431\u044b\u043b\u0430, \u043d\u043e \u0428\u0418\u041c \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f).<br \/>  \u0413\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043d\u0430 \u044d\u0442\u043e\u043c \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u0438\u0441\u044c. \u041f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0440\u043e\u043f\u0438\u0448\u0435\u043c \u0432\u043e\u0442 \u0442\u0430\u043a\u0443\u044e \u043d\u0435\u0437\u0430\u043c\u044b\u0441\u043b\u043e\u0432\u0430\u0442\u0443\u044e, \u043d\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">Delay<\/b><\/p>\n<div class=\"spoiler_text\">void Delay (uint32_t n)<br \/>  {<br \/>   uint32_t i;<br \/>   for (i=0;i&lt;n;i++) {}<br \/>  }  <\/div>\n<\/div>\n<p>  \u0414\u0443\u043c\u0430\u044e \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u0438\u0437\u043b\u0438\u0448\u043d\u0438. \u0414\u0430\u043b\u0435\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0438\u043d\u043e\u0432, \u043a \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d \u043c\u043e\u0442\u043e\u0440. \u0423 \u043c\u0435\u043d\u044f \u044d\u0442\u043e A5, A6, A7 \u0438 B6:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0438\u043d\u044b \u043c\u043e\u0442\u043e\u0440\u0430<\/b><\/p>\n<div class=\"spoiler_text\">void InitMotorGPIO (void)<br \/>  {<br \/>   GPIO_InitTypeDef MotorGPIO;<\/p>\n<p>  RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOA, ENABLE);<br \/>   RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOB, ENABLE);<\/p>\n<p>  MotorGPIO.GPIO_Pin = GPIO_Pin_5|GPIO_Pin_6|GPIO_Pin_7;<br \/>   MotorGPIO.GPIO_Mode = GPIO_Mode_OUT;<br \/>   MotorGPIO.GPIO_OType = GPIO_OType_PP;<br \/>   MotorGPIO.GPIO_PuPd = GPIO_PuPd_DOWN;<br \/>   MotorGPIO.GPIO_Speed = GPIO_Speed_2MHz;<br \/>   GPIO_Init(GPIOA, &#038;MotorGPIO);<\/p>\n<p>  MotorGPIO.GPIO_Pin = GPIO_Pin_6;<br \/>   GPIO_Init(GPIOB, &#038;MotorGPIO);<br \/>  }  <\/div>\n<\/div>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u043c\u043e\u0442\u043e\u0440\u043e\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0435\u0441\u0442\u044c \u0432\u043e\u0442 \u0442\u0430\u043a\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043c\u043e\u0442\u043e\u0440\u043e\u043c<\/b><\/p>\n<div class=\"spoiler_text\">void MotorResetGPIO (void)<br \/>  {<br \/>   GPIO_ResetBits(GPIOA, GPIO_Pin_5|GPIO_Pin_6|GPIO_Pin_7);<br \/>   GPIO_ResetBits(GPIOB, GPIO_Pin_6);<br \/>  }<\/p>\n<p>  void MotorCoil (int coil)<br \/>  {<br \/>   MotorResetGPIO();<br \/>   switch (coil)<br \/>   {<br \/>   case 1: GPIO_SetBits(GPIOA, GPIO_Pin_5); break;<br \/>   case 2: GPIO_SetBits(GPIOA, GPIO_Pin_6); break;<br \/>   case 3: GPIO_SetBits(GPIOA, GPIO_Pin_7); break;<br \/>   case 4: GPIO_SetBits(GPIOB, GPIO_Pin_6); break;<br \/>   }<br \/>  }<\/p>\n<p>  void MotorStepUP (int n)<br \/>  {<br \/>   int i;<br \/>   for (i=0;i&lt;n;i++)<br \/>   {<br \/>   Step++;<br \/>   if (Step&gt;4) {Step=1;}<br \/>   MotorCoil(Step);<br \/>   Delay (DelayTime);<br \/>   }<br \/>  }<\/p>\n<p>  void MotorStepDOWN (int n)<br \/>  {<br \/>   int i;<br \/>   for (i=0;i&lt;n;i++)<br \/>   {<br \/>   Step&#8212;;<br \/>   if (Step&lt;1) {Step=4;}<br \/>   MotorCoil(Step);<br \/>   Delay(DelayTime);<br \/>   }<br \/>  }  <\/div>\n<\/div>\n<p>  \u0424\u0443\u043d\u043a\u0446\u0438\u044f MotorResetGPIO \u0441\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u0442 \u0432 0 \u0432\u0441\u0435 \u043f\u0438\u043d\u044b \u043c\u043e\u0442\u043e\u0440\u0430. \u042d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 MotorCoil. \u042d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043b\u043e\u0433. 1 \u043d\u0430 \u043e\u0434\u0438\u043d \u0438\u0437 \u043f\u0438\u043d\u043e\u0432 \u043c\u043e\u0442\u043e\u0440\u0430. \u0422\u0430\u043a \u043a\u0430\u043a \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u043f\u0438\u043d\u0443 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043a\u0430\u0442\u0443\u0448\u043a\u0430 \u0448\u0430\u0433\u043e\u0432\u043e\u0433\u043e \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u044f, \u0442\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043c\u044b \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u043e\u0434\u043d\u0443 \u0438\u0437 \u043a\u0430\u0442\u0443\u0448\u0435\u043a. \u0415\u0441\u043b\u0438 \u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u0432 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435 (\u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u0432 \u044d\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043e\u043d \u0438 \u0437\u0430\u0434\u0430\u0435\u0442\u0441\u044f), \u0442\u043e \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u044c \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0432\u0435\u0440\u0448\u0430\u0442\u044c \u0448\u0430\u0433\u0438.<br \/>  \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u0434\u0432\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 (MotorStepUP \u0438 MotorStepDOWN) \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0442 \u043d\u0430 \u0432\u0445\u043e\u0434 \u0447\u0438\u0441\u043b\u043e \u2014 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0448\u0430\u0433\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0434\u043e \u0441\u043e\u0432\u0435\u0440\u0448\u0438\u0442\u044c.<br \/>  \u041f\u043e\u0441\u043b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u043c\u043e\u0442\u043e\u0440\u0430 \u043c\u044b \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c USART:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0441\u043f\u043e\u0439\u043b\u0435\u0440\u0430<\/b><\/p>\n<div class=\"spoiler_text\">void InitUsartGPIO (void)<br \/>  {<br \/>   GPIO_InitTypeDef UsartGPIO;<\/p>\n<p>  RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOA, ENABLE);<\/p>\n<p>  GPIO_PinAFConfig(GPIOA, GPIO_PinSource2, GPIO_AF_USART2);<br \/>   GPIO_PinAFConfig(GPIOA, GPIO_PinSource3, GPIO_AF_USART2);<\/p>\n<p>  UsartGPIO.GPIO_OType = GPIO_OType_PP;<br \/>   UsartGPIO.GPIO_PuPd = GPIO_PuPd_UP;<br \/>   UsartGPIO.GPIO_Mode = GPIO_Mode_AF;<br \/>   UsartGPIO.GPIO_Pin = GPIO_Pin_2|GPIO_Pin_3;<br \/>   UsartGPIO.GPIO_Speed = GPIO_Speed_50MHz;<br \/>   GPIO_Init(GPIOA, &#038;UsartGPIO);<br \/>  }<\/p>\n<p>  void InitUsart (void)<br \/>  {<br \/>   InitUsartGPIO();<\/p>\n<p>  USART_InitTypeDef USART_InitStructure;<\/p>\n<p>  RCC_APB1PeriphClockCmd(RCC_APB1Periph_USART2, ENABLE);<\/p>\n<p>  USART_InitStructure.USART_BaudRate = 9600;<br \/>   USART_InitStructure.USART_WordLength = USART_WordLength_8b;<br \/>   USART_InitStructure.USART_StopBits = USART_StopBits_1;<br \/>   USART_InitStructure.USART_Parity = USART_Parity_No;<br \/>   USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;<br \/>   USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx;<br \/>   USART_Init(USART2, &#038;USART_InitStructure);<br \/>   USART_Cmd(USART2, ENABLE);<\/p>\n<p>  NVIC_InitTypeDef UsartNVIC;<\/p>\n<p>  UsartNVIC.NVIC_IRQChannel = USART2_IRQn;<br \/>   UsartNVIC.NVIC_IRQChannelPreemptionPriority = 2;<br \/>   UsartNVIC.NVIC_IRQChannelSubPriority = 2;<br \/>   UsartNVIC.NVIC_IRQChannelCmd = ENABLE;<br \/>   NVIC_Init(&#038;UsartNVIC);<\/p>\n<p>  USART_ITConfig(USART2, USART_IT_RXNE, ENABLE);<br \/>  }  <\/div>\n<\/div>\n<p>  \u041a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0443\u0442 \u0442\u043e\u0436\u0435 \u043e\u0441\u043e\u0431\u043e \u043d\u0435\u0447\u0435\u0433\u043e. A2 \u2014 Rx, A3 \u2014 Tx. \u0421\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u2014 9600 \u0431\u043e\u0434. \u0420\u0430\u0437\u0432\u0435 \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 9 \u0441\u0442\u0440\u043e\u0447\u0435\u043a. \u0422\u0430\u043c \u043c\u044b \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0435. \u041e\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0442\u044c \u043f\u0440\u0438 \u043f\u0440\u0438\u0435\u043c\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e USART\u0443.<br \/>  \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0431\u043b\u043e\u043a \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u2014 \u044d\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043b\u0430\u0437\u0435\u0440\u043e\u043c \u0438 \u043f\u043e\u0434\u0441\u0432\u0435\u0442\u043a\u043e\u0439. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0442\u0430\u0439\u043c\u0435\u0440 \u0438 \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0428\u0418\u041c \u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0449\u0438\u0435 \u043d\u0430\u0441 \u043d\u043e\u0433\u0438 (\u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430):  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0442\u0430\u0439\u043c\u0435\u0440\u0430<\/b><\/p>\n<div class=\"spoiler_text\">void InitLaserGPIO (void)<br \/>  {<br \/>   GPIO_InitTypeDef LaserGPIO;<br \/>   RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOC, ENABLE);<br \/>   GPIO_PinAFConfig(GPIOC, GPIO_PinSource7, GPIO_AF_TIM3);<\/p>\n<p>  LaserGPIO.GPIO_Mode = GPIO_Mode_AF;<br \/>   LaserGPIO.GPIO_OType = GPIO_OType_PP;<br \/>   LaserGPIO.GPIO_Pin = GPIO_Pin_7;<br \/>   LaserGPIO.GPIO_PuPd = GPIO_PuPd_UP;<br \/>   LaserGPIO.GPIO_Speed = GPIO_Speed_100MHz;<br \/>   GPIO_Init (GPIOC, &#038;LaserGPIO);<br \/>  }<\/p>\n<p>  void InitLightGPIO (void)<br \/>  {<br \/>   GPIO_InitTypeDef LightGPIO;<br \/>   GPIO_PinAFConfig(GPIOB, GPIO_PinSource4, GPIO_AF_TIM3);<\/p>\n<p>  RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOB, ENABLE);<br \/>   LightGPIO.GPIO_Mode = GPIO_Mode_AF;<br \/>   LightGPIO.GPIO_OType = GPIO_OType_PP;<br \/>   LightGPIO.GPIO_Pin = GPIO_Pin_4;<br \/>   LightGPIO.GPIO_PuPd = GPIO_PuPd_NOPULL;<br \/>   LightGPIO.GPIO_Speed = GPIO_Speed_100MHz;<br \/>   GPIO_Init(GPIOB, &#038;LightGPIO);<br \/>  }<\/p>\n<p>  void InitLaserAndLight(void)<br \/>  {<br \/>   InitLaserGPIO();<br \/>   InitLightGPIO();<\/p>\n<p>  TIM_TimeBaseInitTypeDef BaseTIM;<\/p>\n<p>  RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM3, ENABLE);<\/p>\n<p>  BaseTIM.TIM_Period=0xFF;<br \/>   BaseTIM.TIM_Prescaler=3;<br \/>   BaseTIM.TIM_CounterMode=TIM_CounterMode_Up;<br \/>   BaseTIM.TIM_ClockDivision=0;<br \/>   TIM_TimeBaseInit(TIM3,&#038;BaseTIM);<\/p>\n<p>  TIM_OCInitTypeDef TimOC;<\/p>\n<p>  TimOC.TIM_OCMode=TIM_OCMode_PWM1;<br \/>   TimOC.TIM_OutputState=TIM_OutputState_Enable;<br \/>   TimOC.TIM_Pulse=0;<br \/>   TimOC.TIM_OCPolarity=TIM_OCPolarity_High;<\/p>\n<p>  TIM_OC1Init(TIM3,&#038;TimOC);<br \/>   TIM_OC1PreloadConfig(TIM3,TIM_OCPreload_Enable);<\/p>\n<p>  TimOC.TIM_OutputState = TIM_OutputState_Enable;<br \/>   TimOC.TIM_Pulse=0;<\/p>\n<p>  TIM_OC2Init(TIM3, &#038;TimOC);<br \/>   TIM_OC2PreloadConfig(TIM3, TIM_OCPreload_Enable);<\/p>\n<p>  TIM_ARRPreloadConfig(TIM3,ENABLE);<br \/>   TIM_Cmd(TIM3, ENABLE);<br \/>  }<\/p>\n<p>  void SetLaserPower (uint8_t p)<br \/>  {<br \/>   TIM3-&gt;CCR2 = p;<br \/>  }<\/p>\n<p>  void SetLightPower (uint8_t p)<br \/>  {<br \/>   TIM3-&gt;CCR1 = p;<br \/>  }  <\/div>\n<\/div>\n<p>  \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c GPIO (C7 \u0434\u043b\u044f \u043b\u0430\u0437\u0435\u0440\u0430 \u0438 B4 \u0434\u043b\u044f \u043f\u043e\u0434\u0441\u0432\u0435\u0442\u043a\u0438). \u0417\u0430\u0442\u0435\u043c \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u0442\u0430\u0439\u043c\u0435\u0440. \u0410 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u0434\u0432\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432\u0435\u0441\u044c\u043c\u0430 \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f.<br \/>  \u041d\u0430 \u044d\u0442\u043e\u043c \u043f\u0435\u0440\u0438\u0444\u0435\u0440\u0438\u044f \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f. \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0442\u043e\u0442\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u044b\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0433\u043e (\u0447\u0442\u043e\u0431 \u043d\u0435 \u0433\u0440\u0435\u043b\u043e\u0441\u044c \u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u043d\u0430\u0434\u043e):  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0422\u043e\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u0432\u044b\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/b><\/p>\n<div class=\"spoiler_text\">void FullReset (void)<br \/>  {<br \/>   MotorResetGPIO();<br \/>   SetLaserPower(0);<br \/>   SetLightPower(0);<br \/>  }  <\/div>\n<\/div>\n<p>  \u041d\u0443 \u0438 \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435 main:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">main<\/b><\/p>\n<div class=\"spoiler_text\">int main(void)<br \/>  {<br \/>   InitMotorGPIO();<br \/>   InitLaserAndLight();<br \/>   InitUsart();<\/p>\n<p>  while(1)<br \/>   {<br \/>   }<br \/>  }  <\/div>\n<\/div>\n<p>  \u0422\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e-\u0442\u043e \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043a\u043e\u0434 \u0432 main, \u043d\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0435? \u042d\u0442\u043e \u0432\u0441\u0435 \u043e\u0442 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0432\u0441\u044f \u0438\u0434\u0435\u0442 \u0432 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f\u0445. \u0412\u0435\u0440\u043d\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u0432 \u043e\u0434\u043d\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u044b \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043b\u0438, \u043a\u043e\u0433\u0434\u0430 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u043b\u0438 USSART. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041d\u0443\u0436\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0435 case!!!<\/b><\/p>\n<div class=\"spoiler_text\">void USART2_IRQHandler (void)<br \/>  {<br \/>   char data;<br \/>   data=USART_ReceiveData(USART2);<br \/>   if (data&lt;10) {ConfigState = 1; MotorStepUP(data);}<br \/>   if (ConfigState){<br \/>   switch (ConfigState){<br \/>   case &#8216;d&#8217;: DelayTime = data; break;<br \/>   case &#8216;p&#8217;: LaserPower = data; SetLaserPower(LaserPower); break;<br \/>   case &#8216;i&#8217;: StepsPerComand = data; break;<br \/>   case &#8216;l&#8217;: LightPower = data; break;<br \/>   }<br \/>   ConfigState = 0;<br \/>   USART_SendData(USART2, &#8216;R&#8217;);<br \/>   }<br \/>   else {<br \/>   switch (data){<br \/>   case &#8216;s&#8217;: MotorStepUP(StepsPerComand); break;<br \/>   case &#8216;n&#8217;: SetLaserPower(LaserPower); break;<br \/>   case &#8216;f&#8217;: SetLaserPower(0); break;<br \/>   case &#8216;r&#8217;: FullReset(); break;<br \/>   case &#8216;b&#8217;: MotorStepDOWN(StepsPerComand); break;<br \/>   case &#8216;h&#8217;: SetLightPower(LightPower); break;<br \/>   case &#8216;u&#8217;: SetLightPower(0); break;<br \/>   default: ConfigState=data;<br \/>   }<br \/>   if (ConfigState) {USART_SendData(USART2, &#8216;#&#8217;);}<br \/>   else {USART_SendData(USART2, &#8216;R&#8217;);}<br \/>   }<br \/>   USART_ReceiveData(USART2);<br \/>   data = 0;<br \/>   USART_ClearITPendingBit(USART2, USART_IT_RXNE);<br \/>  }  <\/div>\n<\/div>\n<p>  \u0420\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0447\u043d\u043e. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0437\u0430\u0432\u0435\u043b\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e data. \u0417\u0430\u0442\u0435\u043c \u0437\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u0432 \u043d\u0435\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0441 USART. \u042d\u043c. \u0410 \u044d\u0442\u043e \u0447\u0442\u043e \u0437\u0430 \u043c\u0430\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0447\u0438\u0441\u043b\u043e 10? \u0410 \u0442\u0443\u0442 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0445\u0438\u0442\u0440\u043e\u0441\u0442\u044c. \u0415\u0441\u043b\u0438 \u0447\u0438\u0441\u043b\u043e (\u043a\u043e\u0434 \u0441\u0438\u043c\u0432\u043e\u043b\u0430) \u043c\u0435\u043d\u044c\u0448\u0435 10, \u0442\u043e \u043c\u043e\u0442\u043e\u0440 \u0441\u043e\u0432\u0435\u0440\u0448\u0438\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0448\u0430\u0433\u043e\u0432, \u0440\u0430\u0432\u043d\u043e\u0435 \u043a\u043e\u0434\u0443 \u0441\u0438\u043c\u0432\u043e\u043b\u0430. \u0414\u0430\u043b\u0435\u0435 \u0438\u0434\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 ConfigState. \u0418 \u0432\u0442\u043e\u0440\u043e\u0439 \u0440\u0430\u0437 \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u043c \u044d\u0442\u0443 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e, \u0430 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0442\u043e, \u0447\u0442\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0432 else. \u0417\u0434\u0435\u0441\u044c \u043d\u0430\u0431\u043e\u0440 \u043a\u043e\u043c\u0430\u043d\u0434:<br \/>  s \u2014 \u0441\u0434\u0435\u043b\u0430\u0442\u044c StepsPerComand \u0448\u0430\u0433\u043e\u0432 \u0432\u043f\u0435\u0440\u0435\u0434 (\u044d\u0442\u043e \u0442\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u044b \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u043b\u0438 \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u0441\u0442\u0430\u0442\u044c\u0438).<br \/>  n \u2014 \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043b\u0430\u0437\u0435\u0440 (\u043c\u043e\u0449\u043d\u043e\u0441\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u043d\u0430 \u0432 LaserPower).<br \/>  f \u2014 \u0432\u044b\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043b\u0430\u0437\u0435\u0440<br \/>  r \u2014 \u0422\u041e\u0422\u0410\u041b\u042c\u041d\u041e\u0415 \u0412\u042b\u041a\u041b\u042e\u0427\u0415\u041d\u0418\u0415 (\u044d\u0445, \u0445\u043e\u0440\u043e\u0448\u043e \u0437\u0432\u0443\u0447\u0438\u0442).<br \/>  b \u2014 \u0441\u0434\u0435\u043b\u0430\u0442\u044c StepsPerComand \u0448\u0430\u0433\u043e\u0432 \u043d\u0430\u0437\u0430\u0434.<br \/>  h \u2014 \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043f\u043e\u0434\u0441\u0432\u0435\u0442\u043a\u0443 (\u043c\u043e\u0449\u043d\u043e\u0441\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u043d\u0430 \u0432 LightPower).<br \/>  u \u2014 \u0432\u044b\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043f\u043e\u0434\u0441\u0432\u0435\u0442\u043a\u0443.<br \/>  \u0415\u0441\u043b\u0438 \u0436\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u043d\u0435 \u043f\u043e\u0434\u043e\u0448\u043b\u0430 \u043d\u0438 \u043f\u043e\u0434 \u043e\u0434\u043d\u043e \u0438\u0437 \u0443\u0441\u043b\u043e\u0432\u0438\u0439 \u0432\u044b\u0448\u0435, \u0442\u043e \u0441\u0438\u043c\u0432\u043e\u043b \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e ConfigState. \u0412\u0435\u0440\u043d\u0435\u043c\u0441\u044f \u0442\u0435\u043f\u0435\u0440\u044c \u0441\u043d\u043e\u0432\u0430 \u043a \u0443\u0441\u043b\u043e\u0432\u0438\u044e \u0432 4\u0439 \u0441\u0442\u0440\u043e\u0447\u043a\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u0415\u0441\u043b\u0438 ConfigState \u043d\u0435 0, \u0442\u043e \u043c\u044b \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440. \u0417\u0430\u0434\u0430\u0435\u043c \u043d\u043e\u0432\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435. \u0415\u0441\u043b\u0438 \u043f\u0440\u0438\u0448\u043b\u043e d, \u0442\u043e \u043c\u044b \u0437\u0430\u0434\u0430\u0435\u043c \u043d\u043e\u0432\u043e\u0435 DelayTime, \u0435\u0441\u043b\u0438 p, \u0442\u043e \u043d\u043e\u0432\u0443\u044e \u043c\u043e\u0449\u043d\u043e\u0441\u0442\u044c \u043b\u0430\u0437\u0435\u0440\u0430 (\u043f\u0440\u0438\u0447\u0435\u043c \u044d\u0442\u0430 \u043c\u043e\u0449\u043d\u043e\u0441\u0442\u044c \u0441\u0440\u0430\u0437\u0443 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043b\u0430\u0437\u0435\u0440\u0435, \u0442.\u0435. \u043e\u043d \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f), \u0435\u0441\u043b\u0438 \u043f\u0440\u0438\u0448\u043b\u043e i, \u0442\u043e \u043c\u0435\u043d\u044f\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e StepsPerComand, \u043d\u0443 \u0430 \u0435\u0441\u043b\u0438 l, \u0442\u043e \u043c\u0435\u043d\u044f\u0435\u043c \u043c\u043e\u0449\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0434\u0441\u0432\u0435\u0442\u043a\u0438. \u041f\u0440\u0438\u0447\u0435\u043c \u043a\u043e\u0433\u0434\u0430 \u0447\u0442\u043e-\u0442\u043e \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 ConfigState, \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u043f\u043e\u0441\u044b\u043b\u0430\u0435\u0442 \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b &#8216;#&#8217;, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u043e\u043d \u0436\u0434\u0435\u0442 \u0432\u0442\u043e\u0440\u043e\u0439 \u0441\u0438\u043c\u0432\u043e\u043b. \u0415\u0441\u043b\u0438 \u0436\u0435 \u043e\u043d \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043b \u043a\u043e\u043c\u0430\u043d\u0434\u0443, \u0442\u043e \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u043e\u0442\u0432\u0435\u0442 &#8216;R&#8217;. <br \/>  \u0412 \u043a\u043e\u043d\u0446\u0435 \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0447\u0438\u0449\u0430\u0435\u043c \u0431\u0443\u0444\u0435\u0440 \u043f\u0440\u0438\u0435\u043c\u0430 \u0438 \u0441\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u043c \u0444\u043b\u0430\u0433 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u044f.<br \/>  \u041d\u0430 \u044d\u0442\u043e\u043c \u043a\u043e\u0434 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f.<\/p>\n<h4>\u0424\u0438\u043d\u0430\u043b<\/h4>\n<p>  \u0412\u043e\u0442 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0438 \u0432\u0441\u0435. \u041d\u0430\u0434\u0435\u044e\u0441\u044c \u044d\u0442\u043e\u0442 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0442\u0435\u043c, \u043a\u0442\u043e \u0440\u0435\u0448\u0438\u0442 \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c \u043c\u043e\u0439 \u043e\u043f\u044b\u0442 (\u0438\u043b\u0438 \u043a\u043e\u0433\u043e \u0437\u0430\u0441\u0442\u0430\u0432\u044f\u0442 \u043f\u0440\u0435\u043f\u043e\u0434\u044b). \u042f \u043d\u0435 \u043f\u0440\u0435\u0442\u0435\u043d\u0434\u0443\u044e \u043d\u0430 \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u0438\u043b\u0438 \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0432\u0441\u0435 \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e. \u041a\u043e\u043d\u0435\u0447\u043d\u043e \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u0435\u0441\u0442\u044c \u0442\u043e, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043b\u0443\u0447\u0448\u0435. \u0422\u0430\u043a \u0447\u0442\u043e \u043b\u0443\u0447\u0448\u0435 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0442\u044c, \u043d\u043e \u0438 \u0441\u0430\u043c\u0438\u043c \u0434\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c\/\u0434\u043e\u043f\u0430\u0438\u0432\u0430\u0442\u044c.<br \/>  \u0423\u0434\u0430\u0447\u0438 \u0432\u0441\u0435\u043c \u0432 \u0438\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430\u0445 \u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445! \u041d\u0430\u0434\u0435\u044e\u0441\u044c \u044d\u0442\u043e \u0445\u043e\u0442\u044c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043a\u043e\u043c\u0443-\u043d\u0438\u0431\u0443\u0434\u044c \u043f\u043e\u043c\u043e\u0436\u0435\u0442.     \t<\/p>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/256103\/\"> http:\/\/habrahabr.ru\/post\/256103\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>     \t\u042f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u044e, \u0430 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435\u0439 \u043d\u0430\u0432\u0435\u0440\u043d\u043e\u0435 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u044e \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0441\u0430\u043c\u043e\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e 3D \u0441\u043a\u0430\u043d\u0435\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u044b\u043b \u043e\u043f\u0438\u0441\u0430\u043d \u0432 <a href=\"http:\/\/habrahabr.ru\/post\/247423\/\">\u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435<\/a>. \u0412\u043e\u043e\u0431\u0449\u0435 \u043f\u043e\u0447\u0442\u0438 \u0434\u0432\u0430 \u0433\u043e\u0434\u0430 \u043d\u0430\u0437\u0430\u0434, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u043b\u0438 \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0435\u043a\u0442, \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0441\u043a\u0430\u043d\u0435\u0440\u043e\u0432 \u0431\u044b\u043b\u043e \u043d\u0435 \u0442\u0430\u043a \u043c\u043d\u043e\u0433\u043e, \u043a\u0430\u043a \u0441\u0435\u0433\u043e\u0434\u043d\u044f. \u0422\u0430\u043a \u0447\u0442\u043e \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043c\u0435\u0445\u0430\u043d\u0438\u043a\u0443 \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430 (\u043e\u043d\u0430 \u0443 \u0432\u0441\u0435\u0445 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0441\u043a\u0430\u043d\u0435\u0440\u043e\u0432 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u0430), \u0430 \u0441\u043e\u0444\u0442\u0432\u0430\u0440\u043d\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u043f\u0438\u0441\u0430\u043b \u043d\u0435 \u044f. \u0410 \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u0435\u0449\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043c\u043e\u0447\u044c \u0442\u0435\u043c, \u043a\u0442\u043e \u0432\u0441\u0435-\u0436\u0435 \u0440\u0435\u0448\u0438\u0442 \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u0441\u043a\u0430\u043d\u0435\u0440 \u0441\u0430\u043c. \u0414\u043b\u044f \u043d\u0438\u0445 \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-255542","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/255542","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=255542"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/255542\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=255542"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=255542"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=255542"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}