{"id":45109,"date":"2018-07-12T22:39:11","date_gmt":"2018-07-12T16:39:11","guid":{"rendered":"http:\/\/rcl-radio.ru\/?p=45109"},"modified":"2026-02-17T05:51:35","modified_gmt":"2026-02-16T23:51:35","slug":"%d0%b0%d1%86%d0%bf-%d0%bc%d0%be%d0%b4%d1%83%d0%bb%d1%8c-ads1115-arduino","status":"publish","type":"post","link":"http:\/\/rcl-radio.ru\/?p=45109","title":{"rendered":"\u0410\u0426\u041f-\u043c\u043e\u0434\u0443\u043b\u044c ADS1115 (Arduino)"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-45113 alignright\" src=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2018\/07\/28473658736298.png\" alt=\"\" width=\"137\" height=\"213\" \/>\u0410\u0426\u041f-\u043c\u043e\u0434\u0443\u043b\u044c ADS1115 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 16-\u0431\u0438\u0442\u043d\u044b\u0439\u00a0 \u0430\u043d\u0430\u043b\u043e\u0433\u043e-\u0446\u0438\u0444\u0440\u043e\u0432\u043e\u0439 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u043c\u0435\u0435\u0442 4 \u0432\u0445\u043e\u0434\u0430 \u0434\u043b\u044f \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0430\u043d\u0430\u043b\u043e\u0433\u043e\u0432\u044b\u0439 \u0441\u0438\u0433\u043d\u0430\u043b \u0432 \u0446\u0438\u0444\u0440\u043e\u0432\u043e\u0439.<\/p>\n<p>\u0410\u0426\u041f-\u043c\u043e\u0434\u0443\u043b\u044c ADS1115 \u043e\u0441\u043d\u043e\u0432\u0430\u043d \u043d\u0430 \u043e\u0434\u043d\u043e\u0438\u043c\u0435\u043d\u043d\u043e\u043c \u0447\u0438\u043f\u0435 \u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u043b\u044f \u0435\u0433\u043e \u0440\u0430\u0431\u043e\u0442\u044b \u0432\u043d\u0435\u0448\u043d\u0438\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b.\u00a0\u0410\u0426\u041f-\u043c\u043e\u0434\u0443\u043b\u044c\u00a0\u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c \u0441 I2C \u0448\u0438\u043d\u043e\u0439. \u041e\u0441\u043d\u0430\u0449\u0435\u043d \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u0443\u0435\u043c\u044b\u043c \u0443\u0441\u0438\u043b\u0438\u0442\u0435\u043b\u0435\u043c \u0438 \u0446\u0438\u0444\u0440\u043e\u0432\u044b\u043c \u043a\u043e\u043c\u043f\u0430\u0440\u0430\u0442\u043e\u0440\u043e\u043c. \u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u043e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c\u044e \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u0442 8 \u0434\u043e 860 \u0432\u044b\u0431\u043e\u0440\u043e\u043a \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0443 (SPS).\u00a0 \u0414\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u044b \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0441\u0438\u0433\u043d\u0430\u043b\u043e\u0432 \u043e\u0442 \u00b1 256 \u043c\u0412 \u0434\u043e \u00b1 6.144 \u0412. \u041f\u0438\u0442\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0443\u043b\u044f\u00a0 3,3 \u0412 \u0438\u043b\u0438 5 \u0412.<\/p>\n<p>\u0425\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0438 ADS1115:<\/p>\n<ul>\n<li>\u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435: 16 \u0431\u0438\u0442<\/li>\n<li>\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u0443\u0435\u043c\u0430\u044f \u0447\u0430\u0441\u0442\u043e\u0442\u0430 \u0434\u0438\u0441\u043a\u0440\u0435\u0442\u0438\u0437\u0430\u0446\u0438\u0438;<\/li>\n<li>\u043d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u0435 \u043f\u0438\u0442\u0430\u043d\u0438\u044f: 2.0V \u2013 5.5V;<\/li>\n<li>\u043d\u0438\u0437\u043a\u043e\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u043b\u0435\u043d\u0438\u0435 \u0442\u043e\u043a\u0430: 150 \u043c\u043a\u0410 \u0432 \u0440\u0430\u0431\u043e\u0447\u0435\u043c \u0440\u0435\u0436\u0438\u043c\u0435;<\/li>\n<li>\u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u043e\u043f\u043e\u0440\u043d\u043e\u0433\u043e \u043d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u044f;<\/li>\n<li>4 \u0432\u0445\u043e\u0434\u0430 (AIN0-AIN3), \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043a\u0430\u043a \u0434\u0432\u0430 \u0434\u0438\u0444\u0444\u0435\u0440\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0432\u0445\u043e\u0434\u0430 \u0434\u043b\u044f \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u043d\u043e\u0441\u0442\u0438 \u043d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u0432\u0445\u043e\u0434\u0430\u043c\u0438, \u043b\u0438\u0431\u043e \u043a\u0430\u043a 4 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u043d\u0435\u0441\u0438\u043c\u043c\u0435\u0442\u0440\u0438\u0447\u043d\u044b\u0445 \u0432\u0445\u043e\u0434\u0430, \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u0435 \u0438\u0437\u043c\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043c\u0435\u0436\u0434\u0443 \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u0432\u0445\u043e\u0434\u043e\u0432 \u0438 \u043e\u0431\u0449\u0438\u043c \u043f\u0440\u043e\u0432\u043e\u0434\u043e\u043c;<\/li>\n<li>\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u0439 \u043a\u043e\u043c\u043f\u0430\u0440\u0430\u0442\u043e\u0440;<\/li>\n<li>\u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u0443\u0441\u0438\u043b\u0438\u0442\u0435\u043b\u044c \u0432\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u0441\u0438\u0433\u043d\u0430\u043b\u0430 PGA: \u0434\u043e \u044516;<\/li>\n<li>\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 : I2C: 4-\u043a\u043e\u043d\u0442\u0430\u043a\u0442\u043d\u044b\u0439 \u043f\u043e \u0432\u044b\u0431\u043e\u0440\u0443 \u0430\u0434\u0440\u0435\u0441\u0430.<\/li>\n<\/ul>\n<blockquote>\n<div id=\"marketWidget\"><\/div>\n<p style=\"text-align: center;\">\u041f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043d\u0435\u0441\u0438\u043c\u043c\u0435\u0442\u0440\u0438\u0447\u043d\u043e\u0433\u043e \u0432\u0445\u043e\u0434\u0430 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0435 \u043d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0431\u0449\u0435\u0433\u043e \u043f\u0440\u043e\u0432\u043e\u0434\u0430, \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u0437\u043c\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u0435!!!<\/p>\n<\/blockquote>\n<p>&nbsp;<\/p>\n<blockquote>\n<p style=\"text-align: center;\">\u041c\u043e\u0434\u0443\u043b\u044c \u043e\u0447\u0435\u043d\u044c \u043a\u0440\u0438\u0442\u0438\u0447\u0435\u043d \u043a \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u044e \u043a\u0430\u043a \u043f\u043e \u0432\u0445\u043e\u0434\u0430\u043c, \u0442\u0430\u043a \u0438 \u043f\u043e \u043f\u0438\u0442\u0430\u043d\u0438\u044e. \u041f\u0440\u0435\u0432\u044b\u0448\u0435\u043d\u0438\u0435 \u043d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u044f \u0431\u043e\u043b\u0435\u0435 \u0447\u0435\u043c \u043d\u0430 5% \u043e\u0442 \u043d\u0430\u043f\u0440\u044f\u0436\u0435\u043d\u0438\u044f \u043f\u0438\u0442\u0430\u043d\u0438\u044f \u0432\u044b\u0432\u0435\u0434\u0435\u0442 \u0435\u0433\u043e \u0438\u0437 \u0441\u0442\u0440\u043e\u044f!!!<\/p>\n<\/blockquote>\n<p style=\"text-align: center;\"><strong>\u0421\u0445\u0435\u043c\u044b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f<\/strong><\/p>\n<p style=\"text-align: center;\"><strong>\u0414\u0438\u0444\u0444\u0435\u0440\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0432\u0445\u043e\u0434<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-45110 size-full\" src=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2018\/07\/1236574128.png\" alt=\"\" width=\"505\" height=\"418\" srcset=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2018\/07\/1236574128.png 505w, http:\/\/rcl-radio.ru\/wp-content\/uploads\/2018\/07\/1236574128-200x166.png 200w, http:\/\/rcl-radio.ru\/wp-content\/uploads\/2018\/07\/1236574128-500x414.png 500w\" sizes=\"auto, (max-width: 505px) 100vw, 505px\" \/><\/p>\n<pre class=\"actionscript\" style=\"font-family: monospace;\"><span style=\"color: #808080; font-style: italic;\">#include &lt;Wire.h&gt;<\/span>\r\n<span style=\"color: #808080; font-style: italic;\">#include &lt;Adafruit_ADS1015.h&gt;<\/span>\r\nAdafruit_ADS1115 ads; \r\n<span style=\"color: #808080; font-style: italic;\">\/*Adafruit_ADS1115 ads(0x48);          \u0437\u0430\u0434\u0430\u0439\u0442\u0435 \u0430\u0434\u0440\u0435\u0441 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \r\n\u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0430 I2C \u0448\u0438\u043d\u0435 (\u0435\u0441\u043b\u0438 \u0443\u0441\u0442-\u0432\u043e \u043e\u0434\u043d\u043e, \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u0430\u0434\u0440\u0435\u0441 \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e)*\/<\/span>\r\n<span style=\"color: #0066cc;\">void<\/span> setup<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #0066cc;\">void<\/span><span style=\"color: #66cc66;\">)<\/span>\r\n<span style=\"color: #66cc66;\">{<\/span>\r\n  Serial.<span style=\"color: #006600;\">begin<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">9600<\/span><span style=\"color: #66cc66;\">)<\/span>;\r\n\u00a0\r\n  <span style=\"color: #808080; font-style: italic;\">\/\/ ads.setGain(GAIN_TWOTHIRDS);  \/\/ 2\/3x gain +\/- 6.144V  1 bit =  0.1875mV (default)<\/span>\r\n  <span style=\"color: #808080; font-style: italic;\">\/\/ ads.setGain(GAIN_ONE);        \/\/ 1x gain   +\/- 4.096V  1 bit =  0.125mV<\/span>\r\n  ads.<span style=\"color: #0066cc;\">setGain<\/span><span style=\"color: #66cc66;\">(<\/span>GAIN_TWO<span style=\"color: #66cc66;\">)<\/span>;           <span style=\"color: #808080; font-style: italic;\">\/\/ 2x gain   +\/- 2.048V  1 bit =  0.0625mV<\/span>\r\n  <span style=\"color: #808080; font-style: italic;\">\/\/ ads.setGain(GAIN_FOUR);       \/\/ 4x gain   +\/- 1.024V  1 bit =  0.03125mV<\/span>\r\n  <span style=\"color: #808080; font-style: italic;\">\/\/ ads.setGain(GAIN_EIGHT);      \/\/ 8x gain   +\/- 0.512V  1 bit =  0.015625mV<\/span>\r\n  <span style=\"color: #808080; font-style: italic;\">\/\/ ads.setGain(GAIN_SIXTEEN);    \/\/ 16x gain  +\/- 0.256V  1 bit =  0.0078125mV<\/span>\r\n   ads.<span style=\"color: #006600;\">begin<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span>;\r\n<span style=\"color: #66cc66;\">}<\/span>\r\n  int16_t results;\r\n  float multiplier = 0.0625F; <span style=\"color: #808080; font-style: italic;\">\/\/ \u0432\u044b\u0431\u0440\u0430\u043d \u043f\u0440\u0435\u0434\u0435\u043b +\/- 2.048V\r\n<\/span>\r\n<span style=\"color: #0066cc;\">void<\/span> loop<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #0066cc;\">void<\/span><span style=\"color: #66cc66;\">)<\/span><span style=\"color: #66cc66;\">{<\/span>\r\n  results = ads.<span style=\"color: #006600;\">readADC_Differential_0_1<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span>;  \r\n  Serial.<span style=\"color: #0066cc;\">print<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #ff0000;\">\"Differential: \"<\/span><span style=\"color: #66cc66;\">)<\/span>; \r\n  Serial.<span style=\"color: #0066cc;\">print<\/span><span style=\"color: #66cc66;\">(<\/span>results<span style=\"color: #66cc66;\">)<\/span>; Serial.<span style=\"color: #0066cc;\">print<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #ff0000;\">\"(\"<\/span><span style=\"color: #66cc66;\">)<\/span>; \r\n  Serial.<span style=\"color: #0066cc;\">print<\/span><span style=\"color: #66cc66;\">(<\/span>results <span style=\"color: #66cc66;\">*<\/span> multiplier<span style=\"color: #66cc66;\">)<\/span>; \r\n  Serial.<span style=\"color: #006600;\">println<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #ff0000;\">\"mV)\"<\/span><span style=\"color: #66cc66;\">)<\/span>;\r\n  delay<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">1000<\/span><span style=\"color: #66cc66;\">)<\/span>;\r\n<span style=\"color: #66cc66;\">}<\/span><\/pre>\n<p style=\"text-align: center;\">\u041d\u0435\u0441\u0438\u043c\u043c\u0435\u0442\u0440\u0438\u0447\u043d\u044b\u0435 \u0432\u0445\u043e\u0434<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-45111 size-full\" src=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2018\/07\/43726786234789.png\" alt=\"\" width=\"499\" height=\"427\" srcset=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2018\/07\/43726786234789.png 499w, http:\/\/rcl-radio.ru\/wp-content\/uploads\/2018\/07\/43726786234789-200x171.png 200w\" sizes=\"auto, (max-width: 499px) 100vw, 499px\" \/><\/p>\n<pre class=\"actionscript\" style=\"font-family: monospace;\"><span style=\"color: #808080; font-style: italic;\">#include &lt;Wire.h&gt;<\/span>\r\n<span style=\"color: #808080; font-style: italic;\">#include &lt;Adafruit_ADS1015.h&gt;<\/span>\r\nAdafruit_ADS1115 ads; \r\n<span style=\"color: #808080; font-style: italic;\">\/*Adafruit_ADS1115 ads(0x48);          \u0437\u0430\u0434\u0430\u0439\u0442\u0435 \u0430\u0434\u0440\u0435\u0441 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \r\n\u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0430 I2C \u0448\u0438\u043d\u0435 (\u0435\u0441\u043b\u0438 \u0443\u0441\u0442-\u0432\u043e \u043e\u0434\u043d\u043e, \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u0430\u0434\u0440\u0435\u0441 \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e)*\/<\/span>\r\n\r\n<span style=\"color: #0066cc;\">void<\/span> setup<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #0066cc;\">void<\/span><span style=\"color: #66cc66;\">)<\/span> <span style=\"color: #66cc66;\">{<\/span>\r\n  Serial.<span style=\"color: #006600;\">begin<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">9600<\/span><span style=\"color: #66cc66;\">)<\/span>;\r\n\u00a0\r\n  <span style=\"color: #808080; font-style: italic;\">\/\/ ads.setGain(GAIN_TWOTHIRDS);  \/\/ 2\/3x gain +\/- 6.144V  1 bit = 0.1875mV (default)<\/span>\r\n  <span style=\"color: #808080; font-style: italic;\">\/\/ ads.setGain(GAIN_ONE);        \/\/ 1x gain   +\/- 4.096V  1 bit = 0.125mV<\/span>\r\n   ads.<span style=\"color: #0066cc;\">setGain<\/span><span style=\"color: #66cc66;\">(<\/span>GAIN_TWO<span style=\"color: #66cc66;\">)<\/span>;          <span style=\"color: #808080; font-style: italic;\">\/\/ 2x gain   +\/- 2.048V  1 bit = 0.0625mV<\/span>\r\n  <span style=\"color: #808080; font-style: italic;\">\/\/ ads.setGain(GAIN_FOUR);       \/\/ 4x gain   +\/- 1.024V  1 bit = 0.03125mV<\/span>\r\n  <span style=\"color: #808080; font-style: italic;\">\/\/ ads.setGain(GAIN_EIGHT);      \/\/ 8x gain   +\/- 0.512V  1 bit = 0.015625mV<\/span>\r\n  <span style=\"color: #808080; font-style: italic;\">\/\/ ads.setGain(GAIN_SIXTEEN);    \/\/ 16x gain  +\/- 0.256V  1 bit = 0.0078125mV<\/span>\r\n\u00a0\r\n  ads.<span style=\"color: #006600;\">begin<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #66cc66;\">)<\/span>;\r\n<span style=\"color: #66cc66;\">}<\/span>\r\nint16_t adc0, adc1, adc2, adc3;\r\n<span style=\"color: #0066cc;\">void<\/span> loop<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #0066cc;\">void<\/span><span style=\"color: #66cc66;\">)<\/span> <span style=\"color: #66cc66;\">{<\/span>\r\n  adc0 = ads.<span style=\"color: #006600;\">readADC_SingleEnded<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">0<\/span><span style=\"color: #66cc66;\">)<\/span>;\r\n  adc1 = ads.<span style=\"color: #006600;\">readADC_SingleEnded<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">1<\/span><span style=\"color: #66cc66;\">)<\/span>;\r\n  adc2 = ads.<span style=\"color: #006600;\">readADC_SingleEnded<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">2<\/span><span style=\"color: #66cc66;\">)<\/span>;\r\n  adc3 = ads.<span style=\"color: #006600;\">readADC_SingleEnded<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">3<\/span><span style=\"color: #66cc66;\">)<\/span>;\r\n  Serial.<span style=\"color: #0066cc;\">print<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #ff0000;\">\"AIN0: \"<\/span><span style=\"color: #66cc66;\">)<\/span>; Serial.<span style=\"color: #006600;\">println<\/span><span style=\"color: #66cc66;\">(<\/span>adc0<span style=\"color: #66cc66;\">)<\/span>;\r\n  Serial.<span style=\"color: #0066cc;\">print<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #ff0000;\">\"AIN1: \"<\/span><span style=\"color: #66cc66;\">)<\/span>; Serial.<span style=\"color: #006600;\">println<\/span><span style=\"color: #66cc66;\">(<\/span>adc1<span style=\"color: #66cc66;\">)<\/span>;\r\n  Serial.<span style=\"color: #0066cc;\">print<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #ff0000;\">\"AIN2: \"<\/span><span style=\"color: #66cc66;\">)<\/span>; Serial.<span style=\"color: #006600;\">println<\/span><span style=\"color: #66cc66;\">(<\/span>adc2<span style=\"color: #66cc66;\">)<\/span>;\r\n  Serial.<span style=\"color: #0066cc;\">print<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #ff0000;\">\"AIN3: \"<\/span><span style=\"color: #66cc66;\">)<\/span>; Serial.<span style=\"color: #006600;\">println<\/span><span style=\"color: #66cc66;\">(<\/span>adc3<span style=\"color: #66cc66;\">)<\/span>;\r\n  Serial.<span style=\"color: #006600;\">println<\/span><span style=\"color: #66cc66;\">(<\/span><span style=\"color: #ff0000;\">\" \"<\/span><span style=\"color: #66cc66;\">)<\/span>;\r\n\u00a0\r\n  delay<span style=\"color: #66cc66;\">(<\/span><span style=\"color: #cc66cc;\">1000<\/span><span style=\"color: #66cc66;\">)<\/span>;\r\n<span style=\"color: #66cc66;\">}<\/span><\/pre>\n<p style=\"text-align: center;\"><strong>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0434\u0430\u0442\u0447\u0438\u043a\u0430 \u043a Arduino \u0441 \u0440\u0430\u0437\u043d\u044b\u043c \u0430\u0434\u0440\u0435\u0441\u0430\u043c\u0438 I2C<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-45112 size-full\" src=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2018\/07\/87947869871.png\" alt=\"\" width=\"519\" height=\"394\" srcset=\"http:\/\/rcl-radio.ru\/wp-content\/uploads\/2018\/07\/87947869871.png 519w, http:\/\/rcl-radio.ru\/wp-content\/uploads\/2018\/07\/87947869871-200x152.png 200w, http:\/\/rcl-radio.ru\/wp-content\/uploads\/2018\/07\/87947869871-500x380.png 500w\" sizes=\"auto, (max-width: 519px) 100vw, 519px\" \/><\/p>\n<p>\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 &#8212;\u00a0<a href=\"https:\/\/github.com\/addicore\/ADS1115\/archive\/master.zip\">https:\/\/github.com\/addicore\/ADS1115\/archive\/master.zip<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0410\u0426\u041f-\u043c\u043e\u0434\u0443\u043b\u044c ADS1115 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 16-\u0431\u0438\u0442\u043d\u044b\u0439\u00a0 \u0430\u043d\u0430\u043b\u043e\u0433\u043e-\u0446\u0438\u0444\u0440\u043e\u0432\u043e\u0439 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u043c\u0435\u0435\u0442 4 \u0432\u0445\u043e\u0434\u0430 \u0434\u043b\u044f \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0430\u043d\u0430\u043b\u043e\u0433\u043e\u0432\u044b\u0439 \u0441\u0438\u0433\u043d\u0430\u043b \u0432 \u0446\u0438\u0444\u0440\u043e\u0432\u043e\u0439. \u0410\u0426\u041f-\u043c\u043e\u0434\u0443\u043b\u044c ADS1115 \u043e\u0441\u043d\u043e\u0432\u0430\u043d \u043d\u0430 \u043e\u0434\u043d\u043e\u0438\u043c\u0435\u043d\u043d\u043e\u043c \u0447\u0438\u043f\u0435 \u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u043b\u044f \u0435\u0433\u043e \u0440\u0430\u0431\u043e\u0442\u044b \u0432\u043d\u0435\u0448\u043d\u0438\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b.\u00a0\u0410\u0426\u041f-\u043c\u043e\u0434\u0443\u043b\u044c\u00a0\u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c \u0441 I2C \u0448\u0438\u043d\u043e\u0439. \u041e\u0441\u043d\u0430\u0449\u0435\u043d \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u0443\u0435\u043c\u044b\u043c \u0443\u0441\u0438\u043b\u0438\u0442\u0435\u043b\u0435\u043c \u0438 \u0446\u0438\u0444\u0440\u043e\u0432\u044b\u043c \u043a\u043e\u043c\u043f\u0430\u0440\u0430\u0442\u043e\u0440\u043e\u043c. \u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u043e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c\u044e \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u0442 8 \u0434\u043e 860 \u0432\u044b\u0431\u043e\u0440\u043e\u043a \u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0443 (SPS).\u00a0 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":45113,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[239],"tags":[],"class_list":["post-45109","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-arduino"],"views":20475,"_links":{"self":[{"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/posts\/45109","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=45109"}],"version-history":[{"count":6,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/posts\/45109\/revisions"}],"predecessor-version":[{"id":111566,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/posts\/45109\/revisions\/111566"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=\/wp\/v2\/media\/45113"}],"wp:attachment":[{"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=45109"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=45109"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/rcl-radio.ru\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=45109"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}