{"id":149,"date":"2021-05-08T09:32:55","date_gmt":"2021-05-08T00:32:55","guid":{"rendered":"https:\/\/rfsec.ddns.net\/db\/?p=149"},"modified":"2021-05-08T15:23:37","modified_gmt":"2021-05-08T06:23:37","slug":"%e3%82%b5%e3%83%bc%e3%83%9c%e3%83%a2%e3%83%bc%e3%82%bf%e3%82%92%e5%88%a9%e7%94%a8%e3%81%97%e3%81%9fpan-tilt%e3%82%ab%e3%83%a1%e3%83%a9%e5%8f%b0%e3%81%ae%e5%88%b6%e5%be%a1%ef%bc%88%e6%b1%8e%e7%94%a8os","status":"publish","type":"post","link":"https:\/\/rfsec.ddns.net\/db\/?p=149","title":{"rendered":"\u30b5\u30fc\u30dc\u30e2\u30fc\u30bf\u3092\u5229\u7528\u3057\u305fPan\/Tilt\u30ab\u30e1\u30e9\u53f0\u306e\u5236\u5fa1\uff08GPIO\u30e9\u30a4\u30d6\u30e9\u30ea\u30fc\u3067\u306f\u6b63\u78ba\u306a\u5236\u5fa1\u306f\u7121\u7406\uff1f\uff09"},"content":{"rendered":"\n<p>\u30b5\u30fc\u30dc\u30e2\u30fc\u30bf\u3067Pan\/Tilt\u30ab\u30e1\u30e9\u53f0\u3092\u5236\u5fa1\u3059\u308b\u5b9f\u9a13\u3092\u3084\u3063\u3066\u307f\u305f\u304c\u3001\u610f\u56f3\u3057\u305f\u65b9\u5411\u304b\u3089\u5c11\u3057\u5916\u308c\u3066\u306f\u6b63\u3057\u3044\u65b9\u5411\u3078\u30ab\u30e1\u30e9\u53f0\u304c\u56de\u8ee2\u3059\u308b\u73fe\u8c61\u304c\u983b\u767a\u3057\u3066\u3044\u308b\u3002\u30b9\u30c6\u30c3\u30d4\u30f3\u30b0\u30e2\u30fc\u30bf\u306e\u6642\u306b\u306f\u3001\u3053\u306e\u3088\u3046\u306a\u73fe\u8c61\u306b\u906d\u9047\u3057\u305f\u8a18\u61b6\u304c\u306a\u3044\u3002\u30b5\u30fc\u30dc\u30e2\u30fc\u30bf\u306f\u3001\u5236\u5fa1\u4fe1\u53f7\u306e\u30d1\u30eb\u30b9\u5e45\u306b\u5bfe\u5fdc\u3057\u305f\u89d2\u5ea6\u307e\u3067\u56de\u8ee2\u3059\u308b\u3088\u3046\u306b\u4f5c\u3089\u308c\u3066\u3044\u308b\u306e\u3067\u3001\u610f\u56f3\u3057\u306a\u3044\u56de\u8ee2\u306e\u539f\u56e0\u306f\u3001\u6b21\u306e\u3088\u3046\u306b\u63a8\u5b9a\u3067\u304d\u308b\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>\u5236\u5fa1\u4fe1\u53f7\u306e\u30d1\u30eb\u30b9\u5e45\u304c\u30d0\u30e9\u3064\u3044\u3066\u3044\u308b<\/li><li>\u30b5\u30fc\u30dc\u30e2\u30fc\u30bf\u306e\u7cbe\u5ea6\u304c\u60aa\u3044\uff08\u5236\u5fa1\u4fe1\u53f7\u306e\u30d1\u30eb\u30b9\u306b\u6b63\u78ba\u306b\u8ffd\u5f93\u3057\u3066\u3044\u306a\u3044\uff09<\/li><li>\u305d\u306e\u4ed6\uff1f\uff08\u4e0a\u8a18\u306e\u4e21\u65b9\u3001\u307e\u305f\u306f\u305d\u306e\u4ed6\u306e\u539f\u56e0\uff09<\/li><\/ul>\n\n\n\n<p>\u5b89\u4fa1\u306a\u30b5\u30fc\u30dc\u30e2\u30fc\u30bf\u3092\u4f7f\u3063\u3066\u3044\u308b\u306e\u3067\u3001\u6700\u521d\u306f\u30b5\u30fc\u30dc\u30e2\u30fc\u30bf\u306e\u7cbe\u5ea6\u306e\u554f\u984c\u3068\u601d\u3063\u305f\u308a\u3057\u305f\u304c\u3001\u5236\u5fa1\u4fe1\u53f7\u306e\u30d1\u30eb\u30b9\u5e45\u3092\u30aa\u30b7\u30ed\u3067\u89b3\u6e2c\u3057\u3066\u307f\u308b\u3053\u3068\u306b\u3057\u305f\u3002\u30aa\u30b7\u30ed\u306b\u306f\u6e2c\u5b9a\u3057\u305f\u5024\u306e\u7d71\u8a08\u60c5\u5831\u3092\u8868\u793a\u3059\u308b\u6a5f\u80fd\u304c\u3042\u308a\u3001\u30d1\u30eb\u30b9\u5e45\u306e\u8a55\u4fa1\u306b\u306f\u3053\u308c\u3092\u5229\u7528\u3059\u308b\u3053\u3068\u306b\u3057\u305f\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized is-style-default\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/rfsec.ddns.net\/db\/wp-content\/uploads\/2021\/05\/pwm-servo-923x1024.jpg\" alt=\"\" class=\"wp-image-153\" width=\"341\" height=\"377\" srcset=\"https:\/\/rfsec.ddns.net\/db\/wp-content\/uploads\/2021\/05\/pwm-servo-923x1024.jpg 923w, https:\/\/rfsec.ddns.net\/db\/wp-content\/uploads\/2021\/05\/pwm-servo-270x300.jpg 270w, https:\/\/rfsec.ddns.net\/db\/wp-content\/uploads\/2021\/05\/pwm-servo-768x852.jpg 768w, https:\/\/rfsec.ddns.net\/db\/wp-content\/uploads\/2021\/05\/pwm-servo-1385x1536.jpg 1385w, https:\/\/rfsec.ddns.net\/db\/wp-content\/uploads\/2021\/05\/pwm-servo-1846x2048.jpg 1846w, https:\/\/rfsec.ddns.net\/db\/wp-content\/uploads\/2021\/05\/pwm-servo-624x692.jpg 624w\" sizes=\"auto, (max-width: 341px) 100vw, 341px\" \/><\/figure>\n\n\n\n<p>\u30b5\u30fc\u30dc\u30e2\u30fc\u30bf\u306e\u5236\u5fa1\u306f\u3001\u6b21\u306ePython\u30b9\u30af\u30ea\u30d7\u30c8\u3067Raspberry pi4b\u306eGPIO\u304b\u3089PWM\u4fe1\u53f7\u3092\u767a\u751f\u3055\u305b\u3066\u884c\u3063\u3066\u3044\u308b\u3002500Hz\u3067Duty50%\u306e\u77e9\u5f62\u6ce2\u3092\u751f\u6210\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#GPIO\u306e\u521d\u671f\u8a2d\u5b9a\nimport RPi.GPIO as GPIO\nGPIO.setwarnings(False)\nGPIO.setmode(GPIO.BCM)\nPAN=27\nGPIO.setup(PAN, GPIO.OUT)\nPWM_pan = GPIO.PWM(PAN, 500)\nPWM_pan.start(0.0)\n\nPWM_pan.ChangeDutyCycle(50)\nwhile True:\n    pass<\/code><\/pre>\n\n\n\n<p><strong>\u30aa\u30b7\u30ed\u3067\u89b3\u6e2c\u3057\u305f\u6ce2\u5f62\u3068\u7d71\u8a08\u60c5\u5831<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"562\" src=\"https:\/\/rfsec.ddns.net\/db\/wp-content\/uploads\/2021\/05\/pwm-1024x562.jpg\" alt=\"\" class=\"wp-image-151\" srcset=\"https:\/\/rfsec.ddns.net\/db\/wp-content\/uploads\/2021\/05\/pwm-1024x562.jpg 1024w, https:\/\/rfsec.ddns.net\/db\/wp-content\/uploads\/2021\/05\/pwm-300x165.jpg 300w, https:\/\/rfsec.ddns.net\/db\/wp-content\/uploads\/2021\/05\/pwm-768x421.jpg 768w, https:\/\/rfsec.ddns.net\/db\/wp-content\/uploads\/2021\/05\/pwm-624x342.jpg 624w, https:\/\/rfsec.ddns.net\/db\/wp-content\/uploads\/2021\/05\/pwm.jpg 1183w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u8d64\u67a0\u90e8\u5206\u306b\u8868\u793a\u3055\u308c\u305f\u60c5\u5831\u3092\u4fe1\u7528\u3059\u308b\u3068\u3001\u30d1\u30eb\u30b9\u5e45\u306e\u5e73\u5747\u5024\u304c1.08mS\u3001\u6700\u5927\u5024\u304c2.34mS\u3001\u6a19\u6e96\u504f\u5dee\u304c88.96\u03bc\u306a\u3069\u3069\u306a\u3063\u3066\u3044\u308b\u3002\u3053\u3053\u3067\u3001\u5229\u7528\u3057\u305f\u30b5\u30fc\u30dc\u30e2\u30fc\u30bf\u306f0.5mS\u304b\u30892.5mS\u306e\u5236\u5fa1\u4fe1\u53f7\u306e\u30d1\u30eb\u30b9\u5e45\u306b\u5bfe\u5fdc\u3057\u3066\u3001270\u5ea6\u306e\u7bc4\u56f2\u3067\u56de\u8ee2\u3059\u308b\u3053\u3068\u306b\u306a\u3063\u3066\u3044\u308b\u3002\u56de\u8ee2\u89d2\u5ea6\u3092\uff11\u5ea6\u5909\u66f4\u3059\u308b\u306b\u305f\u3081\u306b\u5fc5\u8981\u306a\u30d1\u30eb\u30b9\u5e45\u306e\u5909\u5316\u306f\u3001\u7d044.7\u03bcS\uff08\uff1d2mS\uff0f270\uff09\u3002\u3068\u3053\u308d\u304c\u3001\u89b3\u6e2c\u3057\u305f\u30d1\u30eb\u30b9\u5e45\u306e\u6a19\u6e96\u504f\u5dee\u304c88.96\u03bc\u3068\u3044\u3046\u3053\u3068\u306a\u306e\u3067\u3001\u30b5\u30fc\u30dc\u30e2\u30fc\u30bf\u304c\u5236\u5fa1\u4fe1\u53f7\u306b\u5fe0\u5b9f\u306b\u53cd\u5fdc\u3057\u305f\u5834\u5408\u3001\u56de\u8ee2\u89d2\u5ea6\u304c\u6570\u5ea6\u4ee5\u4e0a\u5909\u52d5\u3059\u308b\u3053\u3068\u306b\u306a\u308b\u3002\u5b9f\u969b\u306b\u3001\u3053\u306e\u5236\u5fa1\u4fe1\u53f7\u3092\u30b5\u30fc\u30dc\u30e2\u30fc\u30bf\u3078\u4e0e\u3048\u308b\u3068\u3001\u30e2\u30fc\u30bf\u306f\u9759\u6b62\u305b\u305a\u306b\u5fae\u52d5\u3092\u7e70\u308a\u8fd4\u3059\u72b6\u614b\u3068\u306a\u3063\u305f\u3002<\/p>\n\n\n\n<p><strong>\u5236\u5fa1\u30d1\u30eb\u30b9\u751f\u6210\u306bArduino Micro\u3092\u7528\u3044\u305f\u5834\u5408<\/strong><\/p>\n\n\n\n<p>PIN6\u304b\u3089PWM\u4fe1\u53f7\u3092\u751f\u6210<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>int PAN = 6;\n\nvoid setup() {\n  pinMode(PAN, OUTPUT);\n  analogWrite(PAN,128);\n}\n\nvoid loop() {\n}<\/code><\/pre>\n\n\n\n<p><strong>\u30aa\u30b7\u30ed\u3067\u89b3\u6e2c\u3057\u305f\u69d8\u5b50<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"551\" src=\"https:\/\/rfsec.ddns.net\/db\/wp-content\/uploads\/2021\/05\/pwm-arduino2-1024x551.jpg\" alt=\"\" class=\"wp-image-155\" srcset=\"https:\/\/rfsec.ddns.net\/db\/wp-content\/uploads\/2021\/05\/pwm-arduino2-1024x551.jpg 1024w, https:\/\/rfsec.ddns.net\/db\/wp-content\/uploads\/2021\/05\/pwm-arduino2-300x162.jpg 300w, https:\/\/rfsec.ddns.net\/db\/wp-content\/uploads\/2021\/05\/pwm-arduino2-768x414.jpg 768w, https:\/\/rfsec.ddns.net\/db\/wp-content\/uploads\/2021\/05\/pwm-arduino2-624x336.jpg 624w, https:\/\/rfsec.ddns.net\/db\/wp-content\/uploads\/2021\/05\/pwm-arduino2.jpg 1183w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u306a\u3093\u3068\u6a19\u6e96\u504f\u5dee\u304c\uff11\u6841\u306enS\u30aa\u30fc\u30c0\u30fc\u3002Raspberry Pi4\u306e1\/1000\u4ee5\u4e0b\u3068\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u30b5\u30fc\u30dc\u30e2\u30fc\u30bf\u3067Pan\/Tilt\u30ab\u30e1\u30e9\u53f0\u3092\u5236\u5fa1\u3059\u308b\u5b9f\u9a13\u3092\u3084\u3063\u3066\u307f\u305f\u304c\u3001\u610f\u56f3\u3057\u305f\u65b9\u5411\u304b\u3089\u5c11\u3057\u5916\u308c\u3066\u306f\u6b63\u3057\u3044\u65b9\u5411\u3078\u30ab\u30e1\u30e9\u53f0\u304c\u56de\u8ee2\u3059\u308b\u73fe\u8c61\u304c\u983b\u767a\u3057\u3066\u3044\u308b\u3002\u30b9\u30c6\u30c3\u30d4\u30f3\u30b0\u30e2\u30fc\u30bf\u306e\u6642\u306b\u306f\u3001\u3053\u306e\u3088\u3046\u306a\u73fe\u8c61\u306b\u906d\u9047\u3057\u305f\u8a18\u61b6\u304c\u306a\u3044\u3002\u30b5\u30fc\u30dc\u30e2\u30fc [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[2,6],"tags":[],"class_list":["post-149","post","type-post","status-publish","format-standard","hentry","category-camera","category-make"],"featured_image_src":null,"author_info":{"display_name":"mars","author_link":"https:\/\/rfsec.ddns.net\/db\/?author=1"},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/rfsec.ddns.net\/db\/index.php?rest_route=\/wp\/v2\/posts\/149","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rfsec.ddns.net\/db\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rfsec.ddns.net\/db\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rfsec.ddns.net\/db\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rfsec.ddns.net\/db\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=149"}],"version-history":[{"count":4,"href":"https:\/\/rfsec.ddns.net\/db\/index.php?rest_route=\/wp\/v2\/posts\/149\/revisions"}],"predecessor-version":[{"id":157,"href":"https:\/\/rfsec.ddns.net\/db\/index.php?rest_route=\/wp\/v2\/posts\/149\/revisions\/157"}],"wp:attachment":[{"href":"https:\/\/rfsec.ddns.net\/db\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=149"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rfsec.ddns.net\/db\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=149"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rfsec.ddns.net\/db\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=149"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}