{"id":278191,"date":"2016-04-13T13:50:08","date_gmt":"2016-04-13T09:50:08","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=278191"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=278191","title":{"rendered":"\u041c\u043e\u0431\u0438\u043b\u044c\u043d\u0430\u044f \u043c\u0435\u0442\u0435\u043e\u0441\u0442\u0430\u043d\u0446\u0438\u044f \u043d\u0430 Arduino"},"content":{"rendered":"<p>       \u041d\u0430\u0432\u0435\u0440\u043d\u043e\u0435, \u043a\u0430\u0436\u0434\u044b\u0439 \u043a\u0442\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0441\u0432\u043e\u0435 \u0437\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u043e \u0441 Arduino, \u043f\u043e\u043c\u043e\u0440\u0433\u0430\u0432 \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u043e\u043c \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0432 \u043a\u043d\u043e\u043f\u043a\u0443, \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442 \u043a \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u0441\u0432\u043e\u0435\u0439 \u043c\u0435\u0442\u0435\u043e\u0441\u0442\u0430\u043d\u0446\u0438\u0438. \u041d\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u0441\u0442\u0430\u043b \u0438 \u044f. <\/p>\n<p>  \u041e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0432\u0448\u0438\u0441\u044c \u0441 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u043c\u0438 \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0435, \u0431\u044b\u043b\u0438 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f. \u0423\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u0432\u0440\u0435\u043c\u044f, \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0443, \u0434\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0438 \u0433\u0440\u0430\u0444\u0438\u043a \u0435\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f. \u0422\u0430\u043a\u0436\u0435 \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u0444\u0430\u0437\u044b \u043b\u0443\u043d\u044b \u0438 \u0432\u0440\u0435\u043c\u044f \u0432\u043e\u0441\u0445\u043e\u0434\u0430-\u0437\u0430\u0445\u043e\u0434\u0430 \u0441\u043e\u043b\u043d\u0446\u0430. \u0410 \u0441\u0430\u043c\u044b\u043c \u0432\u0430\u0436\u043d\u044b\u043c \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0431\u044b\u043b\u043e \u2013 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0441\u0442\u044c. \u0421\u043e\u0437\u0434\u0430\u0432\u0430\u0435\u043c\u0430\u044f \u043f\u043e\u0440\u0442\u0430\u0442\u0438\u0432\u043d\u0430\u044f \u043c\u0435\u0442\u0435\u043e\u0441\u0442\u0430\u043d\u0446\u0438\u044f \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u043b\u0430\u0441\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043f\u043e\u043c\u043e\u0449\u044c \u0434\u043b\u044f \u0440\u044b\u0431\u0430\u043b\u043a\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u043b\u0430 \u0438\u043c\u0435\u0442\u044c \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u0438 \u043e\u0431\u043b\u0430\u0434\u0430\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0430\u0432\u0442\u043e\u043d\u043e\u043c\u043d\u043e\u0441\u0442\u044c\u044e.<br \/>  <a name=\"habracut\"><\/a><br \/>  \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u043e\u0440\u043f\u0443\u0441\u0430 \u0434\u043b\u044f \u043b\u044e\u0431\u043e\u0439 \u0441\u0430\u043c\u043e\u0434\u0435\u043b\u043a\u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439. \u0412 \u0437\u0430\u043a\u0440\u043e\u043c\u0430\u0445 \u0431\u044b\u043b \u043d\u0430\u0439\u0434\u0435\u043d \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0439 \u0442\u0435\u043b\u0435\u0444\u043e\u043d Motorola T192.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/76f\/02d\/8bd\/76f02d8bd87a4e0aae22c2e4a192d876.jpg\" alt=\"image\"\/><\/p>\n<p>  \u041e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u0432 \u043d\u0435\u0433\u043e \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u044d\u043a\u0440\u0430\u043d \u043e\u0442 Nokia 3310 (\u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0430\u043c\u0443 Nokia 3310, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0431\u044b\u043b\u043e \u0431\u044b \u0443\u0434\u043e\u0431\u043d\u0435\u0435).<br \/>  \u0423\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0432\u0441\u0435\u043c \u0431\u044b\u043b\u043e \u043f\u043e\u0440\u0443\u0447\u0435\u043d\u043e Arduino Pro Mini.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/e3c\/723\/d4f\/e3c723d4f19a4c43a6bc9034c941f4cb.jpg\" alt=\"image\"\/><\/p>\n<p>  \u0427\u0442\u043e\u0431\u044b \u043d\u0435 \u043f\u0440\u043e\u0432\u0430\u043b\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u043a\u043d\u043e\u043f\u043a\u0438, \u0431\u044b\u043b\u0430 \u0432\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0430 \u043c\u0430\u043a\u0435\u0442\u043d\u0430\u044f \u043f\u043b\u0430\u0442\u0430. \u041f\u0440\u0438 \u043f\u0435\u0440\u0435\u043a\u043b\u0435\u0438\u0432\u0430\u043d\u0438\u0438 \u043a\u043b\u0430\u0432\u0438\u0430\u0442\u0443\u0440\u044b, \u0431\u044b\u043b\u043e \u0437\u0430\u043c\u0435\u0447\u0435\u043d\u043e, \u0447\u0442\u043e \u0448\u0430\u0433 \u043e\u0442\u0432\u0435\u0440\u0441\u0442\u0438\u0439 \u043c\u0430\u043a\u0435\u0442\u043a\u0438 \u043f\u043e\u0447\u0442\u0438 \u0441\u043e\u0432\u043f\u0430\u043b \u0441 \u043a\u043d\u043e\u043f\u043a\u0430\u043c\u0438. \u0412 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u044d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u043b\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043d\u043e\u043f\u043a\u0438.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/013\/fd5\/ae4\/013fd5ae401643a48dbb21a211ee0373.jpg\" alt=\"image\"\/><\/p>\n<p>  \u0414\u043b\u044f \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u0434\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d \u0434\u0430\u0442\u0447\u0438\u043a bmp180. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0447\u0430\u0441\u043e\u0432 \u0431\u044b\u043b \u0432\u0437\u044f\u0442 \u043c\u043e\u0434\u0443\u043b\u044c ds1302, \u043d\u043e \u0434\u043b\u044f \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0438 \u043c\u0435\u0441\u0442\u0430 \u0441 \u043d\u0435\u0433\u043e \u0431\u044b\u043b\u0430 \u0432\u0437\u044f\u0442\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u043c\u0438\u043a\u0440\u043e\u0441\u0445\u0435\u043c\u0430. \u041a\u0432\u0430\u0440\u0446 \u0431\u044b\u043b \u0432\u044b\u043f\u0430\u044f\u043d \u0438\u0437 \u043c\u0430\u0442\u0435\u0440\u0438\u043d\u0441\u043a\u043e\u0439 \u043f\u043b\u0430\u0442\u044b, \u0430 \u0431\u0430\u0442\u0430\u0440\u0435\u0439\u043a\u0443 \u0432\u044b\u043d\u0443\u043b \u0441 \u043d\u043e\u0443\u0442\u0431\u0443\u043a\u0430 (\u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u043c\u043e\u0436\u043d\u043e \u0438 \u043e\u0431\u044b\u0447\u043d\u0443\u044e cr2032 \u0432 \u0442\u0435\u0440\u043c\u043e\u043a\u0435\u043c\u0431\u0440\u0438\u043a\u0435).<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/10d\/bc5\/403\/10dbc54035a64b71b6f870c5bfe3a2cd.jpg\" alt=\"image\"\/><\/p>\n<p>  \u0422\u0430\u043a \u043a\u0430\u043a \u0438\u043c\u0435\u043b\u0438\u0441\u044c \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u0435 \u0432\u044b\u0445\u043e\u0434\u044b, \u0442\u043e \u043f\u043e\u0434\u0441\u0432\u0435\u0442\u043a\u0443 \u0434\u0438\u0441\u043f\u043b\u0435\u044f \u043f\u043e\u0432\u0435\u0441\u0438\u043b \u043d\u0430 \u043e\u0434\u0438\u043d \u0438\u0437 \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u0445 \u0438 \u043a\u043d\u043e\u043f\u043a\u0443 \u043d\u0430 \u0432\u0442\u043e\u0440\u043e\u0439.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/9a9\/bf7\/6eb\/9a9bf76eb1564b1692d471200e8d8b76.jpg\" alt=\"image\"\/><\/p>\n<p>  \u0414\u043b\u044f \u0437\u0430\u0440\u044f\u0434\u043a\u0438 \u043b\u0438\u0442\u0438\u0435\u0432\u043e\u0433\u043e \u0430\u043a\u043a\u0443\u043c\u0443\u043b\u044f\u0442\u043e\u0440\u0430 \u0431\u044b\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d \u043c\u043e\u0434\u0443\u043b\u044c \u0437\u0430\u0440\u044f\u0434\u0430 Li-ion \u043d\u0430 TP4056.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/e53\/12a\/297\/e5312a297b954a6ca182e8efe68a5b9c.jpg\" alt=\"image\"\/><\/p>\n<p>  \u0418\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u0432\u0438\u0434 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 (\u043f\u0440\u043e\u0432\u043e\u0434\u0430, \u0442\u043e\u0440\u0447\u0430\u0449\u0438\u0435 \u0441\u043f\u0440\u0430\u0432\u0430, \u0434\u043b\u044f \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0441\u043a\u043e\u0440\u0435 \u0431\u0443\u0434\u0443\u0442 \u0443\u0431\u0440\u0430\u043d\u044b.)<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/62d\/dbf\/6d5\/62ddbf6d5e4a4248a012d41071b00dfd.jpg\" alt=\"image\"\/><\/p>\n<p>  \u041f\u0440\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438\u0441\u044c \u043e\u0431\u044b\u0447\u043d\u044b\u0435 \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430. \u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 TimeLord.h (https:\/\/github.com\/probonopd\/TimeLord). \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0435\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0443\u043a\u0430\u0437\u0430\u0432 \u0434\u0430\u0442\u0443, \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0438 \u0447\u0430\u0441\u043e\u0432\u043e\u0439 \u043f\u043e\u044f\u0441 \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u0432\u043e\u0441\u0445\u043e\u0434\u0430-\u0437\u0430\u0445\u043e\u0434\u0430 \u0441\u043e\u043b\u043d\u0430, \u0444\u0430\u0437\u0443 \u043b\u0443\u043d\u044b. \u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435: <a href=\"https:\/\/drive.google.com\/file\/d\/0B2lZmKmsmdFBeFVfeDhSdVlYRnM\/view?usp=sharing\">TimeLord.pdf<\/a>.<\/p>\n<p>  \u041a\u0430\u0441\u0430\u0435\u043c\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0430\u0432\u0442\u043e\u043d\u043e\u043c\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b, \u0442\u043e \u043d\u0435\u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u043e, \u0447\u0442\u043e \u043d\u0435\u0434\u0435\u043b\u044e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u043e\u0447\u043d\u043e. \u042d\u0442\u043e\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u043f\u043e\u043b\u043d\u0435 \u0443\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u0435 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u044b \u043f\u043e \u044d\u043d\u0435\u0440\u0433\u043e\u0441\u0431\u0435\u0440\u0435\u0436\u0435\u043d\u0438\u044e \u043f\u043e\u043a\u0430 \u043e\u0442\u043b\u043e\u0436\u0435\u043d\u044b.<\/p>\n<p>  \u0421\u043a\u0435\u0442\u0447 \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 81% \u043f\u0430\u043c\u044f\u0442\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u0435\u0449\u0435.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/f60\/9ed\/809\/f609ed8093614b8f9877c903b6378257.jpg\" alt=\"image\"\/><\/p>\n<p>  \u041d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f \u0430\u043d\u0442\u0435\u043d\u043d\u0430 (\u0438\u043d\u0434\u0438\u043a\u0430\u0442\u043e\u0440 \u0443\u0440\u043e\u0432\u043d\u044f \u0441\u0438\u0433\u043d\u0430\u043b\u0430). \u042d\u0442\u043e \u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u0437\u0430\u0434\u0435\u043b \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0440\u0430\u0434\u0438\u043e \u043c\u043e\u0434\u0443\u043b\u044f \u043d\u0430 433 \u041c\u0413\u0446, \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u0430\u0432\u0434\u0438\u0432\u043e\u0439 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b \u0438 \u0432\u043b\u0430\u0436\u043d\u043e\u0441\u0442\u0438 \u043e\u0442 \u0432\u043d\u0435\u0448\u043d\u0435\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0418\u0441\u0445\u043e\u0434\u043d\u0438\u043a<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">#include &lt;BMP085.h&gt; #include &lt;EEPROM.h&gt; #include &lt;Adafruit_GFX.h&gt; #include &lt;Adafruit_PCD8544.h&gt; #include &lt;DS1302.h&gt; #include &lt;TimeLord.h&gt; #include &lt;Wire.h&gt;  \/\/84x48 Adafruit_PCD8544 display = Adafruit_PCD8544(3, 4, 5, 6, 7); \/\/ Create a DS1302 object. DS1302 rtc(12, 11, 10);\/\/ Chip Enable, Input\/Output, Serial Clock Time t = rtc.time(); String dayAsString(const Time::Day day) {   switch (day) {     case Time::kSunday: return &quot;Sunday&quot;;     case Time::kMonday: return &quot;Monday&quot;;     case Time::kTuesday: return &quot;Tuesday&quot;;     case Time::kWednesday: return &quot;Wednesday&quot;;     case Time::kThursday: return &quot;Thursday&quot;;     case Time::kFriday: return &quot;Friday&quot;;     case Time::kSaturday: return &quot;Saturday&quot;;   }   return &quot;(unknown day)&quot;; } \/\/------------- TimeLord tardis; float const LATITUDE = 52.70; float const LONGITUDE = 25.40; \/\/byte today[] = {0,0,12,22,03,16}; byte today[6]; \/\/------------- \/\/long previousMillis = 0, previousMillis2 = 0;      \/\/ \u0445\u0440\u0430\u043d\u0438\u043c \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \/\/long interval = 1800000;           \/\/ \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b \u043c\u0435\u0436\u0434\u0443 \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c\u0438 \/\/long interval = 3600000;           \/\/ \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b \u043c\u0435\u0436\u0434\u0443 \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c\u0438 \/\/long interval2 = 1000;           \/\/ \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b \u043c\u0435\u0436\u0434\u0443 \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c\u0438 byte prevSecond = 99, prevHour = 99; \/\/------------- BMP085 dps = BMP085(); long Temperature = 0, Pressure = 0; float t_f = 0;  \/\/-------------buttons-------------------- int buttonPushCounter = 0; int buttonState = 0; int lastButtonState = 0;  \/\/-------------moon---------------------- \/\/0.0 New Moon 0.99 - Almost new const unsigned char PROGMEM moon0[] = { B00000111, B11100000,   B00001000, B00010000,   B00010000, B00001000,   B00100000, B00000100,   B01000000, B00000010,   B10000000, B00000001,   B10000000, B00000001,   B10000000, B00000001,   B10000000, B00000001,   B10000000, B00000001,   B01000000, B00000010,   B00100000, B00000100,   B00010000, B00001000,   B00001000, B00010000,   B00000111, B11100000 };  \/\/Waxing Crescent const unsigned char PROGMEM moon1[] = { B00000111, B11100000,   B00001000, B01110000,   B00010000, B00111000,   B00100000, B00011100,   B01000000, B00001110,   B10000000, B00001111,   B10000000, B00001111,   B10000000, B00001111,   B10000000, B00001111,   B10000000, B00001111,   B01000000, B00001110,   B00100000, B00011100,   B00010000, B00111000,   B00001000, B01110000,   B00000111, B11100000 };  \/\/0.25 First Quarter const unsigned char PROGMEM moon2[] = { B00000111, B11100000,   B00001000, B11110000,   B00010000, B11111000,   B00100000, B11111100,   B01000000, B11111110,   B10000000, B11111111,   B10000000, B11111111,   B10000000, B11111111,   B10000000, B11111111,   B10000000, B11111111,   B01000000, B11111110,   B00100000, B11111100,   B00010000, B11111000,   B00001000, B11110000,   B00000111, B11100000 };  \/\/Waxing Gibbous const unsigned char PROGMEM moon3[] = { B00000111, B11100000,   B00001011, B11110000,   B00010111, B11111000,   B00101111, B11111100,   B01001111, B11111110,   B10001111, B11111111,   B10001111, B11111111,   B10001111, B11111111,   B10001111, B11111111,   B10001111, B11111111,   B01001111, B11111110,   B00101111, B11111100,   B00010111, B11111000,   B00001011, B11110000,   B00000111, B11100000 };  \/\/0.5 Full Moon const unsigned char PROGMEM moon4[] = { B00000111, B11100000,   B00001111, B11110000,   B00011111, B11111000,   B00111111, B11111100,   B01111111, B11111110,   B11111111, B11111111,   B11111111, B11111111,   B11111111, B11111111,   B11111111, B11111111,   B11111111, B11111111,   B01111111, B11111110,   B00111111, B11111100,   B00011111, B11111000,   B00001111, B11110000,   B00000111, B11100000 };  \/\/Waning Gibbous const unsigned char PROGMEM moon5[] = { B00000111, B11100000,   B00001111, B11010000,   B00011111, B11101000,   B00111111, B11110100,   B01111111, B11110010,   B11111111, B11110001,   B11111111, B11110001,   B11111111, B11110001,   B11111111, B11110001,   B11111111, B11110001,   B01111111, B11110010,   B00111111, B11110100,   B00011111, B11101000,   B00001111, B11010000,   B00000111, B11100000 };  \/\/0.75 Third Quarter  (Last Quarter) const unsigned char PROGMEM moon6[] = { B00000111, B11100000,   B00001111, B00010000,   B00011111, B00001000,   B00111111, B00000100,   B01111111, B00000010,   B11111111, B00000001,   B11111111, B00000001,   B11111111, B00000001,   B11111111, B00000001,   B11111111, B00000001,   B01111111, B00000010,   B00111111, B00000100,   B00011111, B00001000,   B00001111, B00010000,   B00000111, B11100000 };   \/\/Waning Crescent const unsigned char PROGMEM moon7[] = { B00000111, B11100000,   B00001110, B00010000,   B00011100, B00001000,   B00111000, B00000100,   B01110000, B00000010,   B11110000, B00000001,   B11110000, B00000001,   B11110000, B00000001,   B11110000, B00000001,   B11110000, B00000001,   B01110000, B00000010,   B00111000, B00000100,   B00011100, B00001000,   B00001110, B00010000,   B00000111, B11100000 }; \/\/===================================================================================== void drawMoon(int moon_x, int moon_y, int phase) {   display.fillRect(moon_x, moon_y, 16, 15, WHITE);   display.drawBitmap(moon_x, moon_y, moon4,  16, 15, WHITE);   switch (phase) {     case 0:       display.drawBitmap(moon_x, moon_y, moon0,  16, 15, BLACK);       break;     case 1:       display.drawBitmap(moon_x, moon_y, moon1,  16, 15, BLACK);       break;     case 2:       display.drawBitmap(moon_x, moon_y, moon2,  16, 15, BLACK);       break;     case 3:       display.drawBitmap(moon_x, moon_y, moon3,  16, 15, BLACK);       break;     case 4:       display.drawBitmap(moon_x, moon_y, moon4,  16, 15, BLACK);       break;     case 5:       display.drawBitmap(moon_x, moon_y, moon5,  16, 15, BLACK);       break;     case 6:       display.drawBitmap(moon_x, moon_y, moon6,  16, 15, BLACK);       break;     case 7:       display.drawBitmap(moon_x, moon_y, moon7,  16, 15, BLACK);       break;     default:       display.drawBitmap(moon_x, moon_y, moon4,  16, 15, WHITE);   } } \/\/=========================================================================================== void drawMoonDate(int moon_x, int moon_y, uint8_t * datetoday) {   float phase;   phase = tardis.MoonPhase(datetoday);   if (phase &gt;= 0.0   && phase &lt;= 0.0625)  {     drawMoon(moon_x, moon_y, 0);   }; \/\/0.000  New moon   if (phase &gt; 0.0625 && phase &lt;= 0.1875)  {     drawMoon(moon_x, moon_y, 1);   }; \/\/0,125   if (phase &gt; 0.1875 && phase &lt;= 0.3125 ) {     drawMoon(moon_x, moon_y, 2);   }; \/\/0.250  First Quarter   if (phase &gt; 0.3125 && phase &lt;= 0.4375)  {     drawMoon(moon_x, moon_y, 3);   }; \/\/0,375   if (phase &gt; 0.4375 && phase &lt;= 0.5625)  {     drawMoon(moon_x, moon_y, 4);   }; \/\/0.500  Full   if (phase &gt; 0.5625 && phase &lt;= 0.6875)  {     drawMoon(moon_x, moon_y, 5);   }; \/\/0,625   if (phase &gt; 0.6875 && phase &lt;= 0.8125)  {     drawMoon(moon_x, moon_y, 6);   }; \/\/0.750  Last Quarter   if (phase &gt; 0.8125 && phase &lt;= 0.9375)  {     drawMoon(moon_x, moon_y, 7);   }; \/\/0.875   if (phase &gt; 0.9375 && phase &lt;= 1)       {     drawMoon(moon_x, moon_y, 0);   }; \/\/0.990  Almost new } \/\/===================================================================================== void drawSignal(float streng) {   display.fillRect(0, 0, 12, 6, WHITE);   display.drawTriangle(0, 0, 8, 0, 4, 4, BLACK);   display.drawLine(4, 0, 4, 6, BLACK);    display.drawLine(6, 5, 6, 6, BLACK);   display.drawLine(8, 4, 8, 6, BLACK);   display.drawLine(10, 2, 10, 6, BLACK);   display.drawLine(12, 0, 12, 6, BLACK);  } \/\/===================================================================================== void drawBatteryState(float v_bat) {   display.fillRect(68, 0, 16, 7, WHITE);   display.drawRect(83, 2, 1, 3, BLACK);   display.drawRoundRect(68, 0, 15, 7, 2, BLACK);   \/\/ 3, 44  4, 2 0, 76  0, 152   \/\/4,200 full  4   \/\/4,048       3   \/\/3,896       2   \/\/3,744       1   \/\/3,592       0   \/\/3,440 zero  -    if (v_bat &gt; 4500)   {     display.fillRect(70, 2, 10, 3, BLACK);   }   if (v_bat &gt; 4048)   {     display.drawRect(79, 2, 2, 3, BLACK);   }   if (v_bat &gt; 3896)   {     display.drawRect(76, 2, 2, 3, BLACK);   }   if (v_bat &gt; 3744)    {     display.drawRect(73, 2, 2, 3, BLACK);   }   if (v_bat &gt; 3592)    {     display.drawRect(70, 2, 2, 3, BLACK);   } } \/\/===================================================================================== void drawTime(byte x, byte y) {   display.fillRect(0 + x, 0 + y, 48, 7, WHITE);   \/\/display.fillRect(0+x, 0+y, 30, 7, WHITE);   Time t = rtc.time();   display.setTextColor(BLACK);   display.setTextSize(1);   display.setCursor(x, y);   display.print(t.hr);   display.print(&quot;:&quot;);   display.print(t.min);   display.print(&quot;:&quot;);   display.print(t.sec); } \/\/=========================================================================================== void updateMoonSunDate() {   Time t = rtc.time();   today[0] = 0;   today[1] = 0;   today[2] = 12;   today[3] = t.date;   today[4] = t.mon;   today[5] = t.yr - 2000; } \/\/===================================================================================== void drawSunRiseSet(byte x, byte y) {   updateMoonSunDate();   display.setTextSize(1);   display.setTextColor(BLACK);   display.fillRect(x, y, 33, y + 8, WHITE);    if (tardis.SunRise(today)) \/\/ if the sun will rise today (it might not, in the [ant]arctic)   {     display.setCursor(x, y);     display.print((int) today[tl_hour]);     display.print(&quot;:&quot;);     display.println((int) today[tl_minute]);   }   if (tardis.SunSet(today)) \/\/ if the sun will set today (it might not, in the [ant]arctic)   {     display.setCursor(x, y + 8);     display.print((int) today[tl_hour]);     display.print(&quot;:&quot;);     display.println((int) today[tl_minute]);   }  } \/\/===================================================================================== void drawPressure(byte x, byte y) {   display.setTextSize(1);   display.setTextColor(BLACK);   display.fillRect(x, y, 33, y + 8, WHITE);   display.setCursor(x, y);   t_f = Temperature;   display.println( t_f \/ 10, 1);   display.setCursor(x, y + 8);   \/\/display.println(ceil(Pressure \/ 133.3), 0);   display.println(Pressure \/ 133.3, 1); } \/\/===================================================================================== long readVcc() {   \/\/ Read 1.1V reference against AVcc   \/\/ set the reference to Vcc and the measurement to the internal 1.1V reference #if defined(__AVR_ATmega32U4__) || defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)   ADMUX = _BV(REFS0) | _BV(MUX4) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1); #elif defined (__AVR_ATtiny24__) || defined(__AVR_ATtiny44__) || defined(__AVR_ATtiny84__)   ADMUX = _BV(MUX5) | _BV(MUX0); #elif defined (__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__)   ADMUX = _BV(MUX3) | _BV(MUX2); #else   ADMUX = _BV(REFS0) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1); #endif    delay(75); \/\/ Wait for Vref to settle   ADCSRA |= _BV(ADSC); \/\/ Start conversion   while (bit_is_set(ADCSRA, ADSC)); \/\/ measuring    uint8_t low  = ADCL; \/\/ must read ADCL first - it then locks ADCH   uint8_t high = ADCH; \/\/ unlocks both    long result = (high &lt;&lt; 8) | low;    \/\/scale_constant = internal1.1Ref * 1023 * 1000   \/\/\u0433\u0434\u0435   \/\/internal1.1Ref = 1.1 * Vcc1 (\u043f\u043e\u043a\u0430\u0437\u0430\u043d\u0438\u044f_\u0432\u043e\u043b\u044c\u0442\u043c\u0435\u0442\u0440\u0430) \/ Vcc2 (\u043f\u043e\u043a\u0430\u0437\u0430\u043d\u0438\u044f_\u0444\u0443\u043d\u043a\u0446\u0438\u0438_readVcc())   \/\/4.967\/4600-------1215079.369565217   \/\/ result = 1125300L \/ result; \/\/ Calculate Vcc (in mV); 1125300 = 1.1*1023*100000   result = 1132060 \/ result;    return result; \/\/ Vcc in millivolts   \/\/http:\/\/blog.unlimite.net\/?p=25 } \/\/=========================================================================================== void drawVcc(byte x, byte y, word vcc) {   display.setTextSize(1);   display.setTextColor(BLACK);   display.fillRect(x, y, 33, y + 8, WHITE);   display.setCursor(x, y);   display.println(vcc); } \/\/===================================================================================== void pressure_drawLine(byte x, byte h) {   display.drawLine(x, 47 - h, x, 47, BLACK); } void pressure_drawGraph() {   display.fillRect(0, 25, 83, 47, WHITE);   for (int i = 0; i &lt;= 83; i++) {     pressure_drawLine(i, EEPROM.read(i));   } }  \/\/=========================================================================================== void setup() {   Serial.begin(9600);     pinMode(8, INPUT_PULLUP);   pinMode(9, INPUT_PULLUP);   pinMode(2, OUTPUT);   \/\/-----------------------------------------------------------------------------   \/\/rtc.writeProtect(false);   \/\/rtc.halt(false);   String day = dayAsString(t.day);   \/\/-----------------------------------------------------------------------------   tardis.TimeZone(3 * 55);   tardis.Position(LATITUDE, LONGITUDE);   \/\/-----------------------------------------------------------------------------   Wire.begin();   display.begin();   display.setContrast(55);   display.clearDisplay();    display.drawLine(0, display.height() \/ 2, display.width(), display.height() \/ 2, BLACK);   dps.init();    updateMoonSunDate();   drawMoonDate(34, 8, today);   pressure_drawGraph();   display.display();    prevHour = rtc.time().hr;   \/\/EEPROM.write(0, 9);   \/\/ for (int i=0; i &lt;= 83; i++){   \/\/ EEPROM.write(i, random(1, 23));   \/\/   pressure_drawLine(i,EEPROM.read(i));   \/\/     Serial.println(EEPROM.read(i));   \/\/ }  } \/\/===================================================================================== void loop() {   unsigned long currentMillis = millis();   unsigned long currentMillis2 = millis();   byte temp;    \/\/timer---------------------- 1 hour   \/\/  if (currentMillis - previousMillis &gt; interval) {   \/\/  previousMillis = currentMillis;   if (rtc.time().hr != prevHour) {     prevHour = rtc.time().hr;      dps.getPressure(&Pressure);     dps.getTemperature(&Temperature);      for (int i = 0; i &lt;= 82; i++) {       temp = EEPROM.read(i + 1);       EEPROM.write(i, temp);     }     EEPROM.write(83, ceil(Pressure \/ 133.3) - 740);     pressure_drawGraph();     display.display();     }   \/\/timer---------------------- 1 sec   \/\/ if (currentMillis2 - previousMillis2 &gt; interval2) {   \/\/   previousMillis2 = currentMillis2;    if (rtc.time().sec != prevSecond) {     prevSecond = rtc.time().sec;      dps.getPressure(&Pressure);     dps.getTemperature(&Temperature);     updateMoonSunDate();      drawPressure(0, 8);     drawTime(17, 0);     drawSunRiseSet(53, 8);     drawMoonDate(34, 8, today);     drawBatteryState(readVcc());     drawSignal(5);     \/\/    drawVcc(0, 16, readVcc());     display.display();   }   \/\/timer----------------------    buttonState = digitalRead(8);   \/\/ Serial.println(buttonState);   if (buttonState != lastButtonState) {     if (buttonState == HIGH) {       buttonPushCounter++;     }   }   lastButtonState = buttonState;   if (buttonPushCounter % 2 == 0) {     digitalWrite(2, HIGH);   } else {     digitalWrite(2, LOW);   } } \/\/===================================================================================== <\/code><\/pre>\n<p>  <\/div>\n<\/div>\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=\"https:\/\/geektimes.ru\/post\/274258\/\"> https:\/\/geektimes.ru\/post\/274258\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>       \u041d\u0430\u0432\u0435\u0440\u043d\u043e\u0435, \u043a\u0430\u0436\u0434\u044b\u0439 \u043a\u0442\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0441\u0432\u043e\u0435 \u0437\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u043e \u0441 Arduino, \u043f\u043e\u043c\u043e\u0440\u0433\u0430\u0432 \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u043e\u043c \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0432 \u043a\u043d\u043e\u043f\u043a\u0443, \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442 \u043a \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u0441\u0432\u043e\u0435\u0439 \u043c\u0435\u0442\u0435\u043e\u0441\u0442\u0430\u043d\u0446\u0438\u0438. \u041d\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u0441\u0442\u0430\u043b \u0438 \u044f. <\/p>\n<p>  \u041e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0432\u0448\u0438\u0441\u044c \u0441 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u043c\u0438 \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0435, \u0431\u044b\u043b\u0438 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f. \u0423\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u0432\u0440\u0435\u043c\u044f, \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0443, \u0434\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0438 \u0433\u0440\u0430\u0444\u0438\u043a \u0435\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f. \u0422\u0430\u043a\u0436\u0435 \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u0444\u0430\u0437\u044b \u043b\u0443\u043d\u044b \u0438 \u0432\u0440\u0435\u043c\u044f \u0432\u043e\u0441\u0445\u043e\u0434\u0430-\u0437\u0430\u0445\u043e\u0434\u0430 \u0441\u043e\u043b\u043d\u0446\u0430. \u0410 \u0441\u0430\u043c\u044b\u043c \u0432\u0430\u0436\u043d\u044b\u043c \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0431\u044b\u043b\u043e \u2013 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0441\u0442\u044c. \u0421\u043e\u0437\u0434\u0430\u0432\u0430\u0435\u043c\u0430\u044f \u043f\u043e\u0440\u0442\u0430\u0442\u0438\u0432\u043d\u0430\u044f \u043c\u0435\u0442\u0435\u043e\u0441\u0442\u0430\u043d\u0446\u0438\u044f \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u043b\u0430\u0441\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u043f\u043e\u043c\u043e\u0449\u044c \u0434\u043b\u044f \u0440\u044b\u0431\u0430\u043b\u043a\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u043b\u0430 \u0438\u043c\u0435\u0442\u044c \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u0438 \u043e\u0431\u043b\u0430\u0434\u0430\u0442\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0430\u0432\u0442\u043e\u043d\u043e\u043c\u043d\u043e\u0441\u0442\u044c\u044e.  <\/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-278191","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/278191","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=278191"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/278191\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=278191"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=278191"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=278191"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}