\u524d\u56de\u4f5c\u3063\u305f\u3084\u3064<\/a>\u3068\u540c\u3058\u3088\u3046\u306b\u3001ESP8266 \u306e\u4e0a\u306b\u8f09\u308b\u611f\u3058\u3002<\/p>\n <\/p>\n
<\/p>\n
<\/p>\n<\/p>\n
UART \u306ePIN\u914d\u5217\u306f\u3001\u30d6\u30ec\u30c3\u30c9\u30dc\u30fc\u30c9\u306b\u633f\u3057\u305f\u3068\u304d\u306b\u4e0a\u304b\u3089LED\u304c\u898b\u3048\u308b\u306b\u914d\u5217\u3092\u9006\u306b\u3057\u307e\u3057\u305f\u3002\u3042\u3068\u3001UART \u304b\u3089\u306e\u4fe1\u53f7\u306eDTR\u3092\u4e00\u5de5\u592b\u3057\u3066\u3001\u30ea\u30bb\u30c3\u30c8\u3092\u62bc\u3055\u306a\u304f\u3066\u3082\u3001\u66f8\u304d\u8fbc\u307f\u30e2\u30fc\u30c9\u306b\u306a\u308b\u3088\u3046\u306b\u56de\u8def\u3092\u7d44\u3093\u3067\u304a\u3057\u307e\u3044\u3067\u3059\u3002<\/p>\n
<\/p>\n
\u4ed6\u3001\u4f55\u304b\u5fd8\u308c\u3066\u3044\u308b\u3088\u3046\u306a\u6c17\u3082\u3057\u307e\u3059\u304c\u3001\u6700\u5f8c\u306e\u70b9\u691c\u3067\u30c1\u30a7\u30c3\u30af\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n
\u73fe\u6642\u70b9\u3067\u3001\u5fd8\u308c\u3066\u3044\u308b\u3082\u306e\u3002<\/p>\n
\u30fb\u30e1\u30a4\u30f3\u30b9\u30a4\u30c3\u30c1<\/p>\n
\u30fbCDS \u306e\u8abf\u6574\u7528\u3001\u534a\u56fa\u5b9a\u62b5\u6297<\/p>\n
\u30fbWEB \u30a2\u30af\u30bb\u30b9\u306eLED\u3068\u3001WiFi \u30a2\u30af\u30bb\u30b9\u306eLED \uff08\u3092\u3064\u3051\u308b\u304b\u3069\u3046\u304b\uff09<\/p>\n
\u30fbEN Pin \u306e\u914d\u7dda<\/p>\n
<\/p>\n
\u6700\u5f8c\u306b\u5c11\u3057\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u6539\u826f\u3057\u305f\u306e\u3092\u30e1\u30e2\u3002\u307e\u308c\u306b\u3001ADC\u5024\u304c\u5909\u306a\u306e\u3067\u300110\u56de\u306e\u5e73\u5747\u5024\u3092\u51fa\u3057\u3066\u3044\u307e\u3059\u3002ESP12\u3067\u30c6\u30b9\u30c8\u3057\u3066\u3044\u308b\u306e\u3067\u3001ESP13 \u3060\u3068\u3069\u3046\u3044\u3046\u52d5\u304d\u306b\u306a\u308b\u304b\u306f\u3001\u5b9f\u969b\u306b\u30e2\u30ce\u304c\u7740\u3066\u304b\u3089\u30c6\u30b9\u30c8\u3002<\/p>\n
\/*\n ADC Read Sample2.\n Fairchild Semiconductor FSA3357 adc Select.\n Arduino IDE 1.6.5 Hourly Build 2015\/06\/12 03:13\n esp8266 by ESP8266 Community version 1.6.5 Hourly Build 2015\/06\/12\n JunkHack 2015.10.11\n\n --- ex Serial output.\n >adc3(B2)\n ADC3 mv\/10: 0 : 476\n 1 : 475\n 2 : 474\n 3 : 474\n 4 : 474\n 5 : 474\n 6 : 474\n 7 : 474\n 8 : 474\n 9 : 474\n 3139\n >adc off\n ::\n\n *\/\n\n#include <ESP8266WiFi.h>\n\nint ledState = LOW; \nunsigned long previousMillis = 0;\nconst long interval = 200; \/\/1sec\n\n\/******************************************************\n * \n *\/\nvoid setup() {\n pinMode(BUILTIN_LED, OUTPUT);\n Serial.begin(115200);\n delay(10);\n}\n\nint value = 0;\nint count = 0;\n\n\/******************************************************\n * \n *\/\nvoid loop()\n{\n \/\/ Select ADC source off.\n adcset(0);\n delay(interval);\n ++value;\n \n unsigned long currentMillis = millis();\n if(currentMillis - previousMillis >= interval) {\n previousMillis = currentMillis; \n if (ledState == LOW){\n ledState = HIGH; \/\/ Note that this switches the LED *off*\n } else {\n ledState = LOW; \/\/ Note that this switches the LED *on*\n digitalWrite(BUILTIN_LED, ledState);\n delay(1);\n count += 1;\n Serial.print("Blink Count: ");\n Serial.println(count);\n }\n }\n\n \/\/ Select ADC source.\n adcset(1);\n delay(interval);\n Serial.print("ADC1 mv\/10: ");\n Serial.println(getMv());\n\n adcset(2);\n delay(interval);\n Serial.print("ADC2 mv\/10: ");\n Serial.println(getMv());\n\n adcset(3);\n delay(interval);\n Serial.print("ADC3 mv\/10: ");\n Serial.println(getMv());\n}\n\n\/******************************************************\n * Fairchild Semiconductor FSA3357 adc Select.\n * 0 = No Connection\n * 1 = B0 to A\n * 2 = B1 to A\n * 3 = B2 to A\n *\/\nconst int S1 = 14; \/\/ S1 to GPIO Pin\nconst int S2 = 16; \/\/ S2 to GPIO Pin\n\nvoid adcset(int port) {\n pinMode(S1, OUTPUT);\n pinMode(S2, OUTPUT);\n \n switch (port){\n case 1:\n digitalWrite(S1, HIGH);\n delay(10);\n digitalWrite(S2, LOW);\n Serial.println(">adc1(B0)");\n break;\n case 2:\n digitalWrite(S1, LOW);\n delay(10);\n digitalWrite(S2, HIGH);\n Serial.println(">adc2(B1)");\n break;\n case 3:\n digitalWrite(S1, HIGH);\n delay(10);\n digitalWrite(S2, HIGH);\n Serial.println(">adc3(B2)");\n break;\n case 0:\n digitalWrite(S1, LOW);\n delay(10);\n digitalWrite(S2, LOW);\n Serial.println(">adc off");\n break;\n }\n}\n\n\/******************************************************\n * It reads the 10 times of the average value.\n *\/\nint getMv(){\n \/\/ correct an error in the resistance value.\n const int CORRECT = 10030;\n\n int mv = -1;\n int i;\n int adc = 0;\n \n for (i = 0; i<10; i++ ){\n adc = 0;\n \n \/\/Battery voltage is divided by an 5.6K\/1K resistor divider.\n \/\/ADC: 1024 = 1V\n adc = analogRead(A0);\n \/\/delay(10);\n\/\/ Serial.print(i);\n\/\/ Serial.print(" : ");\n\/\/ Serial.println(adc);\n mv += (adc*CORRECT*6.6)\/10000;\n \/\/ ^^^^^To correct an error in the resistance value\n }\n\n mv = mv \/ 10;\n\n return mv;\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"\u5916\u90e8\u306eADC\u3092\u5229\u7528\u305b\u305a\u3001\u30b9\u30a4\u30c3\u30c1\u3092\u3064\u3051\u3066\u5185\u90e8\u306eADC\u3092\u5229\u7528\u3059\u308b\u3068\u3044\u3046\u30a2\u30d7\u30ed\u30fc\u30c1\u304c\u4ee5\u4e0b\u306b\u3042\u308a\u307e\u3057\u305f\u3002 TINKERING WITH TECHNOLOGY WHEN YOU NEED MULTIPLE ANALOG INPU […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_uag_custom_page_level_css":"","footnotes":""},"categories":[10,30,63,64],"tags":[],"acf":[],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false,"post-thumbnail":false},"uagb_author_info":{"display_name":"JunkHack","author_link":"https:\/\/hack.gpl.jp\/author\/junkhack\/"},"uagb_comment_info":0,"uagb_excerpt":"\u5916\u90e8\u306eADC\u3092\u5229\u7528\u305b\u305a\u3001\u30b9\u30a4\u30c3\u30c1\u3092\u3064\u3051\u3066\u5185\u90e8\u306eADC\u3092\u5229\u7528\u3059\u308b\u3068\u3044\u3046\u30a2\u30d7\u30ed\u30fc\u30c1\u304c\u4ee5\u4e0b\u306b\u3042\u308a\u307e\u3057\u305f\u3002 TINKE…","_links":{"self":[{"href":"https:\/\/hack.gpl.jp\/wp-json\/wp\/v2\/posts\/1321"}],"collection":[{"href":"https:\/\/hack.gpl.jp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hack.gpl.jp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hack.gpl.jp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hack.gpl.jp\/wp-json\/wp\/v2\/comments?post=1321"}],"version-history":[{"count":0,"href":"https:\/\/hack.gpl.jp\/wp-json\/wp\/v2\/posts\/1321\/revisions"}],"wp:attachment":[{"href":"https:\/\/hack.gpl.jp\/wp-json\/wp\/v2\/media?parent=1321"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hack.gpl.jp\/wp-json\/wp\/v2\/categories?post=1321"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hack.gpl.jp\/wp-json\/wp\/v2\/tags?post=1321"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}