{"id":304574,"date":"2020-05-31T15:00:28","date_gmt":"2020-05-31T15:00:28","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=304574"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=304574","title":{"rendered":"\u041a\u043e\u043b\u0445\u043e\u0437\u0438\u043c \u043c\u0435\u0442\u0435\u043e\u0441\u0442\u0430\u043d\u0446\u0438\u044e \u043d\u0430 STM32 (Bluepill, STM32IDE, HAL)"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/503798\/\">\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440!<br \/>  \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0445\u043e\u0447\u0443 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e \u0441\u0432\u043e\u0435\u0439 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u043e\u0434\u0435\u043b\u043a\u0435 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u0440\u0430\u043d\u0442\u0438\u043d\u0430 \u2013 \u043c\u0435\u0442\u0435\u043e\u0441\u0442\u0430\u043d\u0446\u0438\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 STM32 (\u043f\u043b\u0430\u0442\u0430 bluepill).<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/j9\/bt\/4i\/j9bt4ido1rsdjomtelic-lyiw0s.jpeg\"><\/p>\n<p>  \u0417\u0430\u0440\u0430\u043d\u0435\u0435 \u0443\u0442\u043e\u0447\u043d\u044e, \u0447\u0442\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u0441\u043e\u0431\u0438\u0440\u0430\u043b\u043e\u0441\u044c \u0441\u043a\u043e\u0440\u0435\u0435 \u0438\u0437 \u0436\u0435\u043b\u0430\u043d\u0438\u044f \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u0441\u043e\u0431\u0440\u0430\u0442\u044c, \u043d\u0435\u0436\u0435\u043b\u0438 \u0447\u0435\u043c \u0438\u0437 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043c\u0435\u0442\u0435\u043e\u0441\u0442\u0430\u043d\u0446\u0438\u044e. \u0418 \u0443\u0436\u0435 \u043f\u043e\u0441\u043b\u0435 \u0441\u0431\u043e\u0440\u043a\u0438 \u043c\u0435\u0442\u0435\u043e\u0441\u0442\u0430\u043d\u0446\u0438\u0438 \u043f\u043e\u044f\u0432\u0438\u043b\u043e\u0441\u044c \u043d\u0435\u043f\u0440\u0435\u043e\u0434\u043e\u043b\u0438\u043c\u043e\u0435 \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u0442\u044c \u0435\u0435 \u0441\u043a\u0443\u0434\u043d\u044b\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0438 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0435\u043b\u0430\u0442\u044c. <br \/>  <a name=\"habracut\"><\/a><br \/>  \u041f\u0440\u0438\u043d\u0446\u0438\u043f\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u0445\u0435\u043c\u0430 \u043c\u0435\u0442\u0435\u043e\u0441\u0442\u0430\u043d\u0446\u0438\u0438: <br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ry\/et\/o_\/ryeto_94wuvhnlx6yikzvirevmk.jpeg\"><\/p>\n<p>  \u0412 \u043c\u0435\u0442\u0435\u043e\u0441\u0442\u0430\u043d\u0446\u0438\u0438 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0434\u0432\u0430 \u0434\u0430\u0442\u0447\u0438\u043a\u0430 \u2013 \u0410\u041c\u04221001 \u0438 BMP-180 (\u043f\u043b\u0430\u0442\u0430 GY-68). \u041f\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u0432\u0441\u0435 \u044d\u0442\u043e \u043e\u0442 \u043e\u0434\u043d\u043e\u0431\u0430\u043d\u043e\u0447\u043d\u043e\u0433\u043e Lipo \u0430\u043a\u043a\u0443\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u0430 \u0447\u0435\u0440\u0435\u0437 \u043f\u043e\u0432\u044b\u0448\u0430\u044e\u0449\u0438\u0439 \u0434\u043e 5\u0412 DC-DC \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c. \u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0441 \u0434\u0430\u0442\u0447\u0438\u043a\u043e\u0432 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043d\u0430 \u0434\u0438\u0441\u043f\u043b\u0435\u0439 2004. \u0412\u044b\u0432\u043e\u0434\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/2x\/vh\/_g\/2xvh_gys6fymljc1abmjzpymk_k.jpeg\"><br \/>  <b>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0434\u0430\u0442\u0447\u0438\u043a\u0430 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b \u0438 \u0432\u043b\u0430\u0436\u043d\u043e\u0441\u0442\u0438 AMT1001<\/b><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/al\/br\/ii\/albriijdtppbopoj08sigqfy7ug.jpeg\"><\/p>\n<p>  \u0412\u044b\u0432\u043e\u0434\u044b \u0434\u0430\u0442\u0447\u0438\u043a\u0430:<br \/>  \u041a\u0440\u0430\u0441\u043d\u044b\u0439 \u2014 VDD (4.75 \u2013 5.25 \u0412)<br \/>  \u0427\u0435\u0440\u043d\u044b\u0439 \u2013 GND<br \/>  \u0416\u0435\u043b\u0442\u044b\u0439 \u2013 \u0432\u044b\u0445\u043e\u0434 \u0434\u0430\u0442\u0447\u0438\u043a\u0430 \u0432\u043b\u0430\u0436\u043d\u043e\u0441\u0442\u0438<br \/>  \u0411\u0435\u043b\u044b\u0439 \u2013 \u0442\u0435\u0440\u043c\u0438\u0441\u0442\u043e\u0440<br \/>  \u0421\u0447\u0438\u0442\u044b\u0432\u0430\u044f \u043d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u0432\u044b\u0432\u043e\u0434\u0430\u0445 \u0434\u0430\u0442\u0447\u0438\u043a\u0430, \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0443 \u0438 \u0432\u043b\u0430\u0436\u043d\u043e\u0441\u0442\u044c, \u0441\u043e\u043e\u0442\u043d\u0435\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u044f \u0441 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u043c\u0438 \u0438\u0437 datasheet. \u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u0432\u043b\u0430\u0436\u043d\u043e\u0441\u0442\u0438: <\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/tw\/lj\/bm\/twljbm3bvh9kxhuqn-ahcwvkld0.jpeg\"><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/kc\/1_\/oy\/kc1_oyyqohmyssgky6f8drw60ro.jpeg\"><\/p>\n<p>  \u041f\u043e \u0433\u0440\u0430\u0444\u0438\u043a\u0443 \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u043c\u0435\u0436\u0434\u0443 \u0432\u043b\u0430\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u0438 \u043d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u0435\u043c \u043b\u0438\u043d\u0435\u0439\u043d\u0430\u044f, \u0430 \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0410\u0426\u041f \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432\u043b\u0430\u0436\u043d\u043e\u0441\u0442\u0438. \u041e\u0431\u043e\u0437\u043d\u0430\u0447\u0438\u043c:<br \/>  ADC_hum \u2013 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441 \u0410\u0426\u041f;<br \/>  hum \u2013 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432\u043b\u0430\u0436\u043d\u043e\u0441\u0442\u0438 (\u0432 %);<br \/>  V_hum \u2013 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u044f \u043d\u0430 \u0434\u0430\u0442\u0447\u0438\u043a\u0435.<br \/>   V_hum = 3.3 \u0412 (\u043e\u043f\u043e\u0440\u043d\u043e\u0435 \u043d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u0435 \u0410\u0426\u041f) * ADC_hum \/ 4095 (\u043a\u043e\u043b-\u0432\u043e \u0440\u0430\u0437\u0440\u044f\u0434\u043e\u0432 \u0410\u0426\u041f).<br \/>  1 % \u0432\u043b\u0430\u0436\u043d\u043e\u0441\u0442\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 0.3\/10 = 0.03 \u0412, \u0442\u043e <br \/>  hum = V_hum \/ 0.03 = ADC_hum * 0.027<br \/>  \u0421 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f\u043c\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043b\u0438\u0441\u044c, \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u043a\u043e\u0434\u0443. \u0414\u0430\u0442\u0447\u0438\u043a \u0432\u043b\u0430\u0436\u043d\u043e\u0441\u0442\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d \u043a PA4 (ADC1).  <\/p>\n<pre><code class=\"cpp\">float hum; uint16_t ADC_hum;  HAL_ADC_Start(&amp;hadc1);                              \/\/ \u0437\u0430\u043f\u0443\u0441\u043a \u0410\u0426\u041f HAL_ADC_PollForConversion(&amp;hadc1,100);              \/\/ \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f ADC_hum = HAL_ADC_GetValue(&amp;hadc1);                 \/\/ \u0437\u0430\u043f\u0438\u0441\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e HAL_ADC_Stop(&amp;hadc1);                               \/\/ \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0410\u0426\u041f  hum = ADC_hum; hum *= 0.027;  <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0442\u0435\u0440\u043c\u0438\u0441\u0442\u043e\u0440 \u2014 \u0440\u0435\u0437\u0438\u0441\u0442\u043e\u0440, \u0441\u043e\u043f\u0440\u043e\u0442\u0438\u0432\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043e\u0442 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0410\u0426\u041f \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u0440\u0438\u0442\u044c \u043d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0435, \u043d\u043e \u043d\u0435 \u0435\u0433\u043e \u0441\u043e\u043f\u0440\u043e\u0442\u0438\u0432\u043b\u0435\u043d\u0438\u0435. \u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0442\u0435\u0440\u043c\u0438\u0441\u0442\u043e\u0440\u043e\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0440\u0435\u0437\u0438\u0441\u0442\u043e\u0440 \u043d\u0430 10 \u043a\u041e\u043c \u043c\u0435\u0436\u0434\u0443 \u0432\u044b\u0432\u043e\u0434\u043e\u043c \u0442\u0435\u0440\u043c\u0438\u0441\u0442\u043e\u0440\u0430 (\u0431\u0435\u043b\u044b\u0439 \u043f\u0440\u043e\u0432\u043e\u0434) \u0438 \u0437\u0435\u043c\u043b\u0435\u0439. \u0412 \u0438\u0442\u043e\u0433\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c \u043d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u044f (\u0442\u0435\u0440\u043c\u0438\u0441\u0442\u043e\u0440 \u0432\u043d\u0443\u0442\u0440\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d \u043a VCC): <\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/bu\/0f\/2m\/bu0f2mgymys8dsp4yfpb05jj74o.jpeg\"><\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0437\u043c\u0435\u0440\u0438\u0442\u044c \u0441\u043e\u043f\u0440\u043e\u0442\u0438\u0432\u043b\u0435\u043d\u0438\u0435 \u0442\u0435\u0440\u043c\u0438\u0441\u0442\u043e\u0440\u0430, \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0432\u0448\u0438\u0441\u044c \u043f\u0435\u0440\u0432\u044b\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u043e\u043c \u041a\u0438\u0440\u0445\u0433\u043e\u0444\u0430 \u2013 \u0441\u0443\u043c\u043c\u0430 \u0442\u043e\u043a\u043e\u0432 \u0432 \u0443\u0437\u043b\u0435 \u0440\u0430\u0432\u043d\u0430 0. \u0412\u0441\u043f\u043e\u043c\u043d\u0438\u0432 \u0448\u043a\u043e\u043b\u044c\u043d\u044b\u0439 \u043a\u0443\u0440\u0441 \u0444\u0438\u0437\u0438\u043a\u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u043c:<br \/>  Untc\/ Rntc = U1\/R1<br \/>  \u0412\u044b\u0432\u043e\u0434\u043e\u043c \u0420\u04105 \u043c\u044b \u0438\u0437\u043c\u0435\u0440\u044f\u0435\u043c \u043d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u0440\u0435\u0437\u0438\u0441\u0442\u043e\u0440\u0435 10\u043a. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 \u0442\u0435\u0440\u043c\u0438\u0441\u0442\u043e\u0440\u043e\u043c, \u0435\u0433\u043e \u0441\u043e\u043f\u0440\u043e\u0442\u0438\u0432\u043b\u0435\u043d\u0438\u0435 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0435 \u043f\u0440\u043e\u043f\u043e\u0440\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044e \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b, \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0430 \u043e\u0433\u0440\u043e\u043c\u043d\u0430\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441\u043e\u043f\u0440\u043e\u0442\u0438\u0432\u043b\u0435\u043d\u0438\u0439 \u0442\u0440\u0430\u043d\u0437\u0438\u0441\u0442\u043e\u0440\u0430 \u043f\u0440\u0438 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0435 \u043e\u0442 -40 \u0434\u043e +125. \u0412\u0441\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u0442\u044c \u0432 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u0442\u0430 \u0435\u0449\u0435 \u0437\u0430\u0434\u0430\u0447\u0430, \u044f \u0432\u0437\u044f\u043b \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d \u043e\u0442 10 \u0434\u043e 30 \u0433\u0440\u0430\u0434\u0443\u0441\u043e\u0432 (21 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435). <br \/>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0443 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441\u043e\u043f\u0440\u043e\u0442\u0438\u0432\u043b\u0435\u043d\u0438\u044f, \u044f \u0441\u0434\u0435\u043b\u0430\u043b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u0432 Mathcad. \u041f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u044f \u043f\u0435\u0440\u0435\u0432\u0435\u043b \u0432 \u043c\u0430\u0441\u0441\u0438\u0432:   <\/p>\n<pre><code class=\"cpp\">int out_temp[21] ={2200, 2255,\t2315, 2377, 2433, 2497, 2558, 2618, 2680, 2741, 2801, 2862, 2923, 2983, 3041, 3102, 3166, 3215, 3283, 3336, 3396};<\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0410\u0426\u041f \u043f\u043e\u043a\u0430\u0436\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0431\u043b\u0438\u0437\u043a\u043e\u0435 \u043a \u043f\u0435\u0440\u0432\u043e\u043c\u0443 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0443 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u2013 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0430 10 \u0433\u0440\u0430\u0434\u0443\u0441\u043e\u0432, \u0435\u0441\u043b\u0438 \u043a\u043e \u0432\u0442\u043e\u0440\u043e\u043c\u0443 \u2013 11, \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435, \u0434\u043e 30 \u0433\u0440\u0430\u0434\u0443\u0441\u043e\u0432. \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0434\u0435\u0441\u044f\u0442\u044b\u0445 \u0434\u043e\u043b\u0435\u0439 \u0433\u0440\u0430\u0434\u0443\u0441\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c, \u043d\u043e \u043c\u043e\u0436\u043d\u043e \u044d\u0442\u043e\u0433\u043e \u0438 \u043d\u0435 \u0434\u0435\u043b\u0430\u0442\u044c. \u041d\u0438\u0436\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442 \u0434\u0435\u0441\u044f\u0442\u044b\u0435 (\u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e\u0435 \u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435), \u0445\u043e\u0442\u044f \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044f \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0440\u0430\u0437\u0431\u0440\u043e\u0441 \u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0434\u0435\u0441\u044f\u0442\u044b\u0435 \u0434\u043e\u043b\u0438 \u043d\u0435 \u0441\u0442\u043e\u0438\u0442.  <\/p>\n<pre><code class=\"cpp\">float temp; uint16_t ADC_temp; HAL_ADC_Start(&amp;hadc2);                        \/\/ \u0437\u0430\u043f\u0443\u0441\u043a \u0410\u0426\u041f 2 HAL_ADC_PollForConversion(&amp;hadc2,100);        \/\/ \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f ADC_temp = HAL_ADC_GetValue(&amp;hadc2);          \/\/ \u0437\u0430\u043f\u0438\u0441\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e HAL_ADC_Stop(&amp;hadc1);                         \/\/ \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0410\u0426\u041f  for (int i=0; i&lt;21; i++) { \tif (ADC_temp &lt; out_temp[i+1] &amp;&amp; ADC_temp &gt; out_temp[i] ) \t{ \t\tint x = ADC_temp - out_temp[i]; \t\tint xx = out_temp[i+1] - out_temp[i]; \t\ttemp = x; \t\ttemp = temp\/xx+i+10;                 break; \t} } <\/code><\/pre>\n<p>  \u0414\u0430\u043b\u044c\u0448\u0435 \u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043b \u0434\u0430\u0442\u0447\u0438\u043a \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b \u0438 \u0430\u0442\u043c\u043e\u0441\u0444\u0435\u0440\u043d\u043e\u0433\u043e \u0434\u0430\u0432\u043b\u0435\u043d\u0438\u044f GY- 68 (BMP180). \u041a\u0430\u043a \u0441 \u043d\u0438\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043e\u043f\u0438\u0441\u0430\u043d\u043e <a href=\"https:\/\/habr.com\/ru\/post\/259709\/\">\u0442\u0443\u0442<\/a>, \u043a\u043e\u0434 \u044f \u0431\u0440\u0430\u043b \u043e\u0442\u0442\u0443\u0434\u0430 \u0436\u0435.<br \/>  \u0414\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0434\u0438\u0441\u043f\u043b\u0435\u0439 2004 \u0441 I2C \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u043e\u043c (\u043f\u0440\u043e \u043d\u0435\u0433\u043e \u043f\u0438\u0441\u0430\u043b <a href=\"https:\/\/habr.com\/ru\/post\/501006\/\">\u0442\u0443\u0442<\/a>)<br \/>  \u0421\u043e\u0435\u0434\u0438\u043d\u0438\u043b \u0432\u0441\u0435 \u044d\u0442\u043e \u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u2013 \u043d\u0430\u043f\u0430\u044f\u043b \u0432\u0441\u0435 \u043d\u0430 \u043c\u0430\u043a\u0435\u0442\u043a\u0443, \u0432\u043e\u0442\u043a\u043d\u0443\u043b \u0432\u044b\u043a\u043b\u044e\u0447\u0430\u0442\u0435\u043b\u044c \u0432 \u0440\u0430\u0437\u0440\u044b\u0432 \u043f\u0438\u0442\u0430\u043d\u0438\u044f. \u0414\u0430\u0442\u0447\u0438\u043a\u0438 \u0438 \u0434\u0438\u0441\u043f\u043b\u0435\u0439 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u044e\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u043e\u0431\u044b\u0447\u043d\u0443\u044e \u0433\u0440\u0435\u0431\u0435\u043d\u043a\u0443. \u0414\u0430\u0442\u0447\u0438\u043a\u0438 \u0441\u0434\u0435\u043b\u0430\u043b \u0432\u044b\u043d\u043e\u0441\u043d\u044b\u043c\u0438, \u0442\u0430\u043a \u043a\u0430\u043a \u0431\u044b\u043b\u0430 \u0438\u0434\u0435\u044f \u0432\u044b\u043d\u0443\u0442\u044c \u0438\u0445 \u0437\u0430 \u043e\u043a\u043d\u043e, \u043d\u043e \u0432 \u0442\u0430\u043a\u043e\u043c \u0432\u0438\u0434\u0435 \u0434\u043e\u0436\u0434\u044f \u043e\u043d\u0438 \u043d\u0435 \u043f\u0435\u0440\u0435\u0436\u0438\u0432\u0443\u0442.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/kx\/-e\/g-\/kx-eg-vg5xa9n4ej2hzt1aoe2da.jpeg\"><\/p>\n<p>  \u0412\u043e\u0442 \u0442\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0434\u0430\u0442\u0447\u0438\u043a: <\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ih\/ga\/8t\/ihga8tvqbinuyyyzgha6pcb0yt4.jpeg\"><\/p>\n<p>  \u041a\u043e\u0440\u043f\u0443\u0441 \u043f\u0435\u0447\u0430\u0442\u0430\u043b \u043d\u0430 3\u0434 \u043f\u0440\u0438\u043d\u0442\u0435\u0440\u0435 \u0431\u0435\u043b\u044b\u043c ABS (\u043e\u043d \u0445\u043e\u0440\u043e\u0448\u043e \u0448\u043b\u0438\u0444\u0443\u0435\u0442\u0441\u044f \u0438 \u043d\u0430 \u0431\u0435\u043b\u043e\u043c \u0446\u0432\u0435\u0442\u0435 \u043c\u0435\u043d\u044c\u0448\u0435 \u0432\u0438\u0434\u043d\u0430 \u0441\u043b\u043e\u0438\u0441\u0442\u043e\u0441\u0442\u044c).<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/d_\/qn\/bn\/d_qnbn8acbjw98zviq2hqktf1s4.jpeg\"><\/p>\n<p>  \u0412\u0441\u0435 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u044b \u0432\u044b\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u044e <a href=\"https:\/\/github.com\/FamNuven\/STM32-meteorological-station\" rel=\"nofollow\">\u0441\u044e\u0434\u0430<\/a><\/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=\"https:\/\/habr.com\/ru\/post\/503798\/\"> https:\/\/habr.com\/ru\/post\/503798\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/503798\/\">\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440!<br \/>  \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0445\u043e\u0447\u0443 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e \u0441\u0432\u043e\u0435\u0439 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u043e\u0434\u0435\u043b\u043a\u0435 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u0440\u0430\u043d\u0442\u0438\u043d\u0430 \u2013 \u043c\u0435\u0442\u0435\u043e\u0441\u0442\u0430\u043d\u0446\u0438\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 STM32 (\u043f\u043b\u0430\u0442\u0430 bluepill).<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/j9\/bt\/4i\/j9bt4ido1rsdjomtelic-lyiw0s.jpeg\"><\/p>\n<p>  \u0417\u0430\u0440\u0430\u043d\u0435\u0435 \u0443\u0442\u043e\u0447\u043d\u044e, \u0447\u0442\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u0441\u043e\u0431\u0438\u0440\u0430\u043b\u043e\u0441\u044c \u0441\u043a\u043e\u0440\u0435\u0435 \u0438\u0437 \u0436\u0435\u043b\u0430\u043d\u0438\u044f \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u0441\u043e\u0431\u0440\u0430\u0442\u044c, \u043d\u0435\u0436\u0435\u043b\u0438 \u0447\u0435\u043c \u0438\u0437 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043c\u0435\u0442\u0435\u043e\u0441\u0442\u0430\u043d\u0446\u0438\u044e. \u0418 \u0443\u0436\u0435 \u043f\u043e\u0441\u043b\u0435 \u0441\u0431\u043e\u0440\u043a\u0438 \u043c\u0435\u0442\u0435\u043e\u0441\u0442\u0430\u043d\u0446\u0438\u0438 \u043f\u043e\u044f\u0432\u0438\u043b\u043e\u0441\u044c \u043d\u0435\u043f\u0440\u0435\u043e\u0434\u043e\u043b\u0438\u043c\u043e\u0435 \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u0442\u044c \u0435\u0435 \u0441\u043a\u0443\u0434\u043d\u044b\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0438 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0435\u043b\u0430\u0442\u044c.   <\/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-304574","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/304574","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=304574"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/304574\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=304574"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=304574"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=304574"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}