{"id":3092,"date":"2022-10-03T12:37:39","date_gmt":"2022-10-03T12:37:39","guid":{"rendered":"https:\/\/picockpit.com\/raspberry-pi\/?p=3092"},"modified":"2023-08-21T13:11:49","modified_gmt":"2023-08-21T13:11:49","slug":"servo-pico-w-pulse-width-modulation","status":"publish","type":"post","link":"https:\/\/picockpit.com\/raspberry-pi\/ja\/%e3%83%a9%e3%82%ba%e3%83%99%e3%83%aa%e3%83%bc%e3%83%91%e3%82%a4%e3%83%bb%e3%83%94%e3%82%b3w%e3%83%bb%e3%83%91%e3%83%ab%e3%82%b9%e5%b9%85%e5%a4%89%e8%aa%bf%e3%83%bbpwm%e3%81%ab%e3%82%88%e3%82%8b\/","title":{"rendered":"Raspberry Pi Pico W\u3068PWM\u3067\u30b5\u30fc\u30dc\u3092\u5236\u5fa1\u3059\u308b"},"content":{"rendered":"\n<iframe loading=\"lazy\" width=\"893\" height=\"502\" src=\"https:\/\/www.youtube.com\/embed\/z0H_C-8XeY4\" title=\"Pico W servo controller - What is PWM?\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen=\"\"><\/iframe>\n\n\n\n<p>A servo is one of the most fundamental ways to learn to use pulse width modulation (PWM) with the Raspberry Pi. In this article, I&#8217;m going to show you how to do this with a Raspberry Pi Pico W.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">PWM tutorial objectives<\/h2>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"891\" height=\"499\" src=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/10\/image.png\" alt=\"A Servo with a Pico W and PWM\" class=\"wp-image-3094\" srcset=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/10\/image.png 891w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/10\/image-300x168.png 300w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/10\/image-768x430.png 768w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/10\/image-18x10.png 18w\" sizes=\"auto, (max-width: 891px) 100vw, 891px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Learn how to use PWM to control the angle of the servo<\/li>\n\n\n\n<li>Set up a server with the Pico W<\/li>\n\n\n\n<li>Server delivers web page with a slider to control servo<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Parts needed<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Raspberry Pi Pico W with headers<\/li>\n\n\n\n<li>Jumper wire<\/li>\n\n\n\n<li>Servo (we&#8217;re using the Tower Pro SG90 micro servo)<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">What is pulse width modulation?<\/h2>\n\n\n\n<p>Children find it amusing to switch lights on and off repeatedly.<\/p>\n\n\n\n<p>To them, it&#8217;s just so amusing to see lights flicker on and off as they toggle the light switch. Parents might not find it amusing, but this provides a learning moment for all of us.<\/p>\n\n\n\n<p>If you or your children have done that, then you have experienced a primitive form of pulse width modulation.<\/p>\n\n\n\n<p>With a Raspberry Pi, you can easily do this in an automated fashion. In essence, you&#8217;d tell the Raspberry Pi  how many times you&#8217;d want things to be &#8220;ON&#8221; in a specific period.<\/p>\n\n\n\n<p>This allows you to dim LEDs:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"360\" height=\"203\" src=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/05\/picockpit-gpio-pwm.gif\" alt=\"picockpit gpio pwm remote control\" class=\"wp-image-2285\"\/><figcaption class=\"wp-element-caption\">Toggling LED brightness with PiCockpit&#8217;s PWM function<\/figcaption><\/figure>\n<\/div>\n\n\n<p>As well, this allows you to control the angle of the servo&#8217;s arm.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">An important PWM concept: the duty cycle<\/h2>\n\n\n\n<p>A duty cycle is basically the time the circuit stays &#8220;high&#8221;, which means it&#8217;s turned on.<\/p>\n\n\n\n<p>So, let&#8217;s your circuit is on half the time. We can therefore say that the duty cycle is at 50%.<\/p>\n\n\n\n<p>If you have it turned on all the time, its duty cycle would be at 100%, and vice versa, turned off all the time means a 0<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/10\/image-1.png\" alt=\"\" class=\"wp-image-3095\" style=\"width:650px;height:446px\" width=\"650\" height=\"446\" srcset=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/10\/image-1.png 650w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/10\/image-1-300x206.png 300w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/10\/image-1-18x12.png 18w\" sizes=\"auto, (max-width: 650px) 100vw, 650px\" \/><figcaption class=\"wp-element-caption\">Duty cycle illustration from <a href=\"https:\/\/learn.sparkfun.com\/tutorials\/pulse-width-modulation\/all\" rel=\"nofollow\">Sparkfun <\/a>(CC BY-SA 4.0)<\/figcaption><\/figure>\n<\/div>\n\n\n<p>Going back to the example of a child turning lights on and off at a regular rate, the reason why the lights don&#8217;t light up fully or dim fully is because we are only delivering a voltage output for a specific portion of time.<\/p>\n\n\n\n<p>For an LED, this means the LED is lit for a period of time, then power is pulled, then power is delivered again, and repeat.<\/p>\n\n\n\n<p>So, the LED never gets bright enough to reach its full brightness, neither does it have enough time to go completely dark.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">SG90 servo control with PWM<\/h2>\n\n\n\n<p>We&#8217;d have to be cautious here as not all servos operate the same way. This tutorial is specific to the Tower Pro SG90 micro servo.<\/p>\n\n\n\n<p>The SG90 has a 180-degree rotation, but some servos are 120-degree servos. Radio control hobby servos are most likely to be 120 degree servos, so make sure to check the datasheet of the servo you&#8217;d want to manipulate as it&#8217;s possible to damage servos if you give it an out-of-range signal.<\/p>\n\n\n\n<p>This is the datasheet for the SG90, from Luxor Parts:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"601\" height=\"854\" src=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/10\/image-3.png\" alt=\"\" class=\"wp-image-3099\" srcset=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/10\/image-3.png 601w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/10\/image-3-211x300.png 211w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/10\/image-3-8x12.png 8w\" sizes=\"auto, (max-width: 601px) 100vw, 601px\" \/><figcaption class=\"wp-element-caption\">Luxor Parts&#8217; SG90 datasheet. <a href=\"https:\/\/www.kjell.com\/globalassets\/mediaassets\/701916_87897_datasheet_en.pdf?ref=4287817A7A\">Probably the most detailed datasheet. Click here for PDF.<\/a><\/figcaption><\/figure>\n<\/div>\n\n\n<p>The datasheet tells you two important things: which colour corresponds to positive, ground and signal and the pulse frequency\/duty cycle.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Brown = negative<\/li>\n\n\n\n<li>Red = positive<\/li>\n\n\n\n<li>Orange = signal<\/li>\n<\/ul>\n\n\n\n<p>And for pulse frequency\/duty cycle<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>You will need to have a duty cycle of 20ms or 50Hz.<\/li>\n\n\n\n<li>A signal of 1ms = zero degrees<\/li>\n\n\n\n<li>A signal of 2ms = 180 degrees rotated<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/10\/image-4.png\" alt=\"\" class=\"wp-image-3101\" style=\"width:660px;height:363px\" width=\"660\" height=\"363\" srcset=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/10\/image-4.png 954w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/10\/image-4-300x165.png 300w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/10\/image-4-768x423.png 768w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/10\/image-4-18x10.png 18w\" sizes=\"auto, (max-width: 660px) 100vw, 660px\" \/><figcaption class=\"wp-element-caption\">With a 1ms, signal, the servo is rotated zero degrees.<\/figcaption><\/figure>\n<\/div>\n\n\n<p>This means that every ms, the servo will look for an update. If you continue sending it a 2ms signal, it will stay at full rotation (180 degrees). If you change it to 1.5ms, it will rotate 90 degrees, and at 1ms, it will be rotated zero degrees.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/10\/image-5.png\" alt=\"\" class=\"wp-image-3102\" style=\"width:660px;height:370px\" width=\"660\" height=\"370\" srcset=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/10\/image-5.png 954w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/10\/image-5-300x168.png 300w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/10\/image-5-768x431.png 768w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/10\/image-5-18x10.png 18w\" sizes=\"auto, (max-width: 660px) 100vw, 660px\" \/><figcaption class=\"wp-element-caption\">With a signal of 2ms, the servo is rotated 180 degrees.<\/figcaption><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\">Connecting the servo to the Pico W<\/h2>\n\n\n\n<p>In order to use our code, you have to connect the <strong>signal wire to GPIO 0<\/strong>. The signal wire is the orange wire on the SG90.<\/p>\n\n\n\n<p>Then, connect the red wire to <strong>VBUS<\/strong> (which gives you 5V). As you can see from the datasheet, the operating voltage for the SG50 is 4.8V to 6V, so the 3.3V pin on the Pico W won&#8217;t work.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Coding the Pico W servo control<\/h2>\n\n\n\n<p>You can <a href=\"https:\/\/github.com\/pi3g\/pico-w\/tree\/main\/MicroPython\/V%20Pico%20W%20PWM%20servo%20controller\">find the code here<\/a> on our GitHub.<\/p>\n\n\n\n<p>Let&#8217;s go through the code.<\/p>\n\n\n\n<p>In <strong>main.py<\/strong>, which is a naming convention for the file we want to run on boot, we create a class for the servo and instantiate it:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"\nclass Servo:\n    def __init__(self, MIN_DUTY=300000, MAX_DUTY=2300000, pin=0, freq=50):\n        self.pwm = machine.PWM(machine.Pin(pin))\n        self.pwm.freq(freq)\n        self.MIN_DUTY = MIN_DUTY\n        self.MAX_DUTY = MAX_DUTY\n        \n    def rotateDeg(self, deg):\n        if deg < 0:\n            deg = 0\n        elif deg &gt; 180:\n            deg = 180\n        duty_ns = int(self.MAX_DUTY - deg * (self.MAX_DUTY-self.MIN_DUTY)\/180)\n        self.pwm.duty_ns(duty_ns)\n\nservo = Servo()\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">class<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">Servo<\/span><span style=\"color: #D8DEE9FF\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #8FBCBB\">def<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">__init__<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #8FBCBB\">self<\/span><span style=\"color: #D8DEE9FF\">, <\/span><span style=\"color: #8FBCBB\">MIN_DUTY<\/span><span style=\"color: #D8DEE9FF\">=300000, <\/span><span style=\"color: #8FBCBB\">MAX_DUTY<\/span><span style=\"color: #D8DEE9FF\">=2300000, <\/span><span style=\"color: #8FBCBB\">pin<\/span><span style=\"color: #D8DEE9FF\">=0, <\/span><span style=\"color: #8FBCBB\">freq<\/span><span style=\"color: #D8DEE9FF\">=50):<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #8FBCBB\">self<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">pwm<\/span><span style=\"color: #D8DEE9FF\"> = <\/span><span style=\"color: #8FBCBB\">machine<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">PWM<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #8FBCBB\">machine<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">Pin<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #8FBCBB\">pin<\/span><span style=\"color: #D8DEE9FF\">))<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #8FBCBB\">self<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">pwm<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">freq<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #8FBCBB\">freq<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #8FBCBB\">self<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">MIN_DUTY<\/span><span style=\"color: #D8DEE9FF\"> = <\/span><span style=\"color: #8FBCBB\">MIN_DUTY<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #8FBCBB\">self<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">MAX_DUTY<\/span><span style=\"color: #D8DEE9FF\"> = <\/span><span style=\"color: #8FBCBB\">MAX_DUTY<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #8FBCBB\">def<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">rotateDeg<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #8FBCBB\">self<\/span><span style=\"color: #D8DEE9FF\">, <\/span><span style=\"color: #8FBCBB\">deg<\/span><span style=\"color: #D8DEE9FF\">):<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #8FBCBB\">if<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">deg<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&lt;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">0<\/span><span style=\"color: #81A1C1\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">            deg <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">0<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        elif deg <\/span><span style=\"color: #ECEFF4\">&gt;<\/span><span style=\"color: #D8DEE9FF\"> 180:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">            <\/span><span style=\"color: #8FBCBB\">deg<\/span><span style=\"color: #D8DEE9FF\"> = 180<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #8FBCBB\">duty_ns<\/span><span style=\"color: #D8DEE9FF\"> = <\/span><span style=\"color: #8FBCBB\">int<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #8FBCBB\">self<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">MAX_DUTY<\/span><span style=\"color: #D8DEE9FF\"> - <\/span><span style=\"color: #8FBCBB\">deg<\/span><span style=\"color: #D8DEE9FF\"> * (<\/span><span style=\"color: #8FBCBB\">self<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">MAX_DUTY<\/span><span style=\"color: #D8DEE9FF\">-<\/span><span style=\"color: #8FBCBB\">self<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">MIN_DUTY<\/span><span style=\"color: #D8DEE9FF\">)\/180)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #8FBCBB\">self<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">pwm<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">duty_ns<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #8FBCBB\">duty_ns<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">servo<\/span><span style=\"color: #D8DEE9FF\"> = <\/span><span style=\"color: #8FBCBB\">Servo<\/span><span style=\"color: #D8DEE9FF\">()<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>The Servo class uses the machine.PWM class available in MicroPython. <a href=\"https:\/\/docs.micropython.org\/en\/latest\/library\/machine.PWM.html\">See documentation here.<\/a><\/p>\n\n\n\n<p>In this example, we are using the Pico W as an access point. Here&#8217;s the code to make that happen:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"ssid = 'Servo-Control'\npassword = 'PicoW-Servo'\n\nap = network.WLAN(network.AP_IF)\nap.config(essid=ssid, password=password)\nap.active(True)\n\nwhile ap.active() == False:\n  pass\n\nprint('Connection successful')\nprint(ap.ifconfig())\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #D8DEE9\">ssid<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">Servo-Control<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9\">password<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">PicoW-Servo<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9\">ap<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">network<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">WLAN<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #D8DEE9\">network<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #D8DEE9\">AP_IF<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9\">ap<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">config<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #D8DEE9\">essid<\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9\">ssid<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">password<\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9\">password<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9\">ap<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">active<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #D8DEE9\">True<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">while<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">ap<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">active<\/span><span style=\"color: #D8DEE9FF\">() <\/span><span style=\"color: #81A1C1\">==<\/span><span style=\"color: #D8DEE9FF\"> False<\/span><span style=\"color: #ECEFF4\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">  <\/span><span style=\"color: #D8DEE9\">pass<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #88C0D0\">print<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">Connection successful<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #88C0D0\">print<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #D8DEE9\">ap<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">ifconfig<\/span><span style=\"color: #D8DEE9FF\">())<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>As you can see from the first two lines, the SSID you&#8217;re looking for is <strong>Servo-Control<\/strong> and the password is <strong>PicoW-Servo<\/strong>.<\/p>\n\n\n\n<p>Once you have signed onto the WiFi network, you can go to the IP address of the Pico W, which by default is 192.168.4.1. Alternatively, you can also check the log on Thonny to see what your Pico&#8217;s IP address is.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How does the web page communicate with the servo?<\/h2>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"302\" height=\"230\" src=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/10\/image-6.png\" alt=\"\" class=\"wp-image-3105\" srcset=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/10\/image-6.png 302w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/10\/image-6-300x228.png 300w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/10\/image-6-16x12.png 16w\" sizes=\"auto, (max-width: 302px) 100vw, 302px\" \/><figcaption class=\"wp-element-caption\">Servo slider control<\/figcaption><\/figure>\n<\/div>\n\n\n<p>When you log onto the Pico W&#8217;s IP address, you are sent the index.html file, which can be found on the Github repo.<\/p>\n\n\n\n<p>The index.html file has these important lines:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\" <form id=&quot;form&quot;&gt;\n            <input type=&quot;range&quot; class=&quot;slider&quot; min=&quot;0&quot; max=&quot;180&quot; value=&quot;slider_value&quot; name=&quot;servo&quot; id=&quot;servo&quot;&gt;\n            <output&gt;<\/output&gt;\n        <\/form&gt;\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">&lt;form<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">id<\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">form<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #81A1C1\">&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">            <\/span><span style=\"color: #81A1C1\">&lt;input<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">type<\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">range<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">class<\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">slider<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">min<\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">0<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">max<\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">180<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">value<\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">slider_value<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">name<\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">servo<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">id<\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">servo<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #81A1C1\">&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">            <\/span><span style=\"color: #81A1C1\">&lt;output&gt;&lt;\/output&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #81A1C1\">&lt;\/form&gt;<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>As you can see, there&#8217;s an &lt;input&gt; object which is the slider.<\/p>\n\n\n\n<p>There&#8217;s also an &lt;output&gt; which displays the degree of rotation.<\/p>\n\n\n\n<p>The JavaScript portion updates the &lt;output&gt; as well as updates the URL so that the Pico W can capture the data and rotate the servo. <\/p>\n\n\n\n<p>The &lt;input&gt; and &lt;output&gt; elements are have a &lt;form&gt; parent.<\/p>\n\n\n\n<p>Here&#8217;s the script on the front end,<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"        <script&gt;\n            let i = document.getElementById('servo'),\n                o = document.querySelector('output');\n\n            o.innerHTML = i.value;\n\n            i.addEventListener('input', function () {\n              o.innerHTML = i.value;\n            }, false);\n            \n            i.addEventListener('change', function ()  {\n                document.getElementById(&quot;form&quot;).submit();\n            }, false);\n        <\/script&gt;\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #81A1C1\">&lt;script&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">            let i = document.getElementById(&#39;servo&#39;),<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">                o = document.querySelector(&#39;output&#39;);<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">            o.innerHTML = i.value;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">            i.addEventListener(&#39;input&#39;, function () <\/span><span style=\"color: #81A1C1\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">              <\/span><span style=\"color: #D8DEE9\">o<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #D8DEE9\">innerHTML<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">i<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #D8DEE9\">value<\/span><span style=\"color: #D8DEE9FF\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">            <\/span><span style=\"color: #81A1C1\">}<\/span><span style=\"color: #D8DEE9FF\">, false);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">            <\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">            i.addEventListener(&#39;change&#39;, function ()  <\/span><span style=\"color: #81A1C1\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">                <\/span><span style=\"color: #D8DEE9\">document<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">getElementById<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">form<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #D8DEE9FF\">)<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">submit<\/span><span style=\"color: #D8DEE9FF\">();<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">            <\/span><span style=\"color: #81A1C1\">}<\/span><span style=\"color: #D8DEE9FF\">, false);<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #81A1C1\">&lt;\/script&gt;<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>You&#8217;ll notice two EventListeners here. When you interact with the slider, it triggers an update to the &lt;output&gt; field and also causes the &lt;form&gt; to submit.<\/p>\n\n\n\n<p>When the &lt;form&gt; gets submitted, it causes the URL to have a parameter &#8220;servo=[degrees]&#8221;. For example, if you have pulled the slider to 180, it will be &#8220;index.html?servo=180&#8221;.<\/p>\n\n\n\n<p>This parameter is captured by the Pico W&#8217;s backend (main.py), processed to find the degrees specified by the user and then the <strong>rotateDeg<\/strong> method is called.<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"        index = request.find('servo=') + len('servo=')\n        if request[index].isdigit():\n            offset = 1\n            if request[index+1].isdigit():\n                offset = 2\n                if request[index+2].isdigit():\n                    offset = 3\n            deg = int(request[index:index+offset])\n            print(deg)\n        \n            servo.rotateDeg(deg)\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #D8DEE9\">index<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">request<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">find<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">servo=<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #D8DEE9FF\">) <\/span><span style=\"color: #81A1C1\">+<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">len<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">servo=<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #81A1C1\">if<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">request<\/span><span style=\"color: #D8DEE9FF\">[<\/span><span style=\"color: #D8DEE9\">index<\/span><span style=\"color: #D8DEE9FF\">]<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">isdigit<\/span><span style=\"color: #D8DEE9FF\">():<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">            <\/span><span style=\"color: #D8DEE9\">offset<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">1<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">            <\/span><span style=\"color: #81A1C1\">if<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">request<\/span><span style=\"color: #D8DEE9FF\">[<\/span><span style=\"color: #D8DEE9\">index<\/span><span style=\"color: #81A1C1\">+<\/span><span style=\"color: #B48EAD\">1<\/span><span style=\"color: #D8DEE9FF\">]<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">isdigit<\/span><span style=\"color: #D8DEE9FF\">():<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">                <\/span><span style=\"color: #D8DEE9\">offset<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">2<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">                <\/span><span style=\"color: #81A1C1\">if<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">request<\/span><span style=\"color: #D8DEE9FF\">[<\/span><span style=\"color: #D8DEE9\">index<\/span><span style=\"color: #81A1C1\">+<\/span><span style=\"color: #B48EAD\">2<\/span><span style=\"color: #D8DEE9FF\">]<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">isdigit<\/span><span style=\"color: #D8DEE9FF\">():<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">                    <\/span><span style=\"color: #D8DEE9\">offset<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">3<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">            <\/span><span style=\"color: #D8DEE9\">deg<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">int<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #D8DEE9\">request<\/span><span style=\"color: #D8DEE9FF\">[<\/span><span style=\"color: #D8DEE9\">index<\/span><span style=\"color: #D8DEE9FF\">:<\/span><span style=\"color: #D8DEE9\">index<\/span><span style=\"color: #81A1C1\">+<\/span><span style=\"color: #D8DEE9\">offset<\/span><span style=\"color: #D8DEE9FF\">])<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">            <\/span><span style=\"color: #88C0D0\">print<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #D8DEE9\">deg<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">            <\/span><span style=\"color: #D8DEE9\">servo<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">rotateDeg<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #D8DEE9\">deg<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Practical uses<\/h2>\n\n\n\n<p>A servo is a very important mechanical tool to know because it can be used in many settings. In fact, even complicated projects like robotic arms comprise of many servos working in unison.<\/p>\n\n\n\n<p>You can now build a project which turns off your bedroom lights:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"667\" height=\"500\" src=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/20220718_184650-1000px-edited.jpg\" alt=\"A Servo with a Pico W and PWM\" class=\"wp-image-2848\" srcset=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/20220718_184650-1000px-edited.jpg 667w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/20220718_184650-1000px-edited-300x225.jpg 300w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/20220718_184650-1000px-edited-16x12.jpg 16w\" sizes=\"auto, (max-width: 667px) 100vw, 667px\" \/><figcaption class=\"wp-element-caption\">Servo at full rotation, turning off the switch<\/figcaption><\/figure>\n<\/div>\n\n\n<p>On the other hand, you can also build cereal sorters, <a href=\"https:\/\/experiments.withgoogle.com\/tiny-sorter\/view\">like this Tiny Sorter<\/a>, made using AI and a microcontroller.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1001\" height=\"571\" src=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/10\/image-7.png\" alt=\"A Servo with a Pico W and PWM\" class=\"wp-image-3108\" srcset=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/10\/image-7.png 1001w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/10\/image-7-300x171.png 300w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/10\/image-7-768x438.png 768w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/10\/image-7-18x10.png 18w\" sizes=\"auto, (max-width: 1001px) 100vw, 1001px\" \/><figcaption class=\"wp-element-caption\">Tiny Sorter by Google Creative Lab. (<a href=\"https:\/\/experiments.withgoogle.com\/tiny-sorter\" rel=\"nofollow\">photo from Google<\/a>)<\/figcaption><\/figure>\n\n\n\n<p>If you look closely at the top where the googly eyes are, there&#8217;s a SG90 servo behind it.<\/p>\n\n\n\n<p>So there&#8217;s are some examples of how to control a servo with a Pico W through PWM.<\/p>\n\n\n\n<p>If you&#8217;re interested in seeing what else PWM can do, check out our article on <a href=\"https:\/\/picockpit.com\/raspberry-pi\/everything-about-sound-output-using-the-pico-w\/\">everything you can do with a Raspberry Pi Pico W related to audio<\/a>!<\/p>\n<div class=\"shariff shariff-align-center shariff-widget-align-left shariff-buttonstretch\"><ul class=\"shariff-buttons theme-white orientation-horizontal buttonsize-medium\"><li class=\"shariff-button twitter shariff-nocustomcolor\" style=\"background-color:#595959\"><a href=\"https:\/\/twitter.com\/share?url=https%3A%2F%2Fpicockpit.com%2Fraspberry-pi%2Fja%2F%25e3%2583%25a9%25e3%2582%25ba%25e3%2583%2599%25e3%2583%25aa%25e3%2583%25bc%25e3%2583%2591%25e3%2582%25a4%25e3%2583%25bb%25e3%2583%2594%25e3%2582%25b3w%25e3%2583%25bb%25e3%2583%2591%25e3%2583%25ab%25e3%2582%25b9%25e5%25b9%2585%25e5%25a4%2589%25e8%25aa%25bf%25e3%2583%25bbpwm%25e3%2581%25ab%25e3%2582%2588%25e3%2582%258b%2F&text=Control%20a%20servo%20with%20Raspberry%20Pi%20Pico%20W%20and%20PWM\" title=\"Share on X\" aria-label=\"Share on X\" role=\"button\" rel=\"noopener nofollow\" class=\"shariff-link\" style=\"; background-color:#000; color:#000\" target=\"_blank\"><span class=\"shariff-icon\" style=\"fill:#000\"><svg width=\"32px\" height=\"20px\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 24 24\"><path fill=\"#000\" d=\"M14.258 10.152L23.176 0h-2.113l-7.747 8.813L7.133 0H0l9.352 13.328L0 23.973h2.113l8.176-9.309 6.531 9.309h7.133zm-2.895 3.293l-.949-1.328L2.875 1.56h3.246l6.086 8.523.945 1.328 7.91 11.078h-3.246zm0 0\"\/><\/svg><\/span><span class=\"shariff-text\" style=\"color:#000\">\u5171\u6709<\/span>&nbsp;<\/a><\/li><li class=\"shariff-button facebook shariff-nocustomcolor\" style=\"background-color:#4273c8\"><a href=\"https:\/\/www.facebook.com\/sharer\/sharer.php?u=https%3A%2F%2Fpicockpit.com%2Fraspberry-pi%2Fja%2F%25e3%2583%25a9%25e3%2582%25ba%25e3%2583%2599%25e3%2583%25aa%25e3%2583%25bc%25e3%2583%2591%25e3%2582%25a4%25e3%2583%25bb%25e3%2583%2594%25e3%2582%25b3w%25e3%2583%25bb%25e3%2583%2591%25e3%2583%25ab%25e3%2582%25b9%25e5%25b9%2585%25e5%25a4%2589%25e8%25aa%25bf%25e3%2583%25bbpwm%25e3%2581%25ab%25e3%2582%2588%25e3%2582%258b%2F\" title=\"\u30d5\u30a7\u30a4\u30b9\u30d6\u30c3\u30af\u4e0a\u3067\u5171\u6709\" aria-label=\"\u30d5\u30a7\u30a4\u30b9\u30d6\u30c3\u30af\u4e0a\u3067\u5171\u6709\" role=\"button\" rel=\"nofollow\" class=\"shariff-link\" style=\"; background-color:#3b5998; color:#3b5998\" target=\"_blank\"><span class=\"shariff-icon\" style=\"fill:#3b5998\"><svg width=\"32px\" height=\"20px\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 18 32\"><path fill=\"#3b5998\" d=\"M17.1 0.2v4.7h-2.8q-1.5 0-2.1 0.6t-0.5 1.9v3.4h5.2l-0.7 5.3h-4.5v13.6h-5.5v-13.6h-4.5v-5.3h4.5v-3.9q0-3.3 1.9-5.2t5-1.8q2.6 0 4.1 0.2z\"\/><\/svg><\/span><span class=\"shariff-text\" style=\"color:#3b5998\">\u5171\u6709<\/span>&nbsp;<\/a><\/li><li class=\"shariff-button telegram shariff-nocustomcolor\" style=\"background-color:#4084A6\"><a href=\"https:\/\/telegram.me\/share\/url?url=https%3A%2F%2Fpicockpit.com%2Fraspberry-pi%2Fja%2F%25e3%2583%25a9%25e3%2582%25ba%25e3%2583%2599%25e3%2583%25aa%25e3%2583%25bc%25e3%2583%2591%25e3%2582%25a4%25e3%2583%25bb%25e3%2583%2594%25e3%2582%25b3w%25e3%2583%25bb%25e3%2583%2591%25e3%2583%25ab%25e3%2582%25b9%25e5%25b9%2585%25e5%25a4%2589%25e8%25aa%25bf%25e3%2583%25bbpwm%25e3%2581%25ab%25e3%2582%2588%25e3%2582%258b%2F&text=Control%20a%20servo%20with%20Raspberry%20Pi%20Pico%20W%20and%20PWM\" title=\"Telegram\u4e0a\u3067\u5171\u6709\" aria-label=\"Telegram\u4e0a\u3067\u5171\u6709\" role=\"button\" rel=\"noopener nofollow\" class=\"shariff-link\" style=\"; background-color:#0088cc; color:#0088cc\" target=\"_blank\"><span class=\"shariff-icon\" style=\"fill:#0088cc\"><svg width=\"32px\" height=\"20px\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 32 32\"><path fill=\"#0088cc\" d=\"M30.8 6.5l-4.5 21.4c-.3 1.5-1.2 1.9-2.5 1.2L16.9 24l-3.3 3.2c-.4.4-.7.7-1.4.7l.5-7L25.5 9.2c.6-.5-.1-.8-.9-.3l-15.8 10L2 16.7c-1.5-.5-1.5-1.5.3-2.2L28.9 4.3c1.3-.5 2.3.3 1.9 2.2z\"\/><\/svg><\/span><span class=\"shariff-text\" style=\"color:#0088cc\">\u5171\u6709<\/span>&nbsp;<\/a><\/li><li class=\"shariff-button reddit shariff-nocustomcolor\" style=\"background-color:#ff5700\"><a href=\"https:\/\/www.reddit.com\/submit?url=https%3A%2F%2Fpicockpit.com%2Fraspberry-pi%2Fja%2F%25e3%2583%25a9%25e3%2582%25ba%25e3%2583%2599%25e3%2583%25aa%25e3%2583%25bc%25e3%2583%2591%25e3%2582%25a4%25e3%2583%25bb%25e3%2583%2594%25e3%2582%25b3w%25e3%2583%25bb%25e3%2583%2591%25e3%2583%25ab%25e3%2582%25b9%25e5%25b9%2585%25e5%25a4%2589%25e8%25aa%25bf%25e3%2583%25bbpwm%25e3%2581%25ab%25e3%2582%2588%25e3%2582%258b%2F\" title=\"Reddit\u4e0a\u3067\u5171\u6709\" aria-label=\"Reddit\u4e0a\u3067\u5171\u6709\" role=\"button\" rel=\"noopener nofollow\" class=\"shariff-link\" style=\"; background-color:#ff4500; color:#ff4500\" target=\"_blank\"><span class=\"shariff-icon\" style=\"fill:#ff4500\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\"><path fill=\"#ff4500\" d=\"M440.3 203.5c-15 0-28.2 6.2-37.9 15.9-35.7-24.7-83.8-40.6-137.1-42.3L293 52.3l88.2 19.8c0 21.6 17.6 39.2 39.2 39.2 22 0 39.7-18.1 39.7-39.7s-17.6-39.7-39.7-39.7c-15.4 0-28.7 9.3-35.3 22l-97.4-21.6c-4.9-1.3-9.7 2.2-11 7.1L246.3 177c-52.9 2.2-100.5 18.1-136.3 42.8-9.7-10.1-23.4-16.3-38.4-16.3-55.6 0-73.8 74.6-22.9 100.1-1.8 7.9-2.6 16.3-2.6 24.7 0 83.8 94.4 151.7 210.3 151.7 116.4 0 210.8-67.9 210.8-151.7 0-8.4-.9-17.2-3.1-25.1 49.9-25.6 31.5-99.7-23.8-99.7zM129.4 308.9c0-22 17.6-39.7 39.7-39.7 21.6 0 39.2 17.6 39.2 39.7 0 21.6-17.6 39.2-39.2 39.2-22 .1-39.7-17.6-39.7-39.2zm214.3 93.5c-36.4 36.4-139.1 36.4-175.5 0-4-3.5-4-9.7 0-13.7 3.5-3.5 9.7-3.5 13.2 0 27.8 28.5 120 29 149 0 3.5-3.5 9.7-3.5 13.2 0 4.1 4 4.1 10.2.1 13.7zm-.8-54.2c-21.6 0-39.2-17.6-39.2-39.2 0-22 17.6-39.7 39.2-39.7 22 0 39.7 17.6 39.7 39.7-.1 21.5-17.7 39.2-39.7 39.2z\"\/><\/svg><\/span><span class=\"shariff-text\" style=\"color:#ff4500\">\u5171\u6709<\/span>&nbsp;<\/a><\/li><\/ul><\/div>","protected":false},"excerpt":{"rendered":"<p>\u30b5\u30fc\u30dc\u306f\u3001Raspberry Pi\u3067\u30d1\u30eb\u30b9\u5e45\u5909\u8abf\uff08PWM\uff09\u306e\u4f7f\u3044\u65b9\u3092\u5b66\u3076\u6700\u3082\u57fa\u672c\u7684\u306a\u65b9\u6cd5\u306e1\u3064\u3067\u3059\u3002\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001Raspberry Pi Pico W\u3067\u3053\u308c\u3092\u884c\u3046\u65b9\u6cd5\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002 PWM\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u306e\u76ee\u7684 \u5fc5\u8981\u306a\u30d1\u30fc\u30c4 \u30d1\u30eb\u30b9\u5e45\u5909\u8abf\u3068\u306f\uff1f\u5b50\u3069\u3082\u305f\u3061\u306f\u3001\u96fb\u6c17\u3092\u3064\u3051\u305f\u308a\u6d88\u3057\u305f\u308a\u3092\u7e70\u308a\u8fd4\u3059\u3053\u3068\u3092\u9762\u767d\u304c\u308a\u307e\u3059\u3002\u96fb\u6c17\u306e\u30b9\u30a4\u30c3\u30c1\u3092\u5207\u308a\u66ff\u3048\u308b\u3068\u3001\u660e\u304b\u308a\u304c\u30c1\u30ab\u30c1\u30ab\u3068\u3064\u3044\u305f\u308a\u6d88\u3048\u305f\u308a\u3059\u308b\u306e\u3092\u898b\u308b\u306e\u304c\u9762\u767d\u3044\u306e\u3067\u3059\u3002\u89aa\u306f\u9762\u767d\u304f\u306a\u3044\u304b\u3082\u3057\u308c\u306a\u3044\u304c\u3001\u3053\u308c\u306f\u79c1\u305f\u3061\u5168\u54e1\u306b\u3068\u3063\u3066\u52c9\u5f37\u306b\u306a\u308b\u3002\u3082\u3057\u3001\u3042\u306a\u305f\u3084\u3042\u306a\u305f\u306e\u304a\u5b50\u3055\u3093\u304c\u305d\u306e\u3088\u3046\u306a\u3053\u3068\u3092\u3057\u305f\u3053\u3068\u304c\u3042\u308b\u306a\u3089\u3001\u305d\u308c\u306f\u539f\u59cb\u7684\u306a\u5f62\u3092\u7d4c\u9a13\u3057\u305f\u3053\u3068\u306b\u306a\u308b\u3002<\/p>","protected":false},"author":2,"featured_media":3112,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[360,11,221,193,486,447,485,367,187,456,484],"class_list":["post-3092","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-raspberry-pi-pico","tag-output","tag-pico","tag-pico-w","tag-picockpit","tag-project","tag-projects","tag-pulse-width-modulation","tag-pwm","tag-raspberry-pi","tag-raspberry-pi-projects","tag-servo"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Control a servo with Raspberry Pi Pico W and PWM | PiCockpit<\/title>\n<meta name=\"description\" content=\"This tutorial will teach you how to control a servo using a Raspberry Pi Pico W and PWM via a web server which you can access via your phone.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/picockpit.com\/raspberry-pi\/ja\/\u30e9\u30ba\u30d9\u30ea\u30fc\u30d1\u30a4\u30fb\u30d4\u30b3w\u30fb\u30d1\u30eb\u30b9\u5e45\u5909\u8abf\u30fbpwm\u306b\u3088\u308b\/\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Control a servo with Raspberry Pi Pico W and PWM | PiCockpit\" \/>\n<meta property=\"og:description\" content=\"This tutorial will teach you how to control a servo using a Raspberry Pi Pico W and PWM via a web server which you can access via your phone.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/picockpit.com\/raspberry-pi\/ja\/\u30e9\u30ba\u30d9\u30ea\u30fc\u30d1\u30a4\u30fb\u30d4\u30b3w\u30fb\u30d1\u30eb\u30b9\u5e45\u5909\u8abf\u30fbpwm\u306b\u3088\u308b\/\" \/>\n<meta property=\"og:site_name\" content=\"PiCockpit\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/pi3gshop\" \/>\n<meta property=\"article:published_time\" content=\"2022-10-03T12:37:39+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-08-21T13:11:49+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/10\/featured-image.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1000\" \/>\n\t<meta property=\"og:image:height\" content=\"563\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"raspi berry\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@pi3g\" \/>\n<meta name=\"twitter:site\" content=\"@pi3g\" \/>\n<meta name=\"twitter:label1\" content=\"\u57f7\u7b46\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"raspi berry\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593\" \/>\n\t<meta name=\"twitter:data2\" content=\"8\u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/fr\\\/comment-controler-un-servo-avec-raspberry-pi-pico-w-et-modulation-de-largeur-dimpulsion-pwm\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/fr\\\/comment-controler-un-servo-avec-raspberry-pi-pico-w-et-modulation-de-largeur-dimpulsion-pwm\\\/\"},\"author\":{\"name\":\"raspi berry\",\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/#\\\/schema\\\/person\\\/7af3a7a8c999bc722029ef9ca9d78eee\"},\"headline\":\"Control a servo with Raspberry Pi Pico W and PWM\",\"datePublished\":\"2022-10-03T12:37:39+00:00\",\"dateModified\":\"2023-08-21T13:11:49+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/fr\\\/comment-controler-un-servo-avec-raspberry-pi-pico-w-et-modulation-de-largeur-dimpulsion-pwm\\\/\"},\"wordCount\":1216,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/fr\\\/comment-controler-un-servo-avec-raspberry-pi-pico-w-et-modulation-de-largeur-dimpulsion-pwm\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/wp-content\\\/uploads\\\/2022\\\/10\\\/featured-image.jpg\",\"keywords\":[\"Output\",\"Pico\",\"Pico W\",\"picockpit\",\"project\",\"Projects\",\"pulse width modulation\",\"PWM\",\"Raspberry Pi\",\"Raspberry Pi projects\",\"servo\"],\"articleSection\":[\"Raspberry Pi Pico\"],\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/fr\\\/comment-controler-un-servo-avec-raspberry-pi-pico-w-et-modulation-de-largeur-dimpulsion-pwm\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/fr\\\/comment-controler-un-servo-avec-raspberry-pi-pico-w-et-modulation-de-largeur-dimpulsion-pwm\\\/\",\"url\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/fr\\\/comment-controler-un-servo-avec-raspberry-pi-pico-w-et-modulation-de-largeur-dimpulsion-pwm\\\/\",\"name\":\"Control a servo with Raspberry Pi Pico W and PWM | PiCockpit\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/fr\\\/comment-controler-un-servo-avec-raspberry-pi-pico-w-et-modulation-de-largeur-dimpulsion-pwm\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/fr\\\/comment-controler-un-servo-avec-raspberry-pi-pico-w-et-modulation-de-largeur-dimpulsion-pwm\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/wp-content\\\/uploads\\\/2022\\\/10\\\/featured-image.jpg\",\"datePublished\":\"2022-10-03T12:37:39+00:00\",\"dateModified\":\"2023-08-21T13:11:49+00:00\",\"description\":\"This tutorial will teach you how to control a servo using a Raspberry Pi Pico W and PWM via a web server which you can access via your phone.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/fr\\\/comment-controler-un-servo-avec-raspberry-pi-pico-w-et-modulation-de-largeur-dimpulsion-pwm\\\/#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/fr\\\/comment-controler-un-servo-avec-raspberry-pi-pico-w-et-modulation-de-largeur-dimpulsion-pwm\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/fr\\\/comment-controler-un-servo-avec-raspberry-pi-pico-w-et-modulation-de-largeur-dimpulsion-pwm\\\/#primaryimage\",\"url\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/wp-content\\\/uploads\\\/2022\\\/10\\\/featured-image.jpg\",\"contentUrl\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/wp-content\\\/uploads\\\/2022\\\/10\\\/featured-image.jpg\",\"width\":1000,\"height\":563,\"caption\":\"how to control servo with pwm raspberry pi pico w\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/fr\\\/comment-controler-un-servo-avec-raspberry-pi-pico-w-et-modulation-de-largeur-dimpulsion-pwm\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Raspberry Pi Pico\",\"item\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/category\\\/raspberry-pi-pico\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Control a servo with Raspberry Pi Pico W and PWM\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/#website\",\"url\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/\",\"name\":\"PiCockpit\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ja\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/#organization\",\"name\":\"PiCockpit.com\",\"url\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/wp-content\\\/uploads\\\/2023\\\/07\\\/Screenshot-from-2023-07-24-15-01-24.png\",\"contentUrl\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/wp-content\\\/uploads\\\/2023\\\/07\\\/Screenshot-from-2023-07-24-15-01-24.png\",\"width\":1165,\"height\":283,\"caption\":\"PiCockpit.com\"},\"image\":{\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/pi3gshop\",\"https:\\\/\\\/x.com\\\/pi3g\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/#\\\/schema\\\/person\\\/7af3a7a8c999bc722029ef9ca9d78eee\",\"name\":\"raspi berry\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/c10c423ceeff34163dd54a5472d6da17d71c0e360e0cf8cdb8847006372f216b?s=96&d=blank&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/c10c423ceeff34163dd54a5472d6da17d71c0e360e0cf8cdb8847006372f216b?s=96&d=blank&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/c10c423ceeff34163dd54a5472d6da17d71c0e360e0cf8cdb8847006372f216b?s=96&d=blank&r=g\",\"caption\":\"raspi berry\"},\"description\":\"I'm here to help you with all your Raspberry Pi related questions &amp; love to share about new project ideas for the Raspberry Pi, and give quick tips. Of course I'll also help you with PiCockpit and how to make your Raspberry Pi even easier to use with this raspberry pi monitoring solution :-)\",\"sameAs\":[\"https:\\\/\\\/picockpit.com\"],\"url\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/ja\\\/author\\\/raspi-berry\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Raspberry Pi Pico W\u3068PWM\u3067\u30b5\u30fc\u30dc\u3092\u5236\u5fa1\u3059\u308b\uff5cPiCockpit\uff08\u30d1\u30a4\u30b3\u30c3\u30af\u30d4\u30c3\u30c8","description":"\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f\u3001Raspberry Pi Pico W\u3068PWM\u3092\u4f7f\u7528\u3057\u3066\u3001\u643a\u5e2f\u96fb\u8a71\u304b\u3089\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308bWeb\u30b5\u30fc\u30d0\u30fc\u7d4c\u7531\u3067\u30b5\u30fc\u30dc\u3092\u5236\u5fa1\u3059\u308b\u65b9\u6cd5\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/picockpit.com\/raspberry-pi\/ja\/\u30e9\u30ba\u30d9\u30ea\u30fc\u30d1\u30a4\u30fb\u30d4\u30b3w\u30fb\u30d1\u30eb\u30b9\u5e45\u5909\u8abf\u30fbpwm\u306b\u3088\u308b\/","og_locale":"ja_JP","og_type":"article","og_title":"Control a servo with Raspberry Pi Pico W and PWM | PiCockpit","og_description":"This tutorial will teach you how to control a servo using a Raspberry Pi Pico W and PWM via a web server which you can access via your phone.","og_url":"https:\/\/picockpit.com\/raspberry-pi\/ja\/\u30e9\u30ba\u30d9\u30ea\u30fc\u30d1\u30a4\u30fb\u30d4\u30b3w\u30fb\u30d1\u30eb\u30b9\u5e45\u5909\u8abf\u30fbpwm\u306b\u3088\u308b\/","og_site_name":"PiCockpit","article_publisher":"https:\/\/www.facebook.com\/pi3gshop","article_published_time":"2022-10-03T12:37:39+00:00","article_modified_time":"2023-08-21T13:11:49+00:00","og_image":[{"width":1000,"height":563,"url":"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/10\/featured-image.jpg","type":"image\/jpeg"}],"author":"raspi berry","twitter_card":"summary_large_image","twitter_creator":"@pi3g","twitter_site":"@pi3g","twitter_misc":{"\u57f7\u7b46\u8005":"raspi berry","\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593":"8\u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/picockpit.com\/raspberry-pi\/fr\/comment-controler-un-servo-avec-raspberry-pi-pico-w-et-modulation-de-largeur-dimpulsion-pwm\/#article","isPartOf":{"@id":"https:\/\/picockpit.com\/raspberry-pi\/fr\/comment-controler-un-servo-avec-raspberry-pi-pico-w-et-modulation-de-largeur-dimpulsion-pwm\/"},"author":{"name":"raspi berry","@id":"https:\/\/picockpit.com\/raspberry-pi\/#\/schema\/person\/7af3a7a8c999bc722029ef9ca9d78eee"},"headline":"Control a servo with Raspberry Pi Pico W and PWM","datePublished":"2022-10-03T12:37:39+00:00","dateModified":"2023-08-21T13:11:49+00:00","mainEntityOfPage":{"@id":"https:\/\/picockpit.com\/raspberry-pi\/fr\/comment-controler-un-servo-avec-raspberry-pi-pico-w-et-modulation-de-largeur-dimpulsion-pwm\/"},"wordCount":1216,"commentCount":2,"publisher":{"@id":"https:\/\/picockpit.com\/raspberry-pi\/#organization"},"image":{"@id":"https:\/\/picockpit.com\/raspberry-pi\/fr\/comment-controler-un-servo-avec-raspberry-pi-pico-w-et-modulation-de-largeur-dimpulsion-pwm\/#primaryimage"},"thumbnailUrl":"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/10\/featured-image.jpg","keywords":["Output","Pico","Pico W","picockpit","project","Projects","pulse width modulation","PWM","Raspberry Pi","Raspberry Pi projects","servo"],"articleSection":["Raspberry Pi Pico"],"inLanguage":"ja","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/picockpit.com\/raspberry-pi\/fr\/comment-controler-un-servo-avec-raspberry-pi-pico-w-et-modulation-de-largeur-dimpulsion-pwm\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/picockpit.com\/raspberry-pi\/fr\/comment-controler-un-servo-avec-raspberry-pi-pico-w-et-modulation-de-largeur-dimpulsion-pwm\/","url":"https:\/\/picockpit.com\/raspberry-pi\/fr\/comment-controler-un-servo-avec-raspberry-pi-pico-w-et-modulation-de-largeur-dimpulsion-pwm\/","name":"Raspberry Pi Pico W\u3068PWM\u3067\u30b5\u30fc\u30dc\u3092\u5236\u5fa1\u3059\u308b\uff5cPiCockpit\uff08\u30d1\u30a4\u30b3\u30c3\u30af\u30d4\u30c3\u30c8","isPartOf":{"@id":"https:\/\/picockpit.com\/raspberry-pi\/#website"},"primaryImageOfPage":{"@id":"https:\/\/picockpit.com\/raspberry-pi\/fr\/comment-controler-un-servo-avec-raspberry-pi-pico-w-et-modulation-de-largeur-dimpulsion-pwm\/#primaryimage"},"image":{"@id":"https:\/\/picockpit.com\/raspberry-pi\/fr\/comment-controler-un-servo-avec-raspberry-pi-pico-w-et-modulation-de-largeur-dimpulsion-pwm\/#primaryimage"},"thumbnailUrl":"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/10\/featured-image.jpg","datePublished":"2022-10-03T12:37:39+00:00","dateModified":"2023-08-21T13:11:49+00:00","description":"\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f\u3001Raspberry Pi Pico W\u3068PWM\u3092\u4f7f\u7528\u3057\u3066\u3001\u643a\u5e2f\u96fb\u8a71\u304b\u3089\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308bWeb\u30b5\u30fc\u30d0\u30fc\u7d4c\u7531\u3067\u30b5\u30fc\u30dc\u3092\u5236\u5fa1\u3059\u308b\u65b9\u6cd5\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002","breadcrumb":{"@id":"https:\/\/picockpit.com\/raspberry-pi\/fr\/comment-controler-un-servo-avec-raspberry-pi-pico-w-et-modulation-de-largeur-dimpulsion-pwm\/#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/picockpit.com\/raspberry-pi\/fr\/comment-controler-un-servo-avec-raspberry-pi-pico-w-et-modulation-de-largeur-dimpulsion-pwm\/"]}]},{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/picockpit.com\/raspberry-pi\/fr\/comment-controler-un-servo-avec-raspberry-pi-pico-w-et-modulation-de-largeur-dimpulsion-pwm\/#primaryimage","url":"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/10\/featured-image.jpg","contentUrl":"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/10\/featured-image.jpg","width":1000,"height":563,"caption":"how to control servo with pwm raspberry pi pico w"},{"@type":"BreadcrumbList","@id":"https:\/\/picockpit.com\/raspberry-pi\/fr\/comment-controler-un-servo-avec-raspberry-pi-pico-w-et-modulation-de-largeur-dimpulsion-pwm\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/picockpit.com\/raspberry-pi\/"},{"@type":"ListItem","position":2,"name":"Raspberry Pi Pico","item":"https:\/\/picockpit.com\/raspberry-pi\/category\/raspberry-pi-pico\/"},{"@type":"ListItem","position":3,"name":"Control a servo with Raspberry Pi Pico W and PWM"}]},{"@type":"WebSite","@id":"https:\/\/picockpit.com\/raspberry-pi\/#website","url":"https:\/\/picockpit.com\/raspberry-pi\/","name":"PiCockpit","description":"","publisher":{"@id":"https:\/\/picockpit.com\/raspberry-pi\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/picockpit.com\/raspberry-pi\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ja"},{"@type":"Organization","@id":"https:\/\/picockpit.com\/raspberry-pi\/#organization","name":"PiCockpit.com","url":"https:\/\/picockpit.com\/raspberry-pi\/","logo":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/picockpit.com\/raspberry-pi\/#\/schema\/logo\/image\/","url":"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2023\/07\/Screenshot-from-2023-07-24-15-01-24.png","contentUrl":"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2023\/07\/Screenshot-from-2023-07-24-15-01-24.png","width":1165,"height":283,"caption":"PiCockpit.com"},"image":{"@id":"https:\/\/picockpit.com\/raspberry-pi\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/pi3gshop","https:\/\/x.com\/pi3g"]},{"@type":"Person","@id":"https:\/\/picockpit.com\/raspberry-pi\/#\/schema\/person\/7af3a7a8c999bc722029ef9ca9d78eee","name":"\u30e9\u30ba\u30d1\u30a4\u30fb\u30d9\u30ea\u30fc","image":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/secure.gravatar.com\/avatar\/c10c423ceeff34163dd54a5472d6da17d71c0e360e0cf8cdb8847006372f216b?s=96&d=blank&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/c10c423ceeff34163dd54a5472d6da17d71c0e360e0cf8cdb8847006372f216b?s=96&d=blank&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c10c423ceeff34163dd54a5472d6da17d71c0e360e0cf8cdb8847006372f216b?s=96&d=blank&r=g","caption":"raspi berry"},"description":"\u79c1\u306fRaspberry Pi\u306b\u95a2\u3059\u308b\u3042\u3089\u3086\u308b\u8cea\u554f\u306b\u304a\u7b54\u3048\u3057\u3001Raspberry Pi\u306e\u65b0\u3057\u3044\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u30a2\u30a4\u30c7\u30a2\u3084\u7c21\u5358\u306a\u30d2\u30f3\u30c8\u3092\u5171\u6709\u3059\u308b\u306e\u304c\u5927\u597d\u304d\u3067\u3059\u3002\u3082\u3061\u308d\u3093\u3001PiCockpit\u306b\u3064\u3044\u3066\u3082\u304a\u624b\u4f1d\u3044\u3057\u307e\u3059\u3057\u3001\u3053\u306e\u30e9\u30ba\u30d9\u30ea\u30fc\u30d1\u30a4\u30fb\u30e2\u30cb\u30bf\u30ea\u30f3\u30b0\u30fb\u30bd\u30ea\u30e5\u30fc\u30b7\u30e7\u30f3\u3092\u4f7f\u3063\u3066Raspberry Pi\u3092\u3088\u308a\u4f7f\u3044\u3084\u3059\u304f\u3059\u308b\u65b9\u6cd5\u3082\u3054\u7d39\u4ecb\u3057\u307e\u3059 :-)","sameAs":["https:\/\/picockpit.com"],"url":"https:\/\/picockpit.com\/raspberry-pi\/ja\/author\/raspi-berry\/"}]}},"_links":{"self":[{"href":"https:\/\/picockpit.com\/raspberry-pi\/ja\/wp-json\/wp\/v2\/posts\/3092","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/picockpit.com\/raspberry-pi\/ja\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/picockpit.com\/raspberry-pi\/ja\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/picockpit.com\/raspberry-pi\/ja\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/picockpit.com\/raspberry-pi\/ja\/wp-json\/wp\/v2\/comments?post=3092"}],"version-history":[{"count":14,"href":"https:\/\/picockpit.com\/raspberry-pi\/ja\/wp-json\/wp\/v2\/posts\/3092\/revisions"}],"predecessor-version":[{"id":4834,"href":"https:\/\/picockpit.com\/raspberry-pi\/ja\/wp-json\/wp\/v2\/posts\/3092\/revisions\/4834"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/picockpit.com\/raspberry-pi\/ja\/wp-json\/wp\/v2\/media\/3112"}],"wp:attachment":[{"href":"https:\/\/picockpit.com\/raspberry-pi\/ja\/wp-json\/wp\/v2\/media?parent=3092"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/picockpit.com\/raspberry-pi\/ja\/wp-json\/wp\/v2\/categories?post=3092"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/picockpit.com\/raspberry-pi\/ja\/wp-json\/wp\/v2\/tags?post=3092"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}