{"id":3166,"date":"2014-09-07T22:43:54","date_gmt":"2014-09-07T13:43:54","guid":{"rendered":"http:\/\/www.syuheiuda.com\/?p=3166"},"modified":"2014-09-07T22:43:54","modified_gmt":"2014-09-07T13:43:54","slug":"windows-for-iot-%e3%81%a7-analogread-analogwrite","status":"publish","type":"post","link":"https:\/\/www.syuheiuda.com\/?p=3166","title":{"rendered":"Windows for IoT \u3067 analogRead \/ analogWrite"},"content":{"rendered":"<p>[\u53c2\u8003] : <a title=\"http:\/\/kousaku-kousaku.blogspot.jp\/2008\/05\/arduino_26.html\" href=\"http:\/\/kousaku-kousaku.blogspot.jp\/2008\/05\/arduino_26.html\">http:\/\/kousaku-kousaku.blogspot.jp\/2008\/05\/arduino_26.html<\/a><\/p>\n<p>(Arduino \u754c\u9688\u3067\u306f\u8d85\u6709\u540d\u306a\u5efa\u7bc9\u767a\u660e\u5de5\u4f5c\u30bc\u30df\u69d8\u3067\u3059\u3002)<\/p>\n<p><\/p>\n<p>\u53ef\u5909\u62b5\u6297\u306e\u5165\u529b\u5024\u3092\u57fa\u306b\u3001LED \u306e\u660e\u308b\u3055\u3092\u5909\u3048\u3066\u307f\u308b\u3060\u3051\u306e\u30b7\u30f3\u30d7\u30eb\u306a\u30b5\u30f3\u30d7\u30eb\u3067\u3059\u3002<\/p>\n<p>Arduino \u3067\u306f\u3000analogRead() \u306f 1024 \u6bb5\u968e\u3067\u3057\u305f\u304c\u3001Intel Galileo \u306f 4096 \u6bb5\u968e\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u306d\u3002<br \/>[\u53c2\u8003] : <a title=\"http:\/\/arduino.cc\/en\/ArduinoCertified\/IntelGalileo\" href=\"http:\/\/arduino.cc\/en\/ArduinoCertified\/IntelGalileo\">http:\/\/arduino.cc\/en\/ArduinoCertified\/IntelGalileo<\/a><\/p>\n<p>analogWrite() \u306f\u60c5\u5831\u898b\u3064\u304b\u3089\u306a\u3044\u306e\u3067\u3059\u304c\u3001\u3068\u308a\u3042\u3048\u305a 256 \u6bb5\u968e\u3063\u3066\u3053\u3068\u3067\u3001\u4ee5\u4e0b\u306e\u4f8b\u3067\u306f 16 \u3067\u5272\u3063\u3066\u4f7f\u3063\u3066\u307e\u3059\u30024096 \u6bb5\u968e\u51fa\u305b\u3066\u308b\u3088\u3046\u306a\u6c17\u304c\u3057\u306a\u3044\u3067\u3082\u306a\u3044\u3051\u308c\u3069\u3002\u3002\u3002<\/p>\n<p>\u3042\u3068\u3001PWM \u51fa\u6765\u308b\u30d4\u30f3\u306f 3, 5, 6, 9, 10, 11 \u3067\u3059\u3002<br \/>\u30d4\u30f3\u306e\u756a\u53f7\u306e\u3068\u3053\u308d\u306b ~ \u304c\u3064\u3044\u3066\u308b\u306e\u304c PWM \u5bfe\u5fdc\u3063\u3066\u3053\u3068\u307f\u305f\u3044\u3002<\/p>\n<p>\u56de\u8def\u56f3\u3092\u30b5\u30af\u3063\u3068\u66f8\u3051\u308b fritzing \u3060\u3068\u300113 \u3082 ~ \u3064\u3044\u3066\u308b\u3093\u3067\u3059\u304c\u3001\u30c0\u30e1\u305d\u3046\u3002<br \/>Visual Studio \u3067\u306a\u305c\u304b\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30a8\u30e9\u30fc\u304c\u51fa\u3066\u304a\u304b\u3057\u3044\u306a\u3041\u3068\u601d\u3063\u3066 30 \u5206\u304f\u3089\u3044\u60a9\u3093\u3060\u306e\u3067\u3057\u305f\u3002<\/p>\n<blockquote>\n<p>First-chance exception at 0x775D0F63 in analogIO.exe: Microsoft C++ exception: _arduino_fatal_error at memory location 0x00CCF69C.<\/p>\n<\/blockquote>\n<p><\/p>\n<p><a href=\"https:\/\/blob.syuheiuda.com\/wp-content\/2014\/09\/analogRead.png\"><img decoding=\"async\" loading=\"lazy\" width=\"469\" height=\"480\" title=\"analogRead\" style=\"border: 0px currentcolor; border-image: none; display: inline;\" alt=\"analogRead\" src=\"https:\/\/blob.syuheiuda.com\/wp-content\/2014\/09\/analogRead_thumb.png\" border=\"0\"><\/a>\n<\/p>\n<p><\/p>\n<pre><pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\n\/\/ Main.cpp : Defines the entry point for the console application.\n\/\/\n\n#include &quot;stdafx.h&quot;\n#include &quot;arduino.h&quot;\n\nint _tmain(int argc, _TCHAR* argv&#x5B;])\n{\n    return RunArduinoSketch();\n}\n\nint led = 3;  \/\/ This is the pin the LED is attached to.\nint val = 0;\n\nvoid setup()\n{\n\n}\n\n\/\/ the loop routine runs over and over again forever:\nvoid loop()\n{\n\tval = analogRead(0);\n\tLog(L&quot;analogRead value = %dn&quot;, val);\n    analogWrite(led, val\/16);\n    Log(L&quot;analogWriten&quot;);\n    delay(100);\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>[\u53c2\u8003] : http:\/\/kousaku-kousaku.blogspot.j&hellip;<\/p>\n<p class=\"more-link-p\"><a class=\"more-link\" href=\"https:\/\/www.syuheiuda.com\/?p=3166\">Read more &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_locale":"","_original_post":""},"categories":[4,8,18],"tags":[],"views":4542,"_links":{"self":[{"href":"https:\/\/www.syuheiuda.com\/index.php?rest_route=\/wp\/v2\/posts\/3166"}],"collection":[{"href":"https:\/\/www.syuheiuda.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.syuheiuda.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.syuheiuda.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.syuheiuda.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3166"}],"version-history":[{"count":0,"href":"https:\/\/www.syuheiuda.com\/index.php?rest_route=\/wp\/v2\/posts\/3166\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.syuheiuda.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3166"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.syuheiuda.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3166"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.syuheiuda.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3166"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}