{"id":271399,"date":"2015-12-30T13:24:04","date_gmt":"2015-12-30T10:24:04","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=271399"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=271399","title":{"rendered":"Bluetooth-\u043c\u0435\u0442\u0435\u043e\u0441\u0442\u0430\u043d\u0446\u0438\u044f \u043d\u0430 Arduino \u0434\u043b\u044f \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0445"},"content":{"rendered":"<p>       \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0435\u0440\u0432\u044b\u0439 \u0448\u0430\u0433 \u0432 \u043c\u0438\u0440 Arduino \u0438 \u0441\u043c\u0430\u0441\u0442\u0435\u0440\u0438\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0443\u044e \u043c\u0435\u0442\u0435\u043e\u0441\u0442\u0430\u043d\u0446\u0438\u044e. \u041c\u0435\u0442\u0435\u043e\u0441\u0442\u0430\u043d\u0446\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0441\u0442\u043e\u044f\u0442\u044c \u0438\u0437 \u0434\u0432\u0443\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439: \u043e\u0434\u0438\u043d \u043c\u043e\u0434\u0443\u043b\u044c \u0431\u0443\u0434\u0435\u0442 \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0441 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u0445 \u0434\u0430\u0442\u0447\u0438\u043a\u043e\u0432, \u0434\u0440\u0443\u0433\u043e\u0439 \u2014 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u0441\u0447\u0438\u0442\u0430\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u044d\u043a\u0440\u0430\u043d. \u0414\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Bluetooth.<\/p>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043f\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 BT-\u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0434\u0440\u0443\u0433 \u0441 \u0434\u0440\u0443\u0433\u043e\u043c.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/e6b\/40d\/c46\/e6b40dc463a644dd8e0ab6c84d1af131.jpg\" alt=\"image\"\/><\/p>\n<p>  \u0418\u0442\u0430\u043a, \u043f\u043e\u0435\u0445\u0430\u043b\u0438!<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h1>\u0421 \u0447\u0435\u0433\u043e \u043d\u0430\u0447\u0430\u0442\u044c?<\/h1>\n<p>  \u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0434\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0447\u0430\u0442\u044c \u0441\u0432\u043e\u0438 \u043f\u0435\u0440\u0432\u044b\u0435 \u043f\u043e\u0434\u0435\u043b\u043a\u0438 \u043d\u0430 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435 Arduino \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043e\u0431\u0448\u0438\u0440\u043d\u044b\u0445 \u0437\u043d\u0430\u043d\u0438\u0439. \u0412\u0441\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u0437 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430, \u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043c\u043e\u0433\u043b\u0438 \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0438\u0435 \u0443\u0440\u043e\u043a\u0438 \u043e\u0442 <a href=\"https:\/\/www.youtube.com\/playlist?list=PLfDmj22jP9S759DT250VVzfZs_4VnJqLa\">Amperka.ru<\/a>. <\/p>\n<h3>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430<\/h3>\n<p>  \u0414\u043b\u044f \u0438\u0437\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f\u043e\u0432 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b:<\/p>\n<ul>\n<li>\u0424\u043e\u0442\u043e\u0440\u0435\u0437\u0438\u0441\u0442\u043e\u0440 500 \u043a\u041e\u043c (x1)<\/li>\n<li>\u0411\u0430\u0440\u043e\u043c\u0435\u0442\u0440 BMP085 (x1)<\/li>\n<li>BT-\u043c\u043e\u0434\u0443\u043b\u044c HC-05 (x2)<\/li>\n<li>LCD \u0434\u0438\u0441\u043f\u043b\u0435\u0439, \u0416\u041a \u044d\u043a\u0440\u0430\u043d LCM 1602 i2c (x1)<\/li>\n<li>\u041d\u0430\u0431\u043e\u0440 \u044d\u043b. \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 (\u043c\u0430\u043a\u0435\u0442\u043d\u0430\u044f \u043f\u043b\u0430\u0442\u0430, \u0440\u0435\u0437\u0438\u0441\u0442\u043e\u0440\u044b, \u0434\u0438\u043e\u0434\u044b) (x1)<\/li>\n<li>Arduino UNO R3 (x2)<\/li>\n<\/ul>\n<p>  \u0414\u043b\u044f \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0438 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u043e\u0434\u043d\u0443\u044e Arduino IDE.<\/p>\n<p>  \u0425\u043e\u0447\u0443 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0445\u043e\u0442\u044f \u0431\u044b \u043e\u0434\u0438\u043d \u043c\u043e\u0434\u0443\u043b\u044c \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c <b>HC-05<\/b> (\u043d\u0435 06!), \u044d\u0442\u043e \u0432\u0430\u0436\u043d\u043e. \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e HC-06 \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0440\u0435\u0436\u0438\u043c <i>master<\/i>, \u0442.\u043e. \u0432\u0437\u044f\u0432 \u043e\u0431\u0430 \u043c\u043e\u0434\u0443\u043b\u044f 06 \u043d\u0430\u043c \u043d\u0435 \u0443\u0434\u0430\u0441\u0442\u0441\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0438\u0445 \u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0443 \u0434\u0440\u0443\u0433 \u0441 \u0434\u0440\u0443\u0433\u043e\u043c. \u042f \u0440\u0435\u0448\u0438\u043b \u0432\u0437\u044f\u0442\u044c \u043e\u0431\u0430 \u043c\u043e\u0434\u0443\u043b\u044f HC-05 \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u043e\u0434\u043d\u043e \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u044c\u044e, \u0435\u0441\u043b\u0438 \u0442\u0430\u043a\u043e\u0432\u044b\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442.<\/p>\n<p>  <i>\u041d\u044e\u0430\u043d\u0441\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 BT-\u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0431\u0443\u0434\u0443\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u043d\u0438\u0436\u0435.<\/i><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/aa9\/472\/906\/aa9472906d8146c196a8323bf4a31d43.jpg\" alt=\"image\"\/><\/p>\n<p>  \u041e\u0431\u0430 \u043c\u043e\u0434\u0443\u043b\u044f \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u044b \u0432 \u0448\u0438\u043b\u0434, \u0442\u043e \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u043a \u043f\u043b\u0430\u0442\u0435 Arduino \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e.<\/p>\n<h1>\u041d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u0441\u0431\u043e\u0440\u043a\u0443<\/h1>\n<p>  <\/p>\n<h3>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0444\u043e\u0442\u043e\u0440\u0435\u0437\u0438\u0441\u0442\u043e\u0440<\/h3>\n<p>  \u0421\u043e\u043f\u0440\u043e\u0442\u0438\u0432\u043b\u0435\u043d\u0438\u0435 \u0444\u043e\u0442\u043e\u0440\u0435\u0437\u0438\u0441\u0442\u043e\u0440\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0441\u0432\u0435\u0442\u0430, \u043f\u043e\u043f\u0430\u0434\u0430\u044e\u0449\u0435\u0433\u043e \u043d\u0430 \u043d\u0435\u0433\u043e. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0444\u043e\u0442\u043e\u0440\u0435\u0437\u0438\u0441\u0442\u043e\u0440 \u0432 \u0441\u0432\u044f\u0437\u043a\u0435 \u0441 \u043e\u0431\u044b\u0447\u043d\u044b\u043c \u0440\u0435\u0437\u0438\u0441\u0442\u043e\u0440\u043e\u043c, \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c \u043d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u044f, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0445\u043e\u0434\u044f\u0449\u0435\u0435 \u0447\u0435\u0440\u0435\u0437 \u0444\u043e\u0442\u043e\u0440\u0435\u0437\u0438\u0441\u0442\u043e\u0440, \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f, \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0443\u0440\u043e\u0432\u043d\u044f \u043e\u0441\u0432\u0435\u0449\u0435\u043d\u043d\u043e\u0441\u0442\u0438. <\/p>\n<p>  \u041c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e\u0442 \u0434\u0430\u0442\u0447\u0438\u043a\u0430 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442: \u0444\u0443\u043d\u043a\u0446\u0438\u044f <i>analogRead(pin_number)<\/i> \u0432\u0435\u0440\u043d\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u0442\u0435\u043f\u0435\u043d\u044c \u043e\u0441\u0432\u0435\u0449\u0435\u043d\u043d\u043e\u0441\u0442\u0438. \u0427\u0443\u0432\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e \u0434\u0430\u0442\u0447\u0438\u043a\u0430 \u043c\u043e\u0436\u043d\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0438\u0433\u0440\u0430\u044f\u0441\u044c \u0441 \u0440\u0435\u0437\u0438\u0441\u0442\u043e\u0440\u0430\u043c\u0438 \u0440\u0430\u0437\u043d\u044b\u0445 \u043d\u043e\u043c\u0438\u043d\u0430\u043b\u043e\u0432; \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, 10\u043a\u041e\u043c \u2014 \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u043d\u043e\u043c\u0438\u043d\u0430\u043b.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/f8d\/a84\/2ab\/f8da842abffe42e7bca7f4096ef5e503.png\" alt=\"image\"\/><\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">int lightPin= 0; \/\/\u043d\u043e\u043c\u0435\u0440 \u0432\u0445\u043e\u0434\u0430, \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d \u0444\u043e\u0442\u043e\u0440\u0435\u0437\u0438\u0441\u0442\u043e\u0440 void setup() { } void loop() {   int light = analogRead(lightPin); } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<h3>\u0414\u0430\u0442\u0447\u0438\u043a \u0434\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b<\/h3>\n<p>  \u0414\u043b\u044f \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b, \u0434\u0430\u0432\u043b\u0435\u043d\u0438\u044f, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0432\u044b\u0441\u043e\u0442\u044b \u043d\u0430\u0434 \u0443\u0440\u043e\u0432\u043d\u0435\u043c \u043c\u043e\u0440\u044f \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u0430\u0440\u043e\u043c\u0435\u0442\u0440 BMP085.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/599\/604\/846\/5996048463184017bcf05ce8d59adadf.jpg\" alt=\"image\"\/><\/p>\n<p>  \u0414\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0434\u0430\u0442\u0447\u0438\u043a\u0430 BMP085 \u043a Arduino \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f 4 \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u0430:<\/p>\n<ul>\n<li>Vcc \u2013 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u043a \u043f\u0438\u0442\u0430\u043d\u0438\u044e +5\u0432<\/li>\n<li>SDA \u2013 SDA \u043d\u0430 \u043f\u043b\u0430\u0442\u0435 Arduino (A4)<\/li>\n<li>SCL \u2013 SCL \u043d\u0430 \u043f\u043b\u0430\u0442\u0435 Arduino (A5)<\/li>\n<li>GND \u2013 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u043a \u0437\u0435\u043c\u043b\u0435<\/li>\n<\/ul>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/4b8\/1ea\/fd2\/4b81eafd233b4ecfbf067084eb197cd5.png\" alt=\"image\"\/><\/p>\n<p>  \u0414\u043b\u044f \u0441\u043d\u044f\u0442\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0441 \u0434\u0430\u0442\u0447\u0438\u043a\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0431\u0438\u043b\u0438\u043e\u0442\u0435\u043a\u0443 Adafruit.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\"> #include &lt;Wire.h&gt; #include &lt;Adafruit_Sensor.h&gt; #include &lt;Adafruit_BMP085_U.h&gt; Adafruit_BMP085_Unified bmp = Adafruit_BMP085_Unified(10085); void setup(void) { \/* Initialise the sensor *\/   if(!bmp.begin())   {     \/* There was a problem detecting the BMP085 ... check your connections *\/     Serial.print(&quot;Ooops, no BMP085 detected ... Check your wiring or I2C ADDR!&quot;);     while(1);   } } void loop(void) {   sensors_event_t event;   bmp.getEvent(&event);   if (event.pressure)   {     float pressure = event.pressure;          float temperature;     bmp.getTemperature(&temperature);      float seaLevelPressure = SENSORS_PRESSURE_SEALEVELHPA;     float altitude = bmp.pressureToAltitude(seaLevelPressure, event.pressure);    } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">Arduino \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u043c\u0438 \u0434\u0430\u0442\u0447\u0438\u043a\u0430\u043c\u0438<\/b><\/p>\n<div class=\"spoiler_text\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/610\/082\/6ce\/6100826ce5ed47ff9a37380c897c7d09.jpg\" alt=\"image\"\/>  <\/div>\n<\/div>\n<p>  <\/p>\n<h3>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0434\u0438\u0441\u043f\u043b\u0435\u044f<\/h3>\n<p>  \u041a\u043e\u043d\u0442\u0430\u043a\u0442\u044b \u0434\u0438\u0441\u043f\u043b\u0435\u044f LCD1602 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u044e\u0442\u0441\u044f \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e, \u043a\u0430\u043a \u0438 \u0434\u043b\u044f BMP085:<\/p>\n<ul>\n<li>\u0416\u041a SDA -&gt; Arduino SDA (A4)<\/li>\n<li>\u0416\u041a SCL -&gt; Arduino SCL (\u04105)<\/li>\n<li>\u0416\u041a GND -&gt; Arduino GND<\/li>\n<li>\u0416\u041a VCC -&gt; Arduino 5V<\/li>\n<\/ul>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/ba1\/b2b\/bdf\/ba1b2bbdf7fe4cc786d58565ad096152.JPG\" alt=\"image\"\/><\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">\/* \u0412 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 LCD \u044d\u043a\u0440\u0430\u043d\u0430 1602. *\/   #include &lt;Wire.h&gt; #include &lt;LiquidCrystal_I2C.h&gt;   LiquidCrystal_I2C lcd(0x27,16,2); \/\/ \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b: \u0410\u0434\u0440\u0435\u0441 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430, \u0440\u0430\u0437\u043c\u0435\u0440 \u044d\u043a\u0440\u0430\u043d\u0430   void setup() {     lcd.init();     \/\/ \u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f lcd     lcd.backlight();     \/\/ \u0412\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u043f\u043e\u0434\u0441\u0432\u0435\u0442\u043a\u0443     \/\/ \u041a\u0443\u0440\u0441\u043e\u0440 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 1 \u0441\u0442\u0440\u043e\u043a\u0438     lcd.print(&quot;Hello&quot;);     \/\/ \u0412\u044b\u0432\u043e\u0434\u0438\u043c \u0442\u0435\u043a\u0441\u0442     lcd.setCursor(0, 1);     \/\/ \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043a\u0443\u0440\u0441\u043e\u0440 \u0432 \u043d\u0430\u0447\u0430\u043b\u043e 2 \u0441\u0442\u0440\u043e\u043a\u0438     lcd.print(&quot;World!&quot;);     \/\/ \u0412\u044b\u0432\u043e\u0434\u0438\u043c \u0442\u0435\u043a\u0441\u0442 }   void loop() { } \/\/ \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435: http:\/\/xrobot.by\/modules\/lcd_4_4#ixzz3vQXoFKOj <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<h1>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 Bluetooth<\/h1>\n<p>  \u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u0441\u0430\u043c\u043e\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435. \u00ab\u041d\u0430\u0441\u0430\u0436\u0438\u0432\u0430\u0435\u043c\u00bb \u043d\u0430\u0448\u0438 \u0448\u0438\u043b\u0434\u044b \u0441 bt-\u043c\u043e\u0434\u0443\u043b\u0435\u043c \u043d\u0430 \u043d\u0430\u0448\u0443 Arduino:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/599\/60c\/126\/59960c126ed247eca571ee8016fb9834.jpg\" alt=\"image\"\/><\/p>\n<p>  Master-\u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u043a Slave-\u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0443, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0431\u0443\u0434\u0435\u0442 \u0436\u0434\u0430\u0442\u044c \u0432\u0445\u043e\u0434\u044f\u0449\u0435\u0433\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f. \u041d\u0430 \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u043f\u043b\u0430\u0442 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0442\u0435\u043b\u044c \u0432 H, \u044d\u0442\u043e \u0438 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0448 master. \u041d\u0430 \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u043b\u0430\u0442\u0435 \u2014 \u0432 L, \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 slave.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/de1\/e57\/3da\/de1e573daece467b9cbe4255481bec6e.jpg\" alt=\"image\"\/><\/p>\n<p>  \u041f\u0440\u0438\u043a\u0440\u0435\u043f\u0438\u0432 \u043c\u043e\u0434\u0443\u043b\u0438 \u043a Arduino \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443. \u0414\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 master-a \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0441\u043b\u0430\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u043a\u043e\u043c\u0430\u043d\u0434 \u0432 bt-\u043c\u043e\u0434\u0443\u043b\u044c, \u0431\u0443\u0434\u0435\u043c \u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Serial Monitor (Ctrl+Shift+M). \u041f\u0440\u0438 \u043e\u0431\u043c\u0435\u043d\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f\u043c\u0438 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u0432\u044b\u0441\u0442\u0430\u0432\u0438\u0442\u044c Baud rate -&gt; 38400 &#038; \u00abBoth NL&#038;CR\u00bb.<\/p>\n<p>  \u041f\u043e\u0441\u043b\u0430\u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u00abAT\u00bb \u0438 \u043d\u0430\u0436\u0430\u0432 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c, \u043c\u044b \u043e\u0436\u0438\u0434\u0430\u0435\u043c \u043e\u0442\u0432\u0435\u0442 \u00abOK\u00bb. \u0415\u0441\u043b\u0438 \u044d\u0442\u043e \u0442\u0430\u043a \u2014 \u043f\u043b\u0430\u0442\u0430 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0430 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e, \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0442\u044c. \u0415\u0441\u043b\u0438 \u043d\u0435\u0442 \u2014 \u0441\u0442\u043e\u0438\u0442 \u0432\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f \u043d\u0430 \u043f\u0430\u0440\u0443 \u0448\u0430\u0433\u043e\u0432 \u043d\u0430\u0437\u0430\u0434 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f bluetooth-\u043c\u043e\u0434\u0443\u043b\u044f.<\/p>\n<p>  \u041d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0430\u0436\u043d\u044b\u0445 \u0410\u0422-\u043a\u043e\u043c\u0430\u043d\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u043c \u043c\u043e\u0433\u0443 \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u044c\u0441\u044f:<\/p>\n<p>  AT \u2014 \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u0435\u0440\u043d\u0435\u0442 \u00abOK\u00bb, \u0437\u043d\u0430\u0447\u0438\u0442 \u0432\u0441\u0451 \u0432 \u043f\u043e\u0440\u044f\u0434\u043a\u0435<br \/>  AT+NAME? \u2014 \u0432\u0435\u0440\u043d\u0435\u0442 \u0438\u043c\u044f \u043c\u043e\u0434\u0443\u043b\u044f. \u041c\u044b \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u043c \u0437\u0430\u0434\u0430\u0442\u044c \u0441\u0432\u043e\u0451 \u0438\u043c\u044f, \u043f\u043e\u0441\u043b\u0430\u0432, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, AT+NAME=WEATHER_MONITOR<br \/>  AT+ROLE? \u2014 \u043e\u0434\u043d\u0430 \u0438\u0437 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0445 \u043a\u043e\u043c\u0430\u043d\u0434, \u0432\u0435\u0440\u043d\u0435\u0442 \u0440\u043e\u043b\u044c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430, master\/slave. \u0417\u0430\u0434\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e AT+ROLE=0 \u2014 \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438 \u0432 \u0440\u0435\u0436\u0438\u043c slave, \u043b\u0438\u0431\u043e AT+ROLE=1 \u2014 \u0440\u0435\u0436\u0438\u043c master.<br \/>  AT+PSWD? \u2014 \u0432\u0435\u0440\u043d\u0451\u0442 \u043f\u0438\u043d-\u043a\u043e\u0434, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f.<br \/>  AT+ADDR? \u2014 \u0432\u0435\u0440\u043d\u0451\u0442 \u0430\u0434\u0440\u0435\u0441 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u00ab14:2:110007\u00bb. \u0421\u0442\u043e\u0438\u0442 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0430\u0434\u0440\u0435\u0441\u0430 \u0432 \u043f\u043e\u0441\u044b\u043b\u0430\u0435\u043c\u044b\u0445 AT-\u043a\u043e\u043c\u0430\u043d\u0434\u0430\u0445 \u0434\u0432\u043e\u0435\u0442\u043e\u0447\u0438\u044f &quot;:&quot; \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u043d\u044f\u0442\u044c \u0437\u0430\u043f\u044f\u0442\u044b\u043c\u0438 &quot;,&quot;, \u0442.\u043e. \u00ab14:2:110007\u00bb -&gt; \u00ab14,2,110007\u00bb.<\/p>\n<h4>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Slave&#8217;a<\/h4>\n<p>  \u0422\u0443\u0442 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0442\u0435\u043b\u043e\u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0439 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u043f\u043b\u0430\u0442\u0443 \u043a \u043f\u0438\u0442\u0430\u043d\u0438\u044e.<\/p>\n<h4>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Master&#8217;a<\/h4>\n<p>  <b>\u042d\u0442\u0430\u043f \u043f\u0435\u0440\u0432\u044b\u0439. \u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f.<\/b><\/p>\n<ol>\n<li>\u041f\u043e\u0441\u044b\u043b\u0430\u0435\u043c AT+ORGL, \u0442\u0435\u043c \u0441\u0430\u043c\u044b\u043c \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044f \u043c\u043e\u0434\u0443\u043b\u044c \u043a \u0435\u0433\u043e \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438<\/li>\n<li>\u0418\u043c\u044f \u043c\u043e\u0434\u0443\u043b\u044f \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c, \u043f\u043e\u0441\u043b\u0430\u0432 AT+NAME=myname.<\/li>\n<li>AT+RMAAD \u2014 \u0443\u0434\u0430\u043b\u044f\u0435\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u00ab\u0441\u043f\u0430\u0440\u0438\u0432\u0430\u043d\u0438\u044f\u0445\u00bb.<\/li>\n<li>AT+PSWD=1234 \u2014 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043f\u0430\u0440\u043e\u043b\u044c<\/li>\n<li>AT+ROLE=1 \u2014 \u0433\u043e\u0432\u043e\u0440\u0438\u043c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0443, \u0447\u0442\u043e \u043e\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432 master \u0440\u0435\u0436\u0438\u043c\u0435.<\/li>\n<li>AT+CMODE=1 \u2014 \u0433\u043e\u0432\u043e\u0440\u0438\u043c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0443, \u0447\u0442\u043e \u043e\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u043a \u043b\u044e\u0431\u044b\u043c \u0430\u0434\u0440\u0435\u0441\u0430\u043c.<\/li>\n<\/ol>\n<p>  <b>\u042d\u0442\u0430\u043f \u0432\u0442\u043e\u0440\u043e\u0439. \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435.<\/b><\/p>\n<ol>\n<li>\u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 AT, \u0447\u0442\u043e\u0431\u044b \u0443\u0434\u043e\u0441\u0442\u043e\u0432\u0435\u0440\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u043c\u043e\u0434\u0443\u043b\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d \u0438 \u0433\u043e\u0442\u043e\u0432 \u043a \u0440\u0430\u0431\u043e\u0442\u0435.<\/li>\n<li>AT+INIT \u2014 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f. \u0415\u0441\u043b\u0438 \u0432 \u043e\u0442\u0432\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c ERROR(17) \u2014 \u043d\u0438\u0447\u0435\u0433\u043e \u0441\u0442\u0440\u0430\u0448\u043d\u043e\u0433\u043e, \u0437\u043d\u0430\u0447\u0438\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0443\u0436\u0435 \u043f\u043e\u0441\u044b\u043b\u0430\u043b\u0430\u0441\u044c, \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0443.<\/li>\n<li>AT+INQ \u2014 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u043f\u043e\u0438\u0441\u043a \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 BT-\u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432, \u043e\u0442\u0432\u0435\u0442 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0438\u0437 \u0430\u0434\u0440\u0435\u0441\u043e\u0432<\/li>\n<li>AT+LINK=&lt;\u0430\u0434\u0440\u0435\u0441&gt; \u2014 \u0442\u0443\u0442 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a slave-\u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0443. \u041a\u043e\u043c\u0430\u043d\u0434\u0430 \u043d\u0430 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a: AT+LINK=14,2,110007. <\/li>\n<\/ol>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0434\u0438\u043e\u0434\u044b \u043d\u0430\u0447\u043d\u0443\u0442 \u043c\u0438\u0433\u0430\u0442\u044c \u0441 \u043c\u0435\u043d\u044c\u0448\u0435\u0439 \u0447\u0430\u0441\u0442\u043e\u0442\u043e\u0439, \u0447\u0442\u043e \u0433\u043e\u0432\u043e\u0440\u0438\u0442 \u043e\u0431 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0438.<\/p>\n<h1>\u0424\u0438\u043d\u0438\u0448\u043d\u0430\u044f \u043f\u0440\u044f\u043c\u0430\u044f<\/h1>\n<p>  \u041d\u0430 \u044d\u0442\u043e\u043c \u043f\u043e\u0447\u0442\u0438 \u0432\u0441\u0451. \u041e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043a\u0435\u0442\u0447\u0438, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u044b \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c-\u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c-\u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u043c-\u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u043c \u043f\u043e\u0433\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435. \u041f\u0440\u0438 \u0436\u0435\u043b\u0430\u043d\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043e\u0442 \u043c\u0430\u043a\u0435\u0442\u043d\u043e\u0439 \u043f\u043b\u0430\u0442\u044b \u0438 \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u0442\u044c \u043a \u043f\u0430\u0439\u043a\u0435, \u0430 \u0437\u0430\u0442\u0435\u043c \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0432 \u043a\u043e\u0440\u043f\u0443\u0441\u0430.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b<\/b><\/p>\n<div class=\"spoiler_text\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/7bd\/6e4\/509\/7bd6e4509bc44599902e5ea2584df5a5.jpg\" alt=\"image\"\/><br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/8c6\/7fd\/142\/8c67fd1429d449a8ba4a8ba4912742d2.jpg\" alt=\"image\"\/><br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/c9e\/68b\/df1\/c9e68bdf1a6a42d8912fc985ac27e3b5.jpg\" alt=\"image\"\/><br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/ce6\/eec\/bb7\/ce6eecbb7fb84cf99563a2a8bcdbecb7.jpg\" alt=\"image\"\/>  <\/div>\n<\/div>\n<p>  \u0421\u043a\u0435\u0442\u0447\u0438: <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434 \u043c\u0435\u0442\u0435\u043e-\u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0430<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">#include &lt;SoftwareSerial.h&gt; #include &lt;Wire.h&gt; #include &lt;LiquidCrystal_I2C.h&gt;    LiquidCrystal_I2C lcd(0x27,16,2); \/\/ \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b: \u0410\u0434\u0440\u0435\u0441 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430, \u0440\u0430\u0437\u043c\u0435\u0440 \u044d\u043a\u0440\u0430\u043d\u0430    #define rxPin 2 #define txPin 3  SoftwareSerial btSerial(rxPin, txPin);  bool isDisplayingMode = true;   void setup() {    lcd.init();    lcd.backlight();    \/\/ define pin modes for tx, rx pins:    pinMode(rxPin, INPUT);    pinMode(txPin, OUTPUT);    btSerial.begin(38400);     Serial.begin(38400);    Serial.println(&quot;Serial started&quot;);                    lcd.print(&quot;    Waiting&quot;);    lcd.setCursor(0, 1);    lcd.print(&quot; for connection&quot;);        btSerial.println(&quot;AT&quot;);    while (!btSerial.available());    while (btSerial.available() &gt; 0)         char c = btSerial.read();    btSerial.println(&quot;AT+INIT&quot;);    while (!btSerial.available());    while (btSerial.available() &gt; 0)         char c = btSerial.read();    btSerial.println(&quot;AT+INQ&quot;);    while (!btSerial.available());    while (btSerial.available() &gt; 0)         char c = btSerial.read();    btSerial.println(&quot;AT+LINK=2014,5,191146&quot;);      while (!btSerial.available());    while (btSerial.available() &gt; 0)         char c = btSerial.read();    }  void loop() {      int i = 0;   char someChar[32] = {0};   \/\/ when characters arrive over the serial port...   bool availible = Serial.available();   if(availible) {     do{         someChar[i++] = Serial.read();       \/\/As data trickles in from your serial port you are grabbing as much as you can,        \/\/but then when it runs out (as it will after a few bytes because the processor        \/\/is much faster than a 9600 baud device) you exit loop, which then restarts,        \/\/and resets i to zero, and someChar to an empty array.So please be sure to keep this delay        delay(3);                         }while (Serial.available() &gt; 0);      lcd.clear();     Serial.println(i);     btSerial.println(someChar);     Serial.println(someChar);   }     lcd.setCursor(0, 0);   while(btSerial.available())        {         if (isDisplayingMode)         {           lcd.clear();           isDisplayingMode = false;         }         char c = (char)btSerial.read();         Serial.print(c);                   if (c != 13 && c != 10)           lcd.print(c);         if (c == '\\n')           lcd.setCursor(0, 1);       } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434 \u043c\u0435\u0442\u0435\u043e-\u0441\u0435\u043d\u0441\u043e\u0440\u0430<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">#include &lt;SoftwareSerial.h&gt; #include &lt;Wire.h&gt; #include &lt;Adafruit_Sensor.h&gt; #include &lt;Adafruit_BMP085_U.h&gt;  Adafruit_BMP085_Unified bmp = Adafruit_BMP085_Unified(10085); int lightSensorPin = 0;  #define rxPin 2 #define txPin 3  SoftwareSerial btSerial(rxPin, txPin);  struct SensorData {   float Pressure;   float Temperature;   float Altitude;   float Lightness;   void DisplaySensorData() {     Serial.print(&quot;Light:       &quot;);     Serial.print(this-&gt;Lightness, 2);     Serial.println(&quot;%&quot;);     Serial.print(&quot;Altitude:    &quot;);      Serial.print(this-&gt;Altitude);      Serial.println(&quot; m&quot;);     Serial.print(&quot;Temperature: &quot;);     Serial.print(this-&gt;Temperature);     Serial.println(&quot; C&quot;);     \/* Display atmospheric pressue in hPa *\/     Serial.print(&quot;Pressure:    &quot;);     Serial.print(this-&gt;Pressure);     Serial.println(&quot; hPa&quot;);     Serial.println(&quot;&quot;); }  void DisplaySensorDataInTwoRows() {     Serial.print(&quot;Temp: &quot;); Serial.print(this-&gt;Temperature); Serial.println(&quot; C&quot;);     Serial.print(&quot;Pr: &quot;); Serial.print(this-&gt;Pressure); Serial.println(&quot; Pa&quot;);     delay(1000);         Serial.print(&quot;Alt: &quot;); Serial.print(this-&gt;Altitude); Serial.println(&quot; m&quot;);     Serial.print(&quot;Light: &quot;); Serial.print(this-&gt;Lightness); Serial.println(&quot; %&quot;);     delay(1000); } void SendDataToRemote() {     btSerial.print(&quot;Temp: &quot;); btSerial.print(this-&gt;Temperature); btSerial.print(&quot; C\\n&quot;);     btSerial.print(&quot;Pr:   &quot;); btSerial.print(this-&gt;Pressure); btSerial.print(&quot; hPa\\n&quot;);     delay(5000);         btSerial.print(&quot;Alt:   &quot;); btSerial.print(this-&gt;Altitude); btSerial.print(&quot; m\\n&quot;);     btSerial.print(&quot;Light: &quot;); btSerial.print(this-&gt;Lightness); btSerial.print(&quot; %  \\n&quot;);     delay(5000); } };    void displaySensorDetails(void) {   sensor_t sensor;   bmp.getSensor(&sensor);      Serial.println(&quot;------------------------------------&quot;);   Serial.print  (&quot;Sensor:       &quot;); Serial.println(sensor.name);   Serial.print  (&quot;Driver Ver:   &quot;); Serial.println(sensor.version);   Serial.print  (&quot;Unique ID:    &quot;); Serial.println(sensor.sensor_id);   Serial.print  (&quot;Max Value:    &quot;); Serial.print(sensor.max_value); Serial.println(&quot; hPa&quot;);   Serial.print  (&quot;Min Value:    &quot;); Serial.print(sensor.min_value); Serial.println(&quot; hPa&quot;);   Serial.print  (&quot;Resolution:   &quot;); Serial.print(sensor.resolution); Serial.println(&quot; hPa&quot;);     Serial.println(&quot;------------------------------------&quot;);   Serial.println(&quot;&quot;);   delay(500); }  void setup(void)  {    \/\/ define pin modes for tx, rx pins:    pinMode(rxPin, INPUT);    pinMode(txPin, OUTPUT);    btSerial.begin(38400);       Serial.begin(9600);   Serial.println(&quot;Pressure Sensor Test&quot;); Serial.println(&quot;&quot;);          \/* Initialise the sensor *\/   if(!bmp.begin())   {     \/* There was a problem detecting the BMP085 ... check your connections *\/     Serial.print(&quot;Ooops, no BMP085 detected ... Check your wiring or I2C ADDR!&quot;);     while(1);   }        \/* Display some basic information on this sensor *\/   displaySensorDetails(); } int counter = 0; void loop(void)  {   \/* Get a new sensor event *\/    sensors_event_t event;   bmp.getEvent(&event);   SensorData data;   \/* Display the results (barometric pressure is measure in hPa) *\/   if (event.pressure)   {     data.Pressure = event.pressure;          float temperature;     bmp.getTemperature(&temperature);     data.Temperature = temperature;      \/* Then convert the atmospheric pressure, and SLP to altitude         *\/     \/* Update this next line with the current SLP for better results      *\/     float seaLevelPressure = SENSORS_PRESSURE_SEALEVELHPA;     float altitude = bmp.pressureToAltitude(seaLevelPressure, event.pressure);     data.Altitude = altitude;            int lightValue = analogRead(lightSensorPin);     float lightValueInPercent = 1.0 * lightValue \/ 1024 * 100;     data.Lightness = lightValueInPercent;          \/\/data.DisplaySensorDataInTwoRows();       }   else   {     Serial.println(&quot;Sensor error&quot;);   }   Serial.println(&quot;&quot;);   data.SendDataToRemote(); } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041d\u0430 \u044d\u0442\u043e\u043c \u0432\u0441\u0451. \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435!       <\/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:\/\/geektimes.ru\/post\/268524\/\"> http:\/\/geektimes.ru\/post\/268524\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>       \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0435\u0440\u0432\u044b\u0439 \u0448\u0430\u0433 \u0432 \u043c\u0438\u0440 Arduino \u0438 \u0441\u043c\u0430\u0441\u0442\u0435\u0440\u0438\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0443\u044e \u043c\u0435\u0442\u0435\u043e\u0441\u0442\u0430\u043d\u0446\u0438\u044e. \u041c\u0435\u0442\u0435\u043e\u0441\u0442\u0430\u043d\u0446\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0441\u0442\u043e\u044f\u0442\u044c \u0438\u0437 \u0434\u0432\u0443\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439: \u043e\u0434\u0438\u043d \u043c\u043e\u0434\u0443\u043b\u044c \u0431\u0443\u0434\u0435\u0442 \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0441 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u0445 \u0434\u0430\u0442\u0447\u0438\u043a\u043e\u0432, \u0434\u0440\u0443\u0433\u043e\u0439 \u2014 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u0441\u0447\u0438\u0442\u0430\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u044d\u043a\u0440\u0430\u043d. \u0414\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Bluetooth.<\/p>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043f\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 BT-\u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0434\u0440\u0443\u0433 \u0441 \u0434\u0440\u0443\u0433\u043e\u043c.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/e6b\/40d\/c46\/e6b40dc463a644dd8e0ab6c84d1af131.jpg\" alt=\"image\"\/><\/p>\n<p>  \u0418\u0442\u0430\u043a, \u043f\u043e\u0435\u0445\u0430\u043b\u0438!  <\/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-271399","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/271399","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=271399"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/271399\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=271399"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=271399"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=271399"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}