{"id":5189,"date":"2021-09-12T14:47:24","date_gmt":"2021-09-12T05:47:24","guid":{"rendered":"https:\/\/ndaznnez.com\/blog7\/?p=5189"},"modified":"2025-02-04T18:07:44","modified_gmt":"2025-02-04T09:07:44","slug":"%e4%ba%ba%e7%94%9f%e3%82%b2%e3%83%bc%e3%83%a0%e3%83%ab%e3%83%bc%e3%83%ac%e3%83%83%e3%83%88%e5%86%8d%e6%9d%a5-%e5%86%8d%e6%a7%8b%e7%af%89%e7%b7%a8","status":"publish","type":"post","link":"https:\/\/ndaznnez.com\/blog7\/2021\/09\/12\/%e4%ba%ba%e7%94%9f%e3%82%b2%e3%83%bc%e3%83%a0%e3%83%ab%e3%83%bc%e3%83%ac%e3%83%83%e3%83%88%e5%86%8d%e6%9d%a5-%e5%86%8d%e6%a7%8b%e7%af%89%e7%b7%a8\/","title":{"rendered":"\u4eba\u751f\u30b2\u30fc\u30e0\u30eb\u30fc\u30ec\u30c3\u30c8\u518d\u6765 &#8211; \u518d\u69cb\u7bc9\u7de8"},"content":{"rendered":"\n<p>Raspberry Pi Pico\u306b\u3088\u308b\u3057\u3087\u3046\u3082\u306a\u3044\u30b7\u30b9\u30c6\u30e0\u306e\u5c02\u7528\u6a5f\u5316\u306e\u7b2c\u4e8c\u5f3e\u3068\u3057\u3066\u3001Raspberry Pi 4B\u3067\u4f5c\u3063\u305f<a href=\"https:\/\/ndaznnez.com\/blog7\/2020\/07\/19\/%e3%83%a9%e3%82%ba%e3%83%91%e3%82%a4%e3%82%b5%e3%82%a4%e3%82%b3%e3%83%ad%e3%81%be%e3%81%9f%e3%81%af%e4%ba%ba%e7%94%9f%e3%82%b2%e3%83%bc%e3%83%a0%e3%83%ab%e3%83%bc%e3%83%ac%e3%83%83%e3%83%88\/\">\u4eba\u751f\u30b2\u30fc\u30e0\u306e\u30eb\u30fc\u30ec\u30c3\u30c8<\/a>\u3092\u3001\u5c02\u7528\u6a5f\u5316\u3059\u308b\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3002\u524d\u56de\u3088\u308a\u5c11\u3057\u6a5f\u80fd\u3092\u8ffd\u52a0\u3057\u3066\u30d6\u30ec\u30c3\u30c9\u30dc\u30fc\u30c9\u4e0a\u306b\u7d44\u307f\u4e0a\u3052\u305f<\/p>\n\n\n\n<div class=\"wp-block-image is-style-default\"><figure class=\"aligncenter size-full is-resized\"><a href=\"https:\/\/ndaznnez.com\/blog7\/wp-content\/uploads\/2021\/09\/GR013655.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ndaznnez.com\/blog7\/wp-content\/uploads\/2021\/09\/GR013655.jpg\" alt=\"\" class=\"wp-image-5190\" width=\"597\" height=\"600\" srcset=\"https:\/\/ndaznnez.com\/blog7\/wp-content\/uploads\/2021\/09\/GR013655.jpg 1194w, https:\/\/ndaznnez.com\/blog7\/wp-content\/uploads\/2021\/09\/GR013655-150x150.jpg 150w, https:\/\/ndaznnez.com\/blog7\/wp-content\/uploads\/2021\/09\/GR013655-768x772.jpg 768w, https:\/\/ndaznnez.com\/blog7\/wp-content\/uploads\/2021\/09\/GR013655-144x144.jpg 144w\" sizes=\"auto, (max-width: 597px) 100vw, 597px\" \/><\/a><\/figure><\/div>\n\n\n\n<p>\u8d77\u52d5\u30dc\u30bf\u30f3\u3092\u8ffd\u52a0\u3057\u305f\u3002\u4e88\u3081\u53c2\u52a0\u8005\u304c\u597d\u304d\u306a\u8272\u3092\u6c7a\u3081\u3066\u5c02\u7528\u306b\u4f7f\u3046\u3082\u826f\u3057\u3001\u305d\u3046\u3044\u3046\u53d6\u308a\u6c7a\u3081\u3082\u306a\u304f\u81ea\u7531\u306b\u305d\u306e\u6642\u306e\u6c17\u5206\u3067\u62bc\u3057\u3066\u3082\u826f\u3057\u3002\u30b5\u30fc\u30dc\u30e2\u30fc\u30bf\u304c\u52d5\u3044\u3066\u3044\u308b\u9593\u306fLED\u304c\u70b9\u706f\u3059\u308b\u3088\u3046\u306b\u3082\u3057\u305f\u3002\u4ee5\u524d\u8cb7\u3063\u3066\u3044\u305fRGB LED\u3092\u4f7f\u3063\u3066\u62bc\u3055\u308c\u305f\u30dc\u30bf\u30f3\u306e\u8272\u3067\u5149\u308b\u3088\u3046\u306b\u3057\u3088\u3046\u3068\u601d\u3063\u305f\u304c\u3001\u898b\u3064\u304b\u3089\u306a\u3044\u306e\u3067\u304a\u3068\u306a\u3057\u304f\u624b\u6301\u3061\u306e\u9ec4\u8272\u306eLED\u306b\u3057\u305f<\/p>\n\n\n\n<p>\u30b2\u30fc\u30e0\u3092\u59cb\u3081\u308b\u306b\u3042\u305f\u3063\u3066\u3001\u305d\u308c\u305e\u308c\u306e\u30dc\u30bf\u30f3\u306b\u306f<strong>\u79d8\u5bc6\u306e\u96a0\u3057\u5473<\/strong>\u304c\u4ed5\u8fbc\u3093\u3067\u3042\u3063\u3066\u76ee\u306e\u51fa\u65b9\u304c\u5fae\u5999\u306b\u9055\u3044\u3001\u53c2\u52a0\u8005\u304c\u3069\u306e\u3088\u3046\u306a\u30b3\u30fc\u30b9\u3092\u9078\u3093\u3060\u304b\u3001\u307e\u305f\u4f55\u3092\u72d9\u3046\u304b\u306b\u3088\u3063\u3066\u305d\u306e\u7d50\u679c\u306b\u5dee\u304c\u51fa\u3066\u6765\u308b\u304b\u3082\u3057\u308c\u306a\u3044\u7b49\u3068<strong>\u80fd\u66f8\u304d\u3092\u30b3\u30af<\/strong>\u306e\u3082\u8da3\u304c\u5897\u3057\u3066\u826f\u3044\u304b\u3082\u77e5\u308c\u306a\u3044(\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u898b\u308c\u3070\u5185\u90e8\u306e\u30ed\u30b8\u30c3\u30af\u306f\u5168\u304f\u540c\u3058\u306a\u306e\u306f\u4e00\u76ee\u77ad\u7136\u3060\u3051\u3069\u306a)<\/p>\n\n\n\n<p>\u30ea\u30fc\u30c9\u7dda\u304c\u6797\u7acb\u3057\u3066\u975e\u5e38\u306b\u8907\u96d1\u305d\u3046\u306b\u898b\u3048\u3001\u81ea\u5206\u306b\u3057\u3066\u898b\u308c\u3070\u5927\u3057\u305f\u3053\u3068\u3092\u3084\u3063\u305f\u3068\u3044\u3046\u611f\u899a\u3092\u899a\u3048\u308b\u3002\u305d\u308c\u306f\u826f\u3044\u3001\u9054\u6210\u611f\u3092\u6301\u3064\u306e\u306f\u7cbe\u795e\u885b\u751f\u4e0a\u975e\u5e38\u306b\u826f\u3044\u3053\u3068\u3067\u3042\u308b\u3002\u3057\u304b\u3057\u3001\u3057\u307f\u3058\u307f\u3068\u8003\u3048\u308b\u3068\u3001Pico\u306eGPIO\u7aef\u5b50\u3068GND\u3092\u30d7\u30eb\u30a2\u30c3\u30d7(\u30c0\u30a6\u30f3?)\u62b5\u6297\u3067\u7e4b\u3044\u3067 \u2192 \u96fb\u6e90\u3068\u7e4b\u3052\u308b\u30b9\u30a4\u30c3\u30c1 \u2192 GND\u306e\u56de\u8def\u30924\u3064\u3068\u3001GPIO \u2192 \u96fb\u6d41\u5236\u9650\u62b5\u6297 \u2192 LED \u2192 GND\u306e\u56de\u8def\u304c\u3042\u308b\u3060\u3051\u3067\u3001\u4f7f\u3063\u3066\u3044\u308b\u62b5\u6297\u3082\u3061\u3083\u3093\u3068\u8a08\u7b97\u3057\u305f\u3082\u306e\u3067\u306f\u306a\u304f\u3001\u3068\u308a\u3042\u3048\u305a\u5538\u308b\u307b\u3069\u3042\u308b330\u03a9\u306e\u62b5\u6297\u3092\u5834\u5f53\u305f\u308a\u7684\u306b\u4f7f\u3063\u3066\u3044\u305f\u308a\u3001\u5b9f\u306f\u305d\u308c\u307b\u3069\u5927\u3057\u305f\u56de\u8def\u3067\u306f\u306a\u3044\u3068\u3044\u3046\u3053\u3068\u306b\u601d\u3044\u3092\u81f4\u3059\u3053\u3068\u3082\u4eba\u751f\u3067\u5927\u5207\u306a\u3053\u3068\u3067\u3042\u308b\u3002<\/p>\n\n\n\n<p class=\"has-text-color\" style=\"color:#9b9b9b\">\u203b(\u3053\u3053\u307e\u3067\u66f8\u3044\u3066\u304d\u3066\u3001\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3067GPIO\u30d4\u30f3\u306e\u5b9a\u7fa9\u3067PULL-UP\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u6307\u5b9a\u3057\u3066\u3044\u308b\u3053\u3068\u306b\u6c17\u304c\u3064\u3044\u3066\u6df7\u4e71\u3057\u3066\u6765\u305f\u3002\u672c\u5f53\u306b\u3053\u306e\u307e\u307e\u3067\u826f\u3044\u306e\u3060\u308d\u3046\u304b\u2026\u52d5\u3044\u3066\u3044\u308b\u304b\u3089\u3053\u306e\u5834\u3067\u306f\u826f\u3057\u3068\u3059\u308b\u3053\u3068\u306b\u3059\u308b)<\/p>\n\n\n\n<figure class=\"wp-block-video\"><video height=\"1080\" style=\"aspect-ratio: 1920 \/ 1080;\" width=\"1920\" controls src=\"https:\/\/ndaznnez.com\/blog7\/wp-content\/uploads\/2021\/09\/Roulette2.mp4\"><\/video><\/figure>\n\n\n\n<p>\u4ee5\u4e0b\u306f\u30ea\u30b9\u30af\u5bfe\u7b56\u306e\u305f\u3081\u306e\u30bd\u30fc\u30b9(Micropython)<\/p>\n\n\n\n<pre class=\"wp-block-preformatted has-cyan-bluish-gray-color has-text-color has-background has-normal-font-size\" style=\"background-color:#0b1736\"># \u30dc\u30bf\u30f3\u3092\u62bc\u3059\u3068\u30b5\u30fc\u30dc\u30fc\u30e2\u30fc\u30bf\u304c\u30e9\u30f3\u30c0\u30e0\u306a\u5024\u3092\u793a\u3057\u3001\u4f5c\u52d5\u4e2d\u306fLED\u304c\u70b9\u706f\n# Raspberry Pi Pico\u3067\u4f5c\u52d5\n# MycroPython\u4e0a\u3067\u7a3c\u50cd\n# Servo Motor GP0\n# \u7dd1GP3 \u8d64GP7 \u9ec4GP11 \u9752GP15\n# LED GP28\n\nfrom machine import Pin\nimport time\nimport math\nimport random\n\npin28 = machine.Pin(28, machine.Pin.OUT)\n\ndef servorandom_dice_Pico():\n    # \u53ef\u52d5\u7bc4\u56f2\u306f0\u00b0\uff5e\u7d04120\u00b0(Duty\u6bd4\u30672300\uff5e7530)\n    # 1\uff5e10\u306e\u30b5\u30a4\u30b3\u30ed\u306e\u76ee\u3092\u30b5\u30fc\u30dc\u30e2\u30fc\u30bf\u3067\u8868\u793a\u3059\u308b\n\n    pin0 = machine.Pin(0, machine.Pin.OUT)\n    servo = machine.PWM(pin0)\n    servo.freq(50)\n\n    m = random.randint (6, 10)\n    n = 1\n    while n &lt;= m:\n        dice = random.randint (0, 9)\n        pulse = (523 * dice + 2300)\n        servo.duty_u16(pulse)\n        time.sleep (0.3)\n        n += 1\n\nn = 1\nwhile True:\n    pin = machine.Pin(3)\n    pin = machine.Pin(3, machine.Pin.IN,machine.Pin.PULL_UP)\n    if pin.value():\n        pin28.value(1)\n        servorandom_dice_Pico()\n        pin28.value(0)\n\n    pin = machine.Pin(7)\n    pin = machine.Pin(7, machine.Pin.IN,machine.Pin.PULL_UP)\n    print (\"Pin5 (R) : \", pin.value())\n    if pin.value():\n        pin28.value(1)\n        servorandom_dice_Pico()\n        pin28.value(0)\n\n    pin = machine.Pin(11)\n    pin = machine.Pin(11, machine.Pin.IN,machine.Pin.PULL_UP)\n    print (\"Pin10(Y) : \", pin.value())\n    if pin.value():\n        pin28.value(1)\n        servorandom_dice_Pico()\n        pin28.value(0)\n\n    pin = machine.Pin(15)\n    pin = machine.Pin(15, machine.Pin.IN,machine.Pin.PULL_UP)\n    print (\"Pin15(B) : \", pin.value())\n    if pin.value():\n        pin28.value(1)\n        servorandom_dice_Pico()\n        pin28.value(0)\n\n    print (n ,\"---- \")\n    n += 1\n    time.sleep (.2)\n\n<\/pre>\n\n\n\n<p>Micropython\u3068Python\u3067\u306f\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u63d0\u4f9b\u306e\u5185\u5bb9\u304c\u9055\u3046\u306e\u304b?\u3088\u304f\u308f\u304b\u3089\u306a\u3044\u306a\u304c\u3089\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3092\u3057\u305f\u3002\u9014\u4e2d\u3067\u95a2\u6570\u306e\u5b9a\u7fa9\u3068\u8a00\u3046\u3001\u79c1\u306b\u3068\u3063\u3066\u306f\u5927\u304d\u306a\u98db\u8e8d\u3092\u9042\u3052\u305f(\u3059\u3050\u5fd8\u308c\u308b\u3051\u3069\u306a)\u3002\u96fb\u5b50\u56de\u8def\u3067\u30d7\u30eb\u30a2\u30c3\u30d7\u3068\u3044\u3046\u8003\u3048\u65b9\u306b\u3082\u89e6\u308c\u305f\u3002\u3053\u308c\u3067\u4e00\u3064\u306e\u5c71\u3092\u8d8a\u3048\u305f\u3002\u3042\u3068\u306f\u4f7f\u3044\u65b9\u3092\u8003\u3048\u3066\u57fa\u677f\u3068\u7b50\u4f53\u3092\u3069\u3046\u3084\u3063\u3066\u4f5c\u308b\u304b\u3060<\/p>\n\n\n\n<p class=\"has-text-align-right\">2021\/09\/12<br>\u3093\u306d\u305e\u3046<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Raspberry Pi Pico\u306b\u3088\u308b\u3057\u3087\u3046\u3082\u306a\u3044\u30b7\u30b9\u30c6\u30e0\u306e\u5c02\u7528\u6a5f\u5316\u306e\u7b2c\u4e8c\u5f3e\u3068\u3057\u3066\u3001Raspberry Pi 4B\u3067\u4f5c\u3063\u305f\u4eba\u751f\u30b2\u30fc\u30e0\u306e\u30eb\u30fc\u30ec\u30c3\u30c8\u3092\u3001\u5c02\u7528\u6a5f\u5316\u3059\u308b\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3002\u524d\u56de\u3088\u308a\u5c11\u3057\u6a5f\u80fd\u3092\u8ffd\u52a0\u3057\u3066\u30d6\u30ec\u30c3\u30c9\u30dc\u30fc\u30c9\u4e0a\u306b [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":5190,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,5,7],"tags":[92,77,38,39,60],"class_list":["post-5189","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-2","category-5","category-7","tag-92","tag-77","tag-38","tag-39","tag-60"],"_links":{"self":[{"href":"https:\/\/ndaznnez.com\/blog7\/wp-json\/wp\/v2\/posts\/5189","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ndaznnez.com\/blog7\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ndaznnez.com\/blog7\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ndaznnez.com\/blog7\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ndaznnez.com\/blog7\/wp-json\/wp\/v2\/comments?post=5189"}],"version-history":[{"count":14,"href":"https:\/\/ndaznnez.com\/blog7\/wp-json\/wp\/v2\/posts\/5189\/revisions"}],"predecessor-version":[{"id":5277,"href":"https:\/\/ndaznnez.com\/blog7\/wp-json\/wp\/v2\/posts\/5189\/revisions\/5277"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ndaznnez.com\/blog7\/wp-json\/wp\/v2\/media\/5190"}],"wp:attachment":[{"href":"https:\/\/ndaznnez.com\/blog7\/wp-json\/wp\/v2\/media?parent=5189"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ndaznnez.com\/blog7\/wp-json\/wp\/v2\/categories?post=5189"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ndaznnez.com\/blog7\/wp-json\/wp\/v2\/tags?post=5189"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}