{"id":465,"date":"2015-12-08T00:24:31","date_gmt":"2015-12-07T15:24:31","guid":{"rendered":"http:\/\/www.typea.info\/blog\/index.php\/2015\/12\/08\/raspberry_pi_2_windows_10_iot_l\/"},"modified":"2015-12-08T00:24:31","modified_gmt":"2015-12-07T15:24:31","slug":"raspberry_pi_2_windows_10_iot_l","status":"publish","type":"post","link":"https:\/\/www.typea.info\/blog\/index.php\/2015\/12\/08\/raspberry_pi_2_windows_10_iot_l\/","title":{"rendered":"Raspberry Pi 2 + Windows 10 IoT \u3067 L\u30c1\u30ab\u30c1\u30ab!"},"content":{"rendered":"<p><a href=\"https:\/\/www.typea.info\/blog\/index.php\/2015\/11\/30\/raspberry_pi_2_windows_iot\">Raspberry Pi 2 \u3092\u8cfc\u5165\u3057\u3001Windows IoT Core \u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u6210\u529f\u3057\u305f<\/a> \u306e\u3067\u3001\u6b21\u306f\u306a\u3093\u304b<\/p>\n<p>\u30bb\u30f3\u30b5\u30fc\u306a\u3093\u304b\u3092\u3064\u306a\u3044\u3060\u308a\u3057\u3066\u307f\u305f\u308a\u3057\u305f\u3044\u306a\u3041\u3068\u3002<\/p>\n<h2>1.Raspberry Pi 2 \u7528\u30bb\u30f3\u30b5\u30fc\u30ad\u30c3\u30c8\u8cfc\u5165<\/h2>\n<p>Raspberry Pi 2 \u7528\u306e\u30bb\u30f3\u30b5\u30fc\u8a70\u3081\u5408\u308f\u305b\u307f\u305f\u3044\u306a\u306e\u3092\u8cfc\u5165\u3057\u3066\u307f\u305f\u30022,000\u5186\u7a0b\u5ea6\u3068\u304a\u5024\u3054\u308d\u3002<\/p>\n<p><a href=\"http:\/\/www.amazon.co.jp\/gp\/product\/B00G86DOP8\/ref=as_li_ss_il?ie=UTF8&amp;camp=247&amp;creative=7399&amp;creativeASIN=B00G86DOP8&amp;linkCode=as2&amp;tag=typea09-22\" rel=\"nofollow\"><img decoding=\"async\" border=\"0\" src=\"http:\/\/ws-fe.amazon-adsystem.com\/widgets\/q?_encoding=UTF8&amp;ASIN=B00G86DOP8&amp;Format=_SL160_&amp;ID=AsinImage&amp;MarketPlace=JP&amp;ServiceVersion=20070822&amp;WS=1&amp;tag=typea09-22\"><\/a><img loading=\"lazy\" decoding=\"async\" style=\"border-top-style: none !important; border-left-style: none !important; border-bottom-style: none !important; border-right-style: none !important; margin: 0px\" border=\"0\" alt=\"\" src=\"http:\/\/ir-jp.amazon-adsystem.com\/e\/ir?t=typea09-22&amp;l=as2&amp;o=9&amp;a=B00G86DOP8\" width=\"1\" height=\"1\"> <\/p>\n<p><a href=\"http:\/\/www.amazon.co.jp\/gp\/product\/B00G86DOP8\/ref=as_li_ss_tl?ie=UTF8&amp;camp=247&amp;creative=7399&amp;creativeASIN=B00G86DOP8&amp;linkCode=as2&amp;tag=typea09-22\" rel=\"nofollow\">\u30cf\u30c3\u30af \u30e9\u30ba\u30d9\u30ea\u30fc\u30d1\u30a4 Raspberry Pi \u96fb\u5b50\u5de5\u4f5c\u5165\u9580\u30ad\u30c3\u30c8\u3002<\/a><img loading=\"lazy\" decoding=\"async\" style=\"border-top-style: none !important; border-left-style: none !important; border-bottom-style: none !important; border-right-style: none !important; margin: 0px\" border=\"0\" alt=\"\" src=\"http:\/\/ir-jp.amazon-adsystem.com\/e\/ir?t=typea09-22&amp;l=as2&amp;o=9&amp;a=B00G86DOP8\" width=\"1\" height=\"1\"> <\/p>\n<p><a href=\"http:\/\/typea.info\/blg\/glob\/Windows-Live-Writer\/Windows-IoT--L_14687\/sensors_2.jpg\"><img loading=\"lazy\" decoding=\"async\" title=\"sensors\" style=\"border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px\" border=\"0\" alt=\"sensors\" src=\"http:\/\/typea.info\/blg\/glob\/Windows-Live-Writer\/Windows-IoT--L_14687\/sensors_thumb.jpg\" width=\"244\" height=\"148\"><\/a><\/p>\n<p>\u5c4a\u3044\u305f\uff01<\/p>\n<p>\u96fb\u5b50\u5de5\u4f5c\u3067\u306e\u3001Hello World \u306f\u3069\u3046\u3084\u3089 L\u30c1\u30ab\u3068\u304b\u3044\u3063\u3066\u3001LED\u3092\u30c1\u30ab\u30c1\u30ab\u3055\u305b\u308b\u3053\u3068\u3089\u3057\u3044\u3002<\/p>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u4e0a\u8a18\u30bb\u30f3\u30b5\u30fc\u30ad\u30c3\u30c8\u306e\u8aac\u660e\u66f8\u7684\u306a\u4f4d\u7f6e\u3065\u3051\u306e\u30d6\u30ed\u30b0\u3001<\/p>\n<p><a href=\"http:\/\/lchikaamazon.hatenablog.com\/entry\/2013\/11\/18\/171637\">Raspberry Pi\u3067LED\u70b9\u706f\uff08L\u30c1\u30ab\uff09\u3057\u3066\u307f\u3088\u3046\u3002<\/a><\/p>\n<p>\u3092\u53c2\u7167\u3057\u3066\u3001\u898b\u305f\u3001\u3001\u3001\u304c\u3001\u3044\u307e\u3072\u3068\u3064\u3046\u307e\u304f\u52d5\u304b\u306a\u3044\u3002\u3002\u3002<\/p>\n<p><a href=\"http:\/\/deviceplus.jp\/hobby\/raspberrypi_entry_009\/\">\u7b2c9\u56de\u300c\u30e9\u30ba\u30d9\u30ea\u30fc\u30d1\u30a4\u3067\u96fb\u5b50\u5de5\u4f5c\uff01L\u30c1\u30ab\u2026\u306e\u524d\u306bL\u30d4\u30ab\uff01\u300d<\/a> \u3053\u3061\u3089\u306e\u30b5\u30a4\u30c8\u304c\u975e\u5e38\u306b\u308f\u304b\u308a\u3084\u3059\u3044\u3002<\/p>\n<p>root \u306b\u306a\u3063\u305f\u3046\u3048\u3067\u3001\u4ee5\u4e0b\u306e\u4f8b\u3060\u3068\u3001GPIO\u306e 25\u756a\u30d4\u30f3 \u306b\u63a5\u7d9a\u3057\u3066\u3001\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u5148\u306e gpio25\/value \u306b 1 \u3092\u66f8\u304d\u8fbc\u3080\u3068LED\u304c\u70b9\u706f\u3057\u3066\u30010\u3092\u66f8\u304d\u8fbc\u3080\u3068\u6d88\u706f\u3059\u308b\u3002<\/p>\n<pre class=\"prettyprint linenums\"># echo 25 &gt; \/sys\/class\/gpio\/export\r\n# cd \/sys\/class\/gpio\/gpio25\r\n# echo out &gt; direction\r\n# echo 1 &gt; value\r\n# echo 0 &gt; value\r\n<\/pre>\n<p>\u4e0a\u8a18\u30b5\u30a4\u30c8\u3067\u4f8b\u306b\u51fa\u3066\u3044\u308b\u62b5\u6297\u3068\u540c\u3058\u3082\u306e\u304c\u3001\u4eca\u56de\u306e\u30bb\u30f3\u30b5\u30fc\u30ad\u30c3\u30c8\u306b\u306f\u542b\u307e\u308c\u3066\u3044\u306a\u304b\u3063\u305f\u306e\u3067\u3001\u5024\u304c\u8fd1\u3044\u3082\u306e\u3092\u63a2\u3057\u3066\u5229\u7528\u3059\u308b\u3002<\/p>\n<p><a href=\"http:\/\/homepage3.nifty.com\/mokei-ya\/colorcode.html\">\u62b5\u6297\u5024\u3068\u30ab\u30e9\u30fc\u30b3\u30fc\u30c9\u306e\u4e00\u89a7\u8868<\/a><\/p>\n<p>\u62b5\u6297\u306e\u5e2f\u306e\u8272\u3067\u533a\u5225\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u308b\u3093\u3067\u3059\u306d\u3002\u3068\u3044\u3046\u304b\u62b5\u6297\u306e\u610f\u5473\u3082\u3042\u307e\u308a\u308f\u304b\u308a\u307e\u305b\u3093\u304c\u3002<\/p>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001Raspbian \u3067\u306e\u52d5\u4f5c\u78ba\u8a8d\u306f\u96e3\u306a\u304f\u30af\u30ea\u30a2\u3002\u3044\u3088\u3044\u3088\u672c\u547d\u306e Windows IoT \u3067 L\u30c1\u30ab\u3060\uff01<\/p>\n<h2>2. Windows IoT \u3067L\u30c1\u30ab\uff01<\/h2>\n<h3>2.1 Windows.Devices.Gpio<\/h3>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u4ee5\u4e0b\u3042\u305f\u308a\u306b\u3042\u308b\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3069\u304a\u308a\u306b\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3059\u308c\u3070\u3059\u3050\u30c1\u30ab\u30c1\u30ab\u3059\u308b\u3060\u308d\u3046\u3068\u8efd\u304f\u8003\u3048\u3066\u3044\u305f\u3068\u3053\u308d\u3001\u3001\u3001<\/p>\n<p><a href=\"http:\/\/ms-iot.github.io\/content\/en-US\/AdafruitMakerKit.htm\">Starter Pack for Windows 10 IoT Core on Raspberry Pi 2<\/a><\/p>\n<p><a href=\"https:\/\/ms-iot.github.io\/content\/en-US\/win10\/samples\/Blinky.htm\">Blinky Sample<\/a><\/p>\n<p>\u307e\u305a\u3001Windows.Devices.Gpio \u30cd\u30fc\u30e0\u30b9\u30da\u30fc\u30b9\u304c\u3069\u3053\u306b\u3042\u308b\u304b\u308f\u304b\u3089\u306a\u3044\u3002\u3002\u3002<\/p>\n<p>\u7d50\u69cb\u30b0\u30b0\u3063\u305f\u308a\u3001\u30c8\u30e9\u30a4\u30a2\u30f3\u30c9\u30a8\u30e9\u30fc\u306e\u3059\u3048\u3001\u7d50\u5c40\u3001\u53c2\u7167\u8a2d\u5b9a\u304b\u3089\u3001Universal Windows \u62e1\u5f35\u3001Windows IoT Extensions for UWP \u306e\u4e2d\u306b\u3042\u308b\u3053\u3068\u304c\u5224\u660e\u3002<\/p>\n<p>\u9078\u629e\u3057\u3066\u3001\u53c2\u7167\u8a2d\u5b9a\u3002<\/p>\n<p><a href=\"http:\/\/typea.info\/blg\/glob\/Windows-Live-Writer\/Windows-IoT--L_14687\/win_extension_form_uwp_2.jpg\"><img loading=\"lazy\" decoding=\"async\" title=\"win_extension_form_uwp\" style=\"border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px\" border=\"0\" alt=\"win_extension_form_uwp\" src=\"http:\/\/typea.info\/blg\/glob\/Windows-Live-Writer\/Windows-IoT--L_14687\/win_extension_form_uwp_thumb.jpg\" width=\"370\" height=\"196\"><\/a><\/p>\n<p>\u3053\u308c\u3067\u3001Windows.Devices.Gpio \u304c\u5229\u7528\u53ef\u80fd\u3068\u306a\u308b\u3002<\/p>\n<p><a href=\"http:\/\/typea.info\/blg\/glob\/Windows-Live-Writer\/Windows-IoT--L_14687\/win_extension_form_uwp02_2.jpg\"><img loading=\"lazy\" decoding=\"async\" title=\"win_extension_form_uwp02\" style=\"border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px\" border=\"0\" alt=\"win_extension_form_uwp02\" src=\"http:\/\/typea.info\/blg\/glob\/Windows-Live-Writer\/Windows-IoT--L_14687\/win_extension_form_uwp02_thumb.jpg\" width=\"207\" height=\"244\"><\/a><\/p>\n<h3>2.2 GPIO \u30d4\u30f3\u304c\u7121\u52b9\uff01<\/h3>\n<p>\u3064\u304e\u306b\u3001\u4e0a\u8a18\u306e\u30b5\u30a4\u30c8\u3092\u53c2\u8003\u306b\u3001\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3057\u3066\u3001\u52d5\u304b\u3057\u3066\u307f\u308b\u3082\u3001\u30c1\u30ab\u30c1\u30ab\u3057\u306a\u3044\u3069\u3053\u308d\u304b\u3001<\/p>\n<pre class=\"prettyprint linenums\">Exception thrown: 'System.Runtime.InteropServices.COMException' in WinIoTSample01.exe\r\nWinRT information: Pin ' is not available. It is reserved by the system or in use for another function.\r\n<\/pre>\n<p>\u3066\u306a\u3001\u4f8b\u5916\u304c\u767a\u751f\u3002Pin \u304c Available \u3058\u3083\u306a\u3044\uff1f\u3041\uff1f\u30b7\u30b9\u30c6\u30e0\u3067\u4e88\u7d04\u3055\u308c\u3066\u3044\u308b\uff1f<\/p>\n<p>\u3055\u3063\u304d\u3001Rasbian \u304b\u3089\u306f\u3001\u30c1\u30ab\u30c1\u30ab\u3067\u304d\u3066\u305f\u3058\u3083\u306a\u3044\u3067\u3059\u304b\u3002\u3002\u3002<\/p>\n<p>\u3046\u30fc\u3093\u3002\u306a\u3093\u304b \u30d4\u30f3\u306e\u30b9\u30c6\u30fc\u30bf\u30b9\u3092\u691c\u67fb\u3059\u308b\u30e1\u30bd\u30c3\u30c9\u7684\u306a\u3082\u306e\u304c\u3042\u3063\u305f\u306e\u3067\u3001\u5168\u30d4\u30f3\u306e\u72b6\u614b\u3092\u30c7\u30d0\u30c3\u30b0\u306b\u51fa\u529b\u3057\u3066\u307f\u308b\uff01<\/p>\n<pre class=\"prettyprint linenums\">for (int i = 0; i &lt; gpio.PinCount; i++)\r\n{\r\n    GpioOpenStatus openStatus = new GpioOpenStatus();\r\n    gpio.TryOpenPin(i, GpioSharingMode.Exclusive, out pin, out openStatus);\r\n    Debug.WriteLine($\"{i} is {openStatus.ToString()}\");\r\n}    \r\n<\/pre>\n<p>\u307b\u3046\u3002\u306a\u3093\u304b\u308f\u304b\u3089\u3093\u3051\u3069\u30013\u756a\u30d4\u30f3\u306f\u3060\u3081\u3060\u3051\u3069\u30014\u756a\u30d4\u30f3\u306f\u826f\u3055\u305d\u3046\u3060\u3002<\/p>\n<pre class=\"prettyprint linenums\">0 is PinUnavailable\r\n1 is PinUnavailable\r\n2 is PinUnavailable\r\n3 is PinUnavailable\r\n4 is PinOpened\r\n5 is PinOpened\r\n6 is PinOpened\r\n7 is PinUnavailable\r\n8 is PinUnavailable\r\n9 is PinUnavailable\r\n10 is PinUnavailable\r\n11 is PinUnavailable\r\n12 is PinOpened\r\n13 is PinOpened\r\n14 is PinUnavailable\r\n15 is PinUnavailable\r\n16 is PinOpened\r\n17 is PinOpened\r\n18 is PinOpened\r\n19 is PinOpened\r\n20 is PinOpened\r\n21 is PinOpened\r\n22 is PinOpened\r\n23 is PinOpened\r\n24 is PinOpened\r\n25 is PinOpened\r\n26 is PinOpened\r\n27 is PinOpened\r\n28 is PinUnavailable\r\n29 is PinUnavailable\r\n30 is PinUnavailable\r\n31 is PinUnavailable\r\n32 is PinUnavailable\r\n33 is PinUnavailable\r\n'WinIoTSample01.exe' (CoreCLR: CoreCLR_UWP_Domain): 'C:\\Users\\DefaultAccount\\AppData\\Local\\DevelopmentFiles\\89e222f8-bd1a-4cd5-b792-0d1321e00be7VS.Debug_ARM.piroto\\Microsoft.ApplicationInsights.PersistenceChannel.dll' \u304c\u8aad\u307f\u8fbc\u307e\u308c\u307e\u3057\u305f\u3002\u30b7\u30f3\u30dc\u30eb\u306e\u8aad\u307f\u8fbc\u307f\u3092\u30b9\u30ad\u30c3\u30d7\u3057\u307e\u3057\u305f\u3002\u30e2\u30b8\u30e5\u30fc\u30eb\u306f\u6700\u9069\u5316\u3055\u308c\u3066\u3044\u3066\u3001\u30c7\u30d0\u30c3\u30b0 \u30aa\u30d7\u30b7\u30e7\u30f3\u306e [\u30de\u30a4 \u30b3\u30fc\u30c9\u306e\u307f] \u8a2d\u5b9a\u304c\u6709\u52b9\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002\r\n34 is PinUnavailable\r\n'WinIoTSample01.exe' (CoreCLR: CoreCLR_UWP_Domain): 'C:\\Users\\DefaultAccount\\AppData\\Local\\DevelopmentFiles\\89e222f8-bd1a-4cd5-b792-0d1321e00be7VS.Debug_ARM.piroto\\System.Threading.dll' \u304c\u8aad\u307f\u8fbc\u307e\u308c\u307e\u3057\u305f\u3002\u30b7\u30f3\u30dc\u30eb\u306e\u8aad\u307f\u8fbc\u307f\u3092\u30b9\u30ad\u30c3\u30d7\u3057\u307e\u3057\u305f\u3002\u30e2\u30b8\u30e5\u30fc\u30eb\u306f\u6700\u9069\u5316\u3055\u308c\u3066\u3044\u3066\u3001\u30c7\u30d0\u30c3\u30b0 \u30aa\u30d7\u30b7\u30e7\u30f3\u306e [\u30de\u30a4 \u30b3\u30fc\u30c9\u306e\u307f] \u8a2d\u5b9a\u304c\u6709\u52b9\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002\r\n35 is PinOpened\r\n36 is PinUnavailable\r\n37 is PinUnavailable\r\n38 is PinUnavailable\r\n'WinIoTSample01.exe' (CoreCLR: CoreCLR_UWP_Domain): 'C:\\Users\\DefaultAccount\\AppData\\Local\\DevelopmentFiles\\89e222f8-bd1a-4cd5-b792-0d1321e00be7VS.Debug_ARM.piroto\\System.Private.Uri.dll' \u304c\u8aad\u307f\u8fbc\u307e\u308c\u307e\u3057\u305f\u3002\u30b7\u30f3\u30dc\u30eb\u306e\u8aad\u307f\u8fbc\u307f\u3092\u30b9\u30ad\u30c3\u30d7\u3057\u307e\u3057\u305f\u3002\u30e2\u30b8\u30e5\u30fc\u30eb\u306f\u6700\u9069\u5316\u3055\u308c\u3066\u3044\u3066\u3001\u30c7\u30d0\u30c3\u30b0 \u30aa\u30d7\u30b7\u30e7\u30f3\u306e [\u30de\u30a4 \u30b3\u30fc\u30c9\u306e\u307f] \u8a2d\u5b9a\u304c\u6709\u52b9\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002\r\n39 is PinUnavailable\r\n40 is PinUnavailable\r\n41 is PinUnavailable\r\n42 is PinUnavailable\r\n43 is PinUnavailable\r\n'WinIoTSample01.exe' (CoreCLR: CoreCLR_UWP_Domain): 'C:\\Users\\DefaultAccount\\AppData\\Local\\DevelopmentFiles\\89e222f8-bd1a-4cd5-b792-0d1321e00be7VS.Debug_ARM.piroto\\System.Diagnostics.Tracing.dll' \u304c\u8aad\u307f\u8fbc\u307e\u308c\u307e\u3057\u305f\u3002\u30e2\u30b8\u30e5\u30fc\u30eb\u304c\u30b7\u30f3\u30dc\u30eb\u306a\u3057\u3067\u30d3\u30eb\u30c9\u3055\u308c\u307e\u3057\u305f\u3002\r\n44 is PinUnavailable\r\n'WinIoTSample01.exe' (CoreCLR: CoreCLR_UWP_Domain): 'C:\\Users\\DefaultAccount\\AppData\\Local\\DevelopmentFiles\\89e222f8-bd1a-4cd5-b792-0d1321e00be7VS.Debug_ARM.piroto\\System.Linq.dll' \u304c\u8aad\u307f\u8fbc\u307e\u308c\u307e\u3057\u305f\u3002\u30b7\u30f3\u30dc\u30eb\u306e\u8aad\u307f\u8fbc\u307f\u3092\u30b9\u30ad\u30c3\u30d7\u3057\u307e\u3057\u305f\u3002\u30e2\u30b8\u30e5\u30fc\u30eb\u306f\u6700\u9069\u5316\u3055\u308c\u3066\u3044\u3066\u3001\u30c7\u30d0\u30c3\u30b0 \u30aa\u30d7\u30b7\u30e7\u30f3\u306e [\u30de\u30a4 \u30b3\u30fc\u30c9\u306e\u307f] \u8a2d\u5b9a\u304c\u6709\u52b9\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002\r\n45 is PinUnavailable\r\n'WinIoTSample01.exe' (CoreCLR: CoreCLR_UWP_Domain): 'C:\\Users\\DefaultAccount\\AppData\\Local\\DevelopmentFiles\\89e222f8-bd1a-4cd5-b792-0d1321e00be7VS.Debug_ARM.piroto\\System.Globalization.dll' \u304c\u8aad\u307f\u8fbc\u307e\u308c\u307e\u3057\u305f\u3002\u30e2\u30b8\u30e5\u30fc\u30eb\u304c\u30b7\u30f3\u30dc\u30eb\u306a\u3057\u3067\u30d3\u30eb\u30c9\u3055\u308c\u307e\u3057\u305f\u3002\r\n46 is PinUnavailable\r\n'WinIoTSample01.exe' (CoreCLR: CoreCLR_UWP_Domain): 'C:\\Users\\DefaultAccount\\AppData\\Local\\DevelopmentFiles\\89e222f8-bd1a-4cd5-b792-0d1321e00be7VS.Debug_ARM.piroto\\System.IO.dll' \u304c\u8aad\u307f\u8fbc\u307e\u308c\u307e\u3057\u305f\u3002\u30b7\u30f3\u30dc\u30eb\u306e\u8aad\u307f\u8fbc\u307f\u3092\u30b9\u30ad\u30c3\u30d7\u3057\u307e\u3057\u305f\u3002\u30e2\u30b8\u30e5\u30fc\u30eb\u306f\u6700\u9069\u5316\u3055\u308c\u3066\u3044\u3066\u3001\u30c7\u30d0\u30c3\u30b0 \u30aa\u30d7\u30b7\u30e7\u30f3\u306e [\u30de\u30a4 \u30b3\u30fc\u30c9\u306e\u307f] \u8a2d\u5b9a\u304c\u6709\u52b9\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002\r\n47 is PinOpened\r\n48 is PinUnavailable\r\n49 is PinUnavailable\r\n50 is PinUnavailable\r\n51 is PinUnavailable\r\n52 is PinUnavailable\r\n53 is PinUnavailable\r\n<\/pre>\n<p>Raspberry Pi2 \u4ed8\u5c5e\u306e GPIO\u30ab\u30fc\u30c9\u3067\u30014\u756a\u30d4\u30f3\u306e\u4f4d\u7f6e\u3092\u78ba\u8a8d\u3057\u3066\u3001\u30b1\u30fc\u30d6\u30eb\u3092\u63a5\u7d9a\u3057\u306a\u304a\u3059\u3002<\/p>\n<p><a href=\"http:\/\/typea.info\/blg\/glob\/Windows-Live-Writer\/Windows-IoT--L_14687\/raspi_gpio_card_2.jpg\"><img loading=\"lazy\" decoding=\"async\" title=\"raspi_gpio_card\" style=\"border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px\" border=\"0\" alt=\"raspi_gpio_card\" src=\"http:\/\/typea.info\/blg\/glob\/Windows-Live-Writer\/Windows-IoT--L_14687\/raspi_gpio_card_thumb.jpg\" width=\"241\" height=\"360\"><\/a><\/p>\n<h3>2.3 \u3044\u3056 L\u30c1\u30ab<\/h3>\n<p>\u307e\u305a\u306f\u3001PC\u4e0a\u3067\u8d77\u52d5\u3057\u3066\u3001GPIO\u304c\u30a8\u30e9\u30fc\u306b\u306a\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3002OK<\/p>\n<p><a href=\"http:\/\/typea.info\/blg\/glob\/Windows-Live-Writer\/Windows-IoT--L_14687\/win_iot_gpio01_2.jpg\"><img loading=\"lazy\" decoding=\"async\" title=\"win_iot_gpio01\" style=\"border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px\" border=\"0\" alt=\"win_iot_gpio01\" src=\"http:\/\/typea.info\/blg\/glob\/Windows-Live-Writer\/Windows-IoT--L_14687\/win_iot_gpio01_thumb.jpg\" width=\"416\" height=\"236\"><\/a><\/p>\n<p>\u3044\u3088\u3044\u3088\u3001Raspberry Pi2 \u4e0a\u306e Windows IoT Core \u306b Visual Studio \u4e0a\u304b\u3089\u30c7\u30d7\u30ed\u30a4\u304b\u307e\u3057\u307e\u3059\u3002<\/p>\n<p>&#8220;GPIO pin initialized correctly.&#8221; OK! OK! <\/p>\n<p><a href=\"http:\/\/typea.info\/blg\/glob\/Windows-Live-Writer\/Windows-IoT--L_14687\/led_off_uwp_2.jpg\"><img loading=\"lazy\" decoding=\"async\" title=\"led_off_uwp\" style=\"border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px\" border=\"0\" alt=\"led_off_uwp\" src=\"http:\/\/typea.info\/blg\/glob\/Windows-Live-Writer\/Windows-IoT--L_14687\/led_off_uwp_thumb.jpg\" width=\"244\" height=\"139\"><\/a><\/p>\n<p>LED \u306f\u3001\u6d88\u706f\u72b6\u614b OK\uff01 OK\uff01<\/p>\n<p><a href=\"http:\/\/typea.info\/blg\/glob\/Windows-Live-Writer\/Windows-IoT--L_14687\/led_off_2.jpg\"><img loading=\"lazy\" decoding=\"async\" title=\"led_off\" style=\"border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px\" border=\"0\" alt=\"led_off\" src=\"http:\/\/typea.info\/blg\/glob\/Windows-Live-Writer\/Windows-IoT--L_14687\/led_off_thumb.jpg\" width=\"189\" height=\"244\"><\/a><\/p>\n<p>\u3055\u3066\u3001\u304a\u3082\u3080\u308d\u306b SWITCH \u30dc\u30bf\u30f3\u3092\u304a\u3057\u3066\u3001\u3001\u3001\u753b\u9762\u4e0a\u306e\u30b9\u30c6\u30fc\u30bf\u30b9\u306f\u3001ON\u3068\u306a\u308a\u307e\u3057\u305f\u3002\u3055\u3066\u3001LED\u306f\u3001\u3001\u3001<\/p>\n<p><a href=\"http:\/\/typea.info\/blg\/glob\/Windows-Live-Writer\/Windows-IoT--L_14687\/led_on_uwp_2.jpg\"><img loading=\"lazy\" decoding=\"async\" title=\"led_on_uwp\" style=\"border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px\" border=\"0\" alt=\"led_on_uwp\" src=\"http:\/\/typea.info\/blg\/glob\/Windows-Live-Writer\/Windows-IoT--L_14687\/led_on_uwp_thumb.jpg\" width=\"244\" height=\"139\"><\/a><\/p>\n<p>\u70b9\u706f\u3057\u307e\u3057\u305f\u30fc\u30fc\u30fc\u3002\u3081\u3067\u305f\u3057\u3081\u3067\u305f\u3057\u3002<\/p>\n<p><a href=\"http:\/\/typea.info\/blg\/glob\/Windows-Live-Writer\/Windows-IoT--L_14687\/led_on_2.jpg\"><img loading=\"lazy\" decoding=\"async\" title=\"led_on\" style=\"border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px\" border=\"0\" alt=\"led_on\" src=\"http:\/\/typea.info\/blg\/glob\/Windows-Live-Writer\/Windows-IoT--L_14687\/led_on_thumb.jpg\" width=\"180\" height=\"244\"><\/a><\/p>\n<h2>3.\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9<\/h2>\n<p>\u3053\u3053\u307e\u3067\u306e\u3001\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306f\u4ee5\u4e0b\u3002<\/p>\n<p><a href=\"http:\/\/typea.info\/blg\/glob\/2015\/12\/windows-10-mobile.html\">Windows 10 mobile \u3082\u5165\u624b\u3057\u3066\u3001Universal Windows Platform \u3082\u899a\u3048\u305f\u3044\u3068\u601d\u3063\u3066\u305f\u308a\u3057\u3066\u3044\u3066\u3001<\/a>\u4ee5\u4e0b\u306e\u66f8\u7c4d\u306e\u30b5\u30f3\u30d7\u30eb\u3092\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u4e2d\u306a\u306e\u3067\u3001\u57fa\u672c\u7684\u306aMVVM\u306eUI\u306f\u305d\u3061\u3089\u3092\u304a\u624b\u672c\u306b\u3001\u7df4\u7fd2\u304c\u3066\u3089\u4f5c\u6210\u3002<\/p>\n<p><a href=\"http:\/\/www.amazon.co.jp\/gp\/product\/B015V7Q4WO\/ref=as_li_ss_il?ie=UTF8&amp;camp=247&amp;creative=7399&amp;creativeASIN=B015V7Q4WO&amp;linkCode=as2&amp;tag=typea09-22\" rel=\"nofollow\"><img decoding=\"async\" border=\"0\" src=\"http:\/\/ws-fe.amazon-adsystem.com\/widgets\/q?_encoding=UTF8&amp;ASIN=B015V7Q4WO&amp;Format=_SL160_&amp;ID=AsinImage&amp;MarketPlace=JP&amp;ServiceVersion=20070822&amp;WS=1&amp;tag=typea09-22\"><\/a><img loading=\"lazy\" decoding=\"async\" style=\"border-top-style: none !important; border-left-style: none !important; border-bottom-style: none !important; border-right-style: none !important; margin: 0px\" border=\"0\" alt=\"\" src=\"http:\/\/ir-jp.amazon-adsystem.com\/e\/ir?t=typea09-22&amp;l=as2&amp;o=9&amp;a=B015V7Q4WO\" width=\"1\" height=\"1\"> <\/p>\n<p>\u5b9f\u969b\u306b\u3001L\u30c1\u30ab\u3055\u305b\u308b\u306e\u306b\u5fc5\u8981\u306a\u30b3\u30fc\u30c9\u306f\u3001MainPageContent \u30af\u30e9\u30b9\u306e\u3001InitGpio() \u304a\u3088\u3073\u3001Switch() \u306e\u307f\u3002\u3042\u3068\u306f\u3001UI\u56de\u308a\u306e\u305f\u3081\u306e\u30b3\u30fc\u30c9\u3067\u3059\u3002<\/p>\n<p>Models\/MainPageContent.cs<\/p>\n<pre class=\"prettyprint linenums\">using System;\r\nusing System.Collections.Generic;\r\nusing System.Linq;\r\nusing System.Text;\r\nusing System.Threading.Tasks;\r\nusing WinIoTSample01.Commons;\r\nusing Windows.Devices.Gpio;\r\nusing System.Diagnostics;\r\n\r\nnamespace WinIoTSample01.Models\r\n{\r\n    class MainPageContent : BindableBase\r\n    {\r\n        private static MainPageContent instance = new MainPageContent();\r\n        public static MainPageContent Instance\r\n        {\r\n            get { return instance; }\r\n        }\r\n\r\n        private bool state;\r\n        public bool State\r\n        {\r\n            get { return this.state; }\r\n            set { this.SetProperty(ref this.state, value); }\r\n        }\r\n        private string gpioStatus;\r\n        public string GpioStatus\r\n        {\r\n            get { return this.gpioStatus; }\r\n            set { this.SetProperty(ref this.gpioStatus, value);  }\r\n        }\r\n\r\n        private const int LED_PIN = 4;\r\n        private GpioPin pin = null;\r\n        private MainPageContent()\r\n        {\r\n            InitGpio();\r\n        }\r\n        private void InitGpio()\r\n        {\r\n            this.State = false;\r\n\r\n            var gpio = GpioController.GetDefault();\r\n            if (gpio == null)\r\n            {\r\n                this.GpioStatus = \"There is no GPIO contoroller ont this device.\";\r\n            }\r\n            \r\n            \/\/for (int i = 0; i &lt; gpio.PinCount; i++)\r\n            \/\/{\r\n            \/\/    GpioOpenStatus openStatus = new GpioOpenStatus();\r\n            \/\/    gpio.TryOpenPin(i, GpioSharingMode.Exclusive, out pin, out openStatus);\r\n            \/\/    Debug.WriteLine($\"{i} is {openStatus.ToString()}\");\r\n            \/\/}             \r\n\r\n            pin = gpio.OpenPin(LED_PIN);\r\n            pin.Write(GpioPinValue.Low);\r\n            pin.SetDriveMode(GpioPinDriveMode.Output);\r\n\r\n            \/\/gpio.TryOpenPin(LED_PIN, GpioSharingMode.Exclusive, out pin, out openStatus);\r\n\r\n            this.GpioStatus = \"GPIO pin initialized correctly.\";\r\n        }\r\n\r\n        public void Switch()\r\n        {\r\n            this.State = !this.State;\r\n\r\n            GpioPinValue pinValue = ((this.State) ? GpioPinValue.High : GpioPinValue.Low);\r\n            Debug.WriteLine($\"Pin No:{pin.PinNumber}, Value:{pinValue}\");\r\n\r\n            pin.Write(pinValue);\r\n        }\r\n    }\r\n}\r\n<\/pre>\n<p>Commons\/BindableBase.cs<\/p>\n<pre class=\"prettyprint linenums\">using System;\r\nusing System.Collections.Generic;\r\nusing System.ComponentModel;\r\nusing System.Diagnostics;\r\nusing System.Linq;\r\nusing System.Runtime.CompilerServices;\r\nusing System.Text;\r\nusing System.Threading.Tasks;\r\n\r\nnamespace WinIoTSample01.Commons\r\n{\r\n    public class BindableBase : INotifyPropertyChanged\r\n    {\r\n        public event PropertyChangedEventHandler PropertyChanged;\r\n\r\n        protected virtual bool SetProperty<t>(ref T field, T value, [CallerMemberName] string propertyName = null)\r\n        {\r\n            if (Equals(field, value))\r\n            {\r\n                return false;\r\n            }\r\n            field = value;\r\n            this.OnPropertyChanged(propertyName);\r\n            return true;\r\n        }\r\n\r\n        protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)\r\n        {\r\n            this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));\r\n        }\r\n    }\r\n}\r\n<\/pre>\n<p>ViewModels\/MainPageViewModel.cs<\/p>\n<pre class=\"prettyprint linenums\">using System;\r\nusing System.Collections.Generic;\r\nusing System.ComponentModel;\r\nusing System.Linq;\r\nusing System.Text;\r\nusing System.Threading.Tasks;\r\nusing WinIoTSample01.Commons;\r\nusing WinIoTSample01.Models;\r\n\r\nnamespace WinIoTSample01.ViewModels\r\n{\r\n    public class MainPageViewModel : BindableBase, IDisposable\r\n    {\r\n        public MainPageViewModel()\r\n        {\r\n            this.Model.PropertyChanged += this.MainPageViewModel_PropertyChanged;\r\n        }\r\n        private void MainPageViewModel_PropertyChanged(object sender, PropertyChangedEventArgs e)\r\n        {\r\n            this.OnPropertyChanged(e.PropertyName);\r\n        }\r\n\r\n        private MainPageContent Model { get; } = MainPageContent.Instance; \r\n        public string State\r\n        {\r\n            get {\r\n                return (this.Model.State?\"ON\":\"OFF\");\r\n            }\r\n        }\r\n        public string GpioStatus\r\n        {\r\n            get\r\n            {\r\n                return this.Model.GpioStatus;\r\n            }\r\n        }\r\n\r\n        void IDisposable.Dispose()\r\n        {\r\n            throw new NotImplementedException();\r\n        }\r\n        public void Switch()\r\n        {\r\n            this.Model.Switch();\r\n        }\r\n    }\r\n}\r\n<\/pre>\n<p>Views\/MainPage.xaml<\/p>\n<pre class=\"prettyprint linenums\">&lt;Page\r\n    x:Class=\"WinIoTSample01.Views.MainPage\"\r\n    xmlns=\"http:\/\/schemas.microsoft.com\/winfx\/2006\/xaml\/presentation\"\r\n    xmlns:x=\"http:\/\/schemas.microsoft.com\/winfx\/2006\/xaml\"\r\n    xmlns:local=\"using:WinIoTSample01.Views\"\r\n    xmlns:d=\"http:\/\/schemas.microsoft.com\/expression\/blend\/2008\"\r\n    xmlns:mc=\"http:\/\/schemas.openxmlformats.org\/markup-compatibility\/2006\"\r\n    mc:Ignorable=\"d\"&gt;\r\n\r\n    &lt;Grid Background=\"{ThemeResource ApplicationPageBackgroundThemeBrush}\"&gt;\r\n        &lt;Grid.RowDefinitions&gt;\r\n            &lt;RowDefinition Height=\"auto\"\/&gt;\r\n            &lt;RowDefinition Height=\"auto\"\/&gt;\r\n            &lt;RowDefinition Height=\"auto\"\/&gt;\r\n        &lt;\/Grid.RowDefinitions&gt;\r\n        &lt;TextBlock Grid.Row=\"0\"  Text=\"{x:Bind ViewModel.State, Mode=OneWay}\" HorizontalAlignment=\"Stretch\" TextAlignment=\"Center\"\/&gt;\r\n        &lt;TextBlock Grid.Row=\"1\" Text=\"{x:Bind ViewModel.GpioStatus, Mode=OneWay}\" HorizontalAlignment=\"Stretch\" TextAlignment=\"Center\"\/&gt;\r\n        &lt;Button Grid.Row=\"2\" Content=\"SWITCH\" Click=\"{x:Bind ViewModel.Switch}\" HorizontalAlignment=\"Stretch\"\/&gt;\r\n    &lt;\/Grid&gt;\r\n&lt;\/Page&gt;\r\n<\/pre>\n<p><a href=\"http:\/\/www.amazon.co.jp\/gp\/product\/4839956790\/ref=as_li_ss_il?ie=UTF8&amp;camp=247&amp;creative=7399&amp;creativeASIN=4839956790&amp;linkCode=as2&amp;tag=typea09-22\" rel=\"nofollow\"><img decoding=\"async\" border=\"0\" src=\"http:\/\/ws-fe.amazon-adsystem.com\/widgets\/q?_encoding=UTF8&amp;ASIN=4839956790&amp;Format=_SL160_&amp;ID=AsinImage&amp;MarketPlace=JP&amp;ServiceVersion=20070822&amp;WS=1&amp;tag=typea09-22\"><\/a><img loading=\"lazy\" decoding=\"async\" style=\"border-top-style: none !important; border-left-style: none !important; border-bottom-style: none !important; border-right-style: none !important; margin: 0px\" border=\"0\" alt=\"\" src=\"http:\/\/ir-jp.amazon-adsystem.com\/e\/ir?t=typea09-22&amp;l=as2&amp;o=9&amp;a=4839956790\" width=\"1\" height=\"1\"><a href=\"http:\/\/www.amazon.co.jp\/gp\/product\/B00TBKFAI2\/ref=as_li_ss_il?ie=UTF8&amp;camp=247&amp;creative=7399&amp;creativeASIN=B00TBKFAI2&amp;linkCode=as2&amp;tag=typea09-22\" rel=\"nofollow\"><img decoding=\"async\" border=\"0\" src=\"http:\/\/ws-fe.amazon-adsystem.com\/widgets\/q?_encoding=UTF8&amp;ASIN=B00TBKFAI2&amp;Format=_SL160_&amp;ID=AsinImage&amp;MarketPlace=JP&amp;ServiceVersion=20070822&amp;WS=1&amp;tag=typea09-22\"><\/a><img loading=\"lazy\" decoding=\"async\" style=\"border-top-style: none !important; border-left-style: none !important; border-bottom-style: none !important; border-right-style: none !important; margin: 0px\" border=\"0\" alt=\"\" src=\"http:\/\/ir-jp.amazon-adsystem.com\/e\/ir?t=typea09-22&amp;l=as2&amp;o=9&amp;a=B00TBKFAI2\" width=\"1\" height=\"1\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Raspberry Pi 2 \u3092\u8cfc\u5165\u3057\u3001Windows IoT Core \u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u6210\u529f\u3057\u305f \u306e\u3067\u3001\u6b21\u306f\u306a\u3093\u304b \u30bb\u30f3\u30b5\u30fc\u306a\u3093\u304b\u3092\u3064\u306a\u3044\u3060\u308a\u3057\u3066\u307f\u305f\u308a\u3057\u305f\u3044\u306a\u3041\u3068\u3002 1.Raspberry Pi 2 \u7528\u30bb\u30f3\u30b5\u30fc\u30ad\u30c3\u30c8 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"sns_share_botton_hide":"","vkExUnit_sns_title":"","_vk_print_noindex":"","sitemap_hide":"","_veu_custom_css":"","veu_display_promotion_alert":"","vkexunit_cta_each_option":"","footnotes":""},"categories":[83,84,85],"tags":[],"class_list":["post-465","post","type-post","status-publish","format-standard","hentry","category-raspberry-pi","category-universal-windows-platform","category-windows-iot"],"veu_head_title_object":{"title":"","add_site_title":""},"_links":{"self":[{"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/posts\/465","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=465"}],"version-history":[{"count":0,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/posts\/465\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=465"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=465"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=465"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}