{"id":2824,"date":"2022-07-19T12:43:06","date_gmt":"2022-07-19T12:43:06","guid":{"rendered":"https:\/\/picockpit.com\/raspberry-pi\/?p=2824"},"modified":"2023-08-22T14:46:06","modified_gmt":"2023-08-22T14:46:06","slug":"diy-wireless-servo-switch-controller-with-raspberry-pi-pico-w","status":"publish","type":"post","link":"https:\/\/picockpit.com\/raspberry-pi\/sv\/diy-wireless-servo-switch-controller-with-raspberry-pi-pico-w\/","title":{"rendered":"G\u00f6r-det-sj\u00e4lv tr\u00e5dl\u00f6s servokontroll med Raspberry Pi Pico W"},"content":{"rendered":"<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/featured-image-4-1024x576.jpg\" alt=\"Pico W Servo Switch Controller Titelbild\" class=\"wp-image-2854\" srcset=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/featured-image-4-1024x576.jpg 1024w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/featured-image-4-300x169.jpg 300w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/featured-image-4-768x432.jpg 768w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/featured-image-4-1536x864.jpg 1536w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/featured-image-4-18x10.jpg 18w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/featured-image-4.jpg 1778w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Ett av de st\u00f6rsta problemen jag har \u00e4r att g\u00e5 upp ur s\u00e4ngen f\u00f6r att sl\u00e4cka sovrumslampan. Det \u00e4r v\u00e4ldigt sv\u00e5rt att g\u00f6ra det n\u00e4r man ligger och myser i s\u00e4ngen. S\u00e5 h\u00e4r vill jag ber\u00e4tta hur man l\u00f6ser det problemet med en Pico W Servo switch controller.<\/p>\n\n\n\n<p>F\u00f6r n\u00e5gra \u00e5r sedan byggde jag n\u00e4mligen en tr\u00e5dl\u00f6s l\u00f6sning med en Arduino och en IR-fj\u00e4rrkontroll. Det fungerade ganska bra eftersom det var p\u00e5litligt och det l\u00f6ste mitt problem. Det var dock inte utan sina nackdelar.<\/p>\n\n\n\n<p>F\u00f6r det f\u00f6rsta var Arduino Uno massiv j\u00e4mf\u00f6rt med Raspberry Pi Pico W.<\/p>\n\n\n\n<p>F\u00f6r det andra var den beroende av en IR-signal, vilket innebar att jag beh\u00f6vde veta var min IR-fj\u00e4rrkontroll var n\u00e4r jag ville sl\u00e4cka lampan.<\/p>\n\n\n\n<p>Och det \u00e4r h\u00e4r som Raspberry Pi Pico W har sin f\u00f6rdel. Du kan styra servon direkt fr\u00e5n din telefon.<\/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\/07\/diy-wireless-switch-control-project.jpg\" alt=\"Styrenhet f\u00f6r servobrytare Pico W\" class=\"wp-image-2853\" style=\"width:519px;height:386px\" width=\"519\" height=\"386\" srcset=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/diy-wireless-switch-control-project.jpg 1000w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/diy-wireless-switch-control-project-300x223.jpg 300w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/diy-wireless-switch-control-project-768x571.jpg 768w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/diy-wireless-switch-control-project-16x12.jpg 16w\" sizes=\"auto, (max-width: 519px) 100vw, 519px\" \/><figcaption class=\"wp-element-caption\">\u00d6versikt \u00f6ver DIY-projektet f\u00f6r tr\u00e5dl\u00f6s v\u00e4xelstyrning<\/figcaption><\/figure>\n<\/div>\n\n\n\n\n<h2 class=\"wp-block-heading\">Varf\u00f6r g\u00f6ra det h\u00e4r DIY-projektet?<\/h2>\n\n\n\n<p>Den \u00e4r ful. Det \u00e4r tr\u00e5kigt.<\/p>\n\n\n\n<p>Men det handlar ocks\u00e5 om gl\u00e4djen och n\u00f6jet att skapa sin egen l\u00f6sning p\u00e5 sina problem.<\/p>\n\n\n\n<p>Moderna problem kr\u00e4ver moderna l\u00f6sningar, och <a href=\"https:\/\/picockpit.com\/raspberry-pi\/raspberry-pi-project-ideas-modern-solutions-require-more-modern-solutions\/\">H\u00e4r kan du se hur folk l\u00f6ser sina problem med Raspberry Pi.<\/a>.<\/p>\n\n\n\n<p>Dessutom kan du beh\u00f6va g\u00f6ra detta eftersom du inte f\u00e5r \u00e4ndra den elektriska installationen i ditt hem. <\/p>\n\n\n\n<p>Eller s\u00e5 vill du inte g\u00e5 igenom kostnaderna f\u00f6r att anlita en professionell person f\u00f6r att g\u00f6ra det.<\/p>\n\n\n\n<p>Ett annat sk\u00e4l \u00e4r att projektet \u00e4r s\u00e5 utbyggbart och portabelt. Du beh\u00f6ver inte bara anv\u00e4nda det p\u00e5 en str\u00f6mbrytare, du kan anv\u00e4nda det p\u00e5 ett tangentbord, f\u00f6r att stoppa sk\u00e4rmsl\u00e4ckare, till exempel.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Video<\/h2>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\"><\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<iframe loading=\"lazy\" width=\"225\" height=\"400\" src=\"https:\/\/www.youtube.com\/embed\/g2T8vYcRi1Y\" title=\"G\u00f6r-det-sj\u00e4lv tr\u00e5dl\u00f6s servokontroll med Raspberry Pi Pico W #shorts\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen=\"\"><\/iframe>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\"><\/div>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Det \u00e4r m\u00f6jligt att styra tv\u00e5v\u00e4gsbrytare, men det \u00e4r enklast med ett s\u00e4tt.<\/h2>\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\/07\/20220718_184642-1000px-edited.jpg\" alt=\"Styrenhet f\u00f6r servobrytare Pico W\" class=\"wp-image-2847\" style=\"width:545px;height:409px\" width=\"545\" height=\"409\" srcset=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/20220718_184642-1000px-edited.jpg 769w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/20220718_184642-1000px-edited-300x225.jpg 300w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/20220718_184642-1000px-edited-16x12.jpg 16w\" sizes=\"auto, (max-width: 545px) 100vw, 545px\" \/><figcaption class=\"wp-element-caption\">Servo f\u00f6rberedd f\u00f6r att st\u00e4nga av ljusbrytaren<\/figcaption><\/figure>\n<\/div>\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\/07\/20220718_184650-1000px-edited.jpg\" alt=\"Styrenhet f\u00f6r servobrytare Pico W\" class=\"wp-image-2848\" style=\"width:539px;height:404px\" width=\"539\" height=\"404\" 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: 539px) 100vw, 539px\" \/><figcaption class=\"wp-element-caption\">Servo vid full rotation, st\u00e4nga av str\u00f6mbrytaren<\/figcaption><\/figure>\n<\/div>\n\n\n<p>Om det finns en sak som du definitivt kan g\u00f6ra med alla str\u00f6mbrytare i v\u00e4rlden, oavsett om de \u00e4r europeiska eller nordamerikanska, kan du alltid anv\u00e4nda en servo f\u00f6r att st\u00e4nga av eller s\u00e4tta p\u00e5 den.<\/p>\n\n\n\n<p>Men om du vill styra str\u00f6mbrytaren \u00e5t b\u00e5da h\u00e5llen blir det en st\u00f6rre teknisk utmaning eftersom servotorn kan komma i v\u00e4gen.<\/p>\n\n\n\n<p>Om du till exempel beh\u00f6ver kunna sl\u00e5 av eller p\u00e5 str\u00f6mbrytaren manuellt kan du tycka att servoarmarna \u00e4r i v\u00e4gen. Du kan inte tvinga den ur v\u00e4gen utan att f\u00f6rst\u00f6ra motorn, eftersom servoarmarna \u00e4r programmerade att h\u00e5lla sig p\u00e5 plats med all sin kraft.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">S\u00e4nda n\u00e4tverk eller ansluta till ett n\u00e4tverk?<\/h2>\n\n\n\n<p>Raspberry Pi Pico W kan anslutas till ditt hemn\u00e4tverk eller s\u00e4nda ut sitt eget n\u00e4tverk.<\/p>\n\n\n\n<p>Jag har pr\u00f6vat b\u00e5da metoderna och funnit f\u00f6r- och nackdelar med dem.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Som en station (dvs. ansluter till ett n\u00e4tverk)<\/h3>\n\n\n\n<p>I den ursprungliga designen fick jag min Pico W att ansluta till mitt hemn\u00e4tverk och den serverade en HTML-fil med en knapp p\u00e5 IP-adressen 192.168.0.70.<\/p>\n\n\n\n<p>F\u00f6rdelen med detta var att jag enkelt kunde starta upp min webbl\u00e4sare och trycka p\u00e5 knappen som sl\u00e4ckte ljuset.<\/p>\n\n\n\n<p>Nackdelen \u00e4r dock att vem som helst i n\u00e4tverket ocks\u00e5 kunde g\u00f6ra det, om du inte inf\u00f6rde n\u00e5gon form av autentisering.<\/p>\n\n\n\n<p>En annan nackdel \u00e4r att Raspberry Pi Pico W inte kan \u00e5teranslutas till n\u00e4tverket om ditt hemn\u00e4tverk f\u00f6rlorar str\u00f6mmen, s\u00e5vida du inte har implementerat kod som startar om Pico W eller \u00e5teransluter den till n\u00e4tverket.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Som en \u00e5tkomstpunkt<\/h3>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"358\" height=\"172\" src=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-57.png\" alt=\"\" class=\"wp-image-2851\" srcset=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-57.png 358w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-57-300x144.png 300w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-57-18x9.png 18w\" sizes=\"auto, (max-width: 358px) 100vw, 358px\" \/><figcaption class=\"wp-element-caption\">N\u00e4r du ansluter till denna kommer servot att rotera och st\u00e4nga av str\u00f6mbrytaren.<\/figcaption><\/figure>\n<\/div>\n\n\n<p>F\u00f6r n\u00e4rvarande anv\u00e4nder jag min Pico W som \u00e5tkomstpunkt, \u00e4ven om jag inte s\u00e4ger att det \u00e4r det b\u00e4sta s\u00e4ttet.<\/p>\n\n\n\n<p>Den s\u00e4nder ut ett n\u00e4tverk som jag m\u00e5ste ansluta till separat f\u00f6r att kunna styra servot. Detta \u00e4r en obekv\u00e4m nackdel.<\/p>\n\n\n\n<p>F\u00f6rdelen med detta \u00e4r att du, till skillnad fr\u00e5n stationsmetoden, har ett l\u00f6senord f\u00f6r n\u00e4tverket s\u00e5 att bara du kan ansluta till det.<\/p>\n\n\n\n<p>Fr\u00e5n b\u00f6rjan hade jag en \u00e5tkomstpunkt som visade en webbsida med en knapp f\u00f6r att utl\u00f6sa servot. Jag tyckte att detta var f\u00f6r omst\u00e4ndligt eftersom du m\u00e5ste 1) ansluta till n\u00e4tverket, 2) g\u00e5 till Pico W:s IP-adress och 3) trycka p\u00e5 knappen.<\/p>\n\n\n\n<p>Jag kom fram till att den b\u00e4sta l\u00f6sningen \u00e4r att utl\u00f6sa servon n\u00e4r Pico W uppt\u00e4cker att en klient ansluter till \u00e5tkomstpunkten. P\u00e5 s\u00e5 s\u00e4tt beh\u00f6ver du bara ansluta en enhet till Pico W och lamporna (eller str\u00f6mbrytaren) kommer att vara sl\u00e4ckta.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Anslutning av Pico W till en servo<\/h2>\n\n\n\n<p>Detta \u00e4r ett enkelt projekt och du b\u00f6r kunna hitta delar i en nyb\u00f6rjarsats. Om inte, finns h\u00e4r en reservdelslista.<\/p>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\"><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2021\/03\/Raspberry-Pi-Pico-Video-Output-DVI-Sock-withPicoComfort-1024x683.jpg\" alt=\"Raspberry-Pi-Pico-Video-Output-DVI-Sock\" class=\"wp-image-768\" style=\"width:287px;height:191px\" width=\"287\" height=\"191\" srcset=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2021\/03\/Raspberry-Pi-Pico-Video-Output-DVI-Sock-withPicoComfort-1024x683.jpg 1024w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2021\/03\/Raspberry-Pi-Pico-Video-Output-DVI-Sock-withPicoComfort-300x200.jpg 300w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2021\/03\/Raspberry-Pi-Pico-Video-Output-DVI-Sock-withPicoComfort-768x512.jpg 768w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2021\/03\/Raspberry-Pi-Pico-Video-Output-DVI-Sock-withPicoComfort-1536x1024.jpg 1536w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2021\/03\/Raspberry-Pi-Pico-Video-Output-DVI-Sock-withPicoComfort.jpg 1600w\" sizes=\"auto, (max-width: 287px) 100vw, 287px\" \/><\/figure>\n<\/div><\/div>\n\n\n\n<div class=\"wp-block-column is-vertically-aligned-center is-layout-flow wp-block-column-is-layout-flow\">\n<p class=\"has-text-align-center\"><strong><a href=\"https:\/\/buyzero.de\/products\/raspberry-pi-pico-w-h-konfigurator-pico-pico-w-pico-h-pico-wh\">Pico W (plus huvudet)<\/a><\/strong><\/p>\n<\/div>\n<\/div>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\"><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><a href=\"https:\/\/buyzero.de\/products\/zerocam-camera-for-raspberry-pi-zero?_pos=1&amp;_sid=9d7b61947&amp;_ss=r\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-52.png\" alt=\"\" class=\"wp-image-2834\" style=\"width:283px;height:212px\" width=\"283\" height=\"212\" srcset=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-52.png 600w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-52-300x225.png 300w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-52-16x12.png 16w\" sizes=\"auto, (max-width: 283px) 100vw, 283px\" \/><\/a><\/figure>\n<\/div><\/div>\n\n\n\n<div class=\"wp-block-column is-vertically-aligned-center is-layout-flow wp-block-column-is-layout-flow\">\n<p class=\"has-text-align-center\"><strong><a href=\"https:\/\/buyzero.de\/products\/zerocam-camera-for-raspberry-pi-zero?_pos=1&amp;_sid=9d7b61947&amp;_ss=r\">Mikroservo (t.ex. SG90)<\/a><\/strong><\/p>\n<\/div>\n<\/div>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\"><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><a href=\"https:\/\/buyzero.de\/products\/copy-of-premium-female-female-jumper-wires-40-x-6\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-54.png\" alt=\"\" class=\"wp-image-2836\" style=\"width:288px;height:216px\" width=\"288\" height=\"216\" srcset=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-54.png 600w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-54-300x225.png 300w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-54-16x12.png 16w\" sizes=\"auto, (max-width: 288px) 100vw, 288px\" \/><\/a><\/figure>\n<\/div><\/div>\n\n\n\n<div class=\"wp-block-column is-vertically-aligned-center is-layout-flow wp-block-column-is-layout-flow\">\n<p class=\"has-text-align-center\"><strong><a href=\"https:\/\/buyzero.de\/products\/zerocam-camera-for-raspberry-pi-zero?_pos=1&amp;_sid=9d7b61947&amp;_ss=r\">Jumperkablar<\/a><\/strong><\/p>\n<\/div>\n<\/div>\n\n\n\n<p>Jag anv\u00e4nde ocks\u00e5 ett valfritt br\u00f6dbr\u00e4da f\u00f6r att ansluta servot till Pico W med hane-till-hane-\u00f6verbrytarkablar, men du kan ansluta servot direkt till Pico W:s huvudkontakter med hane-till-hona-\u00f6verbrytarkablar.<\/p>\n\n\n\n<p>Du beh\u00f6ver ocks\u00e5 dubbelh\u00e4ftande tejp f\u00f6r att f\u00e4sta servot p\u00e5 ljusomkopplarhuset.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Koppling av kablar<\/h2>\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\/07\/image-55.png\" alt=\"Styrenhet f\u00f6r servobrytare Pico W\" class=\"wp-image-2838\" style=\"width:665px;height:406px\" width=\"665\" height=\"406\" srcset=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-55.png 737w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-55-300x183.png 300w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-55-18x12.png 18w\" sizes=\"auto, (max-width: 665px) 100vw, 665px\" \/><figcaption class=\"wp-element-caption\">Anslutning av en Pico W till en servo. (schema gjort med <a href=\"http:\/\/wokwi.com\">Wokwi<\/a>)<\/figcaption><\/figure>\n<\/div>\n\n\n<p>Generellt sett har alla servon en r\u00f6d, svart\/brun och en tredje tr\u00e5d.<\/p>\n\n\n\n<p>Anslut en r\u00f6d bryggkabel till den r\u00f6da kabeln som kommer fr\u00e5n servot. Det \u00e4r hit du skickar 5V via VBUS.<\/p>\n\n\n\n<p>Anslut en svart tr\u00e5d till den svart\/bruna tr\u00e5den. Du ansluter den till GND p\u00e5 Pico W.<\/p>\n\n\n\n<p>Anslut en annan tr\u00e5d till den tredje tr\u00e5den. Min \u00e4r orangef\u00e4rgad, s\u00e5 jag anv\u00e4nde en orange brytartr\u00e5d. Detta \u00e4r signaltr\u00e5den som jag kopplade till GPIO16.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Koden<\/h2>\n\n\n\n<p>Den h\u00e4r koden g\u00f6r det m\u00f6jligt att utl\u00f6sa servon n\u00e4r en klient ansluter till Pico W:s SoftAP-\u00e5tkomstpunkt.<\/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=\"import networkimport machinefrom machine import PWMfrom time import sleep#Pin param = servo GPIO pin numberpwm = PWM(machine.Pin(16))ssid = 'Lights-Out'password = 'sleeptime'ap = network.WLAN(network.AP_IF)ap.config(essid=ssid, password=password)ap.active(True)while ap.active() == False:  passprint('Connection successful')print(ap.ifconfig())def rotateServo ():    pwm.freq(50)    pwm.duty_ns(2000000)    sleep(0.5)    pwm.duty_ns(1500000)#ap.status is a blank array until someone connects, then it will have one entry#when ap.status = true, then it will trigger rotateServo()# then it will shut itself off to kick the user off the network,# allowing the device to reconnect to its usual networkwhile True:    try:        if ap.status('stations'):            print('client connected')            rotateServo()            sleep(5)            ap.active(False)            sleep(2)            ap.active(True)            except OSError as e:        print('Connection closed')\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Kopia\" 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 data-no-translation=\"\"><span class=\"line\"><span style=\"color: #81A1C1\">import<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">network<\/span><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">import<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">machine<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">from<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">machine<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">import<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">PWM<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">from<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">time<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">import<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">sleep<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">#<\/span><span style=\"color: #8FBCBB\">Pin<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">param<\/span><span style=\"color: #D8DEE9FF\"> = <\/span><span style=\"color: #8FBCBB\">servo<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">GPIO<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">pin<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">number<\/span><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">pwm<\/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\">(16))<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">ssid<\/span><span style=\"color: #D8DEE9FF\"> = <\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">Lights-Out<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">password<\/span><span style=\"color: #D8DEE9FF\"> = <\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">sleeptime<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">ap<\/span><span style=\"color: #D8DEE9FF\"> = <\/span><span style=\"color: #8FBCBB\">network<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">WLAN<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #8FBCBB\">network<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">AP_IF<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">ap<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">config<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #8FBCBB\">essid<\/span><span style=\"color: #D8DEE9FF\">=<\/span><span style=\"color: #8FBCBB\">ssid<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">password<\/span><span style=\"color: #D8DEE9FF\">=<\/span><span style=\"color: #8FBCBB\">password<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">ap<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">active<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #8FBCBB\">True<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">while<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">ap<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">active<\/span><span style=\"color: #D8DEE9FF\">() == <\/span><span style=\"color: #8FBCBB\">False<\/span><span style=\"color: #D8DEE9FF\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">  <\/span><span style=\"color: #8FBCBB\">pass<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">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: #8FBCBB\">print<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #8FBCBB\">ap<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">ifconfig<\/span><span style=\"color: #D8DEE9FF\">())<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">def<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">rotateServo<\/span><span style=\"color: #D8DEE9FF\"> ():<\/span><\/span>\n<span class=\"line\"><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\">(50)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><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\">(2000000)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #8FBCBB\">sleep<\/span><span style=\"color: #D8DEE9FF\">(0.5)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><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\">(1500000)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">#<\/span><span style=\"color: #8FBCBB\">ap<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">status<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">is<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">a<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">blank<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">array<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">until<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">someone<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">connects<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">then<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">it<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">will<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">have<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">one<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">entry<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">#<\/span><span style=\"color: #8FBCBB\">when<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">ap<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">status<\/span><span style=\"color: #D8DEE9FF\"> = <\/span><span style=\"color: #8FBCBB\">true<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">then<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">it<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">will<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">trigger<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">rotateServo<\/span><span style=\"color: #D8DEE9FF\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"># <\/span><span style=\"color: #8FBCBB\">then<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">it<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">will<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">shut<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">itself<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">off<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">to<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">kick<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">the<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">user<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">off<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">the<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">network<\/span><span style=\"color: #ECEFF4\">,<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\"># <\/span><span style=\"color: #8FBCBB\">allowing<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">the<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">device<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">to<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">reconnect<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">to<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">its<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">usual<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">network<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">while<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">True<\/span><span style=\"color: #D8DEE9FF\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #8FBCBB\">try<\/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\">ap<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">status<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">stations<\/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: #8FBCBB\">print<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">client connected<\/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: #8FBCBB\">rotateServo<\/span><span style=\"color: #D8DEE9FF\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">            <\/span><span style=\"color: #8FBCBB\">sleep<\/span><span style=\"color: #D8DEE9FF\">(5)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">            <\/span><span style=\"color: #8FBCBB\">ap<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">active<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #8FBCBB\">False<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">            <\/span><span style=\"color: #8FBCBB\">sleep<\/span><span style=\"color: #D8DEE9FF\">(2)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">            <\/span><span style=\"color: #8FBCBB\">ap<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">active<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #8FBCBB\">True<\/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: #8FBCBB\">except<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">OSError<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">as<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">e<\/span><span style=\"color: #D8DEE9FF\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">        <\/span><span style=\"color: #8FBCBB\">print<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">Connection closed<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><\/span><\/code><\/pre><\/div>\n\n\n\n<p>Vissa viktiga kodrader att f\u00f6rklara:<\/p>\n\n\n\n<p>Koden f\u00f6ruts\u00e4tter att du har anslutit signalkabeln till GPIO16. Om inte \u00e4ndrar du heltalet \"16\" i den h\u00e4r raden till den GPIO-stift som du \u00e4r ansluten till.<\/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=\"#Pin param = servo GPIO pin numberpwm = PWM(machine.Pin(<strong&gt;16<\/strong&gt;))\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Kopia\" 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 data-no-translation=\"\"><span class=\"line\"><span style=\"color: #D8DEE9FF\">#<\/span><span style=\"color: #D8DEE9\">Pin<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">param<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">servo<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">GPIO<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">pin<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #D8DEE9\">number<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9\">pwm<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">PWM<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #D8DEE9\">machine<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">Pin<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #81A1C1\">&lt;strong&gt;<\/span><span style=\"color: #D8DEE9FF\">16<\/span><span style=\"color: #81A1C1\">&lt;\/strong&gt;<\/span><span style=\"color: #D8DEE9FF\">))<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>Detta st\u00e4ller in SoftAP, anger SSID-namn och l\u00f6senord,<\/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=\"import network...ssid = 'Lights-Out'password = 'sleeptime'ap = network.WLAN(network.AP_IF)ap.config(essid=ssid, password=password)ap.active(True)\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Kopia\" 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 data-no-translation=\"\"><span class=\"line\"><span style=\"color: #81A1C1\">import<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">network<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">...<\/span><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">ssid<\/span><span style=\"color: #D8DEE9FF\"> = <\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">Lights-Out<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">password<\/span><span style=\"color: #D8DEE9FF\"> = <\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">sleeptime<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">ap<\/span><span style=\"color: #D8DEE9FF\"> = <\/span><span style=\"color: #8FBCBB\">network<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">WLAN<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #8FBCBB\">network<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">AP_IF<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">ap<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">config<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #8FBCBB\">essid<\/span><span style=\"color: #D8DEE9FF\">=<\/span><span style=\"color: #8FBCBB\">ssid<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #8FBCBB\">password<\/span><span style=\"color: #D8DEE9FF\">=<\/span><span style=\"color: #8FBCBB\">password<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #8FBCBB\">ap<\/span><span style=\"color: #D8DEE9FF\">.<\/span><span style=\"color: #8FBCBB\">active<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #8FBCBB\">True<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Servostyrning p\u00e5 Pico W<\/h3>\n\n\n\n<p>Detta styr servot. Du kommer f\u00f6rmodligen att beh\u00f6va \u00e4ndra den.<\/p>\n\n\n\n<p>F\u00f6r min servo kan jag anv\u00e4nda ett v\u00e4rde p\u00e5 500000 (500K) till 2000000 (2 mil). Detta skulle ge hela servoens r\u00e4ckvidd.<\/p>\n\n\n\n<p>Jag beh\u00f6vde dock bara en liten rotation. D\u00e4rf\u00f6r satte jag servon i full rotation med <strong>pwm.duty_ns(2000000)<\/strong> och sedan l\u00e5ta den \u00e5terg\u00e5 till <strong>pwm.duty_ns(1500000)<\/strong>.<\/p>\n\n\n\n<p>Det \u00e4r f\u00f6rmodligen b\u00e4st att testa detta medan servot \u00e4r fritt sv\u00e4vande s\u00e5 att du kan se om det roterar i r\u00e4tt riktning och sedan kan du finjustera rotationsgraderna.<\/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=\"def rotateServo ():    pwm.freq(50)    pwm.duty_ns(2000000)    sleep(0.5)    pwm.duty_ns(1500000)\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Kopia\" 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 data-no-translation=\"\"><span class=\"line\"><span style=\"color: #D8DEE9\">def<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">rotateServo<\/span><span style=\"color: #D8DEE9FF\"> ():<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #D8DEE9\">pwm<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">freq<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #B48EAD\">50<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #D8DEE9\">pwm<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">duty_ns<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #B48EAD\">2000000<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #88C0D0\">sleep<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #B48EAD\">0.5<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #D8DEE9\">pwm<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">duty_ns<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #B48EAD\">1500000<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">S\u00e4nder ut en AP, utl\u00f6ser rotateServo vid anslutning<\/h2>\n\n\n\n<p>Denna kodrad k\u00f6rs upprepade g\u00e5nger.<\/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=\"while True:    try:        if ap.status('stations'):            print('client connected')            rotateServo()            sleep(10)            ap.active(False)            sleep(2)            ap.active(True)\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Kopia\" 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 data-no-translation=\"\"><span class=\"line\"><span style=\"color: #81A1C1\">while<\/span><span style=\"color: #D8DEE9FF\"> True<\/span><span style=\"color: #ECEFF4\">:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">    <\/span><span style=\"color: #81A1C1\">try<\/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\">ap<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">status<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">stations<\/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: #88C0D0\">print<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">client connected<\/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: #88C0D0\">rotateServo<\/span><span style=\"color: #D8DEE9FF\">()<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">            <\/span><span style=\"color: #88C0D0\">sleep<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #B48EAD\">10<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><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: #D8DEE9\">False<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">            <\/span><span style=\"color: #88C0D0\">sleep<\/span><span style=\"color: #D8DEE9FF\">(<\/span><span style=\"color: #B48EAD\">2<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span>\n<span class=\"line\"><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: #D8DEE9\">True<\/span><span style=\"color: #D8DEE9FF\">)<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>Om <strong>ap.status('stations')<\/strong> uppt\u00e4cker en anslutning till det tr\u00e5dl\u00f6sa n\u00e4tverket, returnerar den en array med ett objekt.<\/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\/07\/image-56.png\" alt=\"\" class=\"wp-image-2840\" style=\"width:488px;height:261px\" width=\"488\" height=\"261\" srcset=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-56.png 634w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-56-300x160.png 300w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/image-56-18x10.png 18w\" sizes=\"auto, (max-width: 488px) 100vw, 488px\" \/><figcaption class=\"wp-element-caption\"> <strong>ap.status('stations')<\/strong> returnerar en tom array om ingen \u00e4r ansluten till AP:n.<\/figcaption><\/figure>\n<\/div>\n\n\n<p>Om koden inte \u00e4r en tom array kommer den d\u00e4rf\u00f6r att starta <strong>rotateServo<\/strong> och st\u00e4nger av AP innan du sl\u00e5r p\u00e5 den igen.<\/p>\n\n\n\n<p>Tanken med att s\u00e4tta p\u00e5 och st\u00e4nga av AP:n \u00e4r att sparka bort den anslutna klienten fr\u00e5n n\u00e4tverket. P\u00e5 s\u00e5 s\u00e4tt kan den ansluta till sitt vanliga n\u00e4tverk med en internetanslutning. <\/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\/07\/auto-reconnect-off.jpg\" alt=\"android auto reconnect off\" class=\"wp-image-2850\" style=\"width:429px;height:260px\" width=\"429\" height=\"260\" srcset=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/auto-reconnect-off.jpg 720w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/auto-reconnect-off-300x182.jpg 300w, https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/auto-reconnect-off-18x12.jpg 18w\" sizes=\"auto, (max-width: 429px) 100vw, 429px\" \/><figcaption class=\"wp-element-caption\">Automatisk \u00e5teranslutning avst\u00e4ngd i Android<\/figcaption><\/figure>\n<\/div>\n\n\n<p>Se bara till att st\u00e4nga av automatisk \u00e5teranslutning i din telefon eller dator.<\/p>\n\n\n\n<p>Varf\u00f6r beh\u00f6ver vi sleep(x) mellan ap.active()? Det \u00e4r f\u00f6r att jag har l\u00e4rt mig att om jag st\u00e4nger av och s\u00e4tter p\u00e5 AP:n f\u00f6r snabbt s\u00e5 kommer min telefon inte att bryta anslutningen.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">L\u00e4s mer om Raspberry Pi Pico W<\/h2>\n\n\n\n<p>Vi har skrivit en artikel om Raspberry Pi Pico W som hj\u00e4lper dig att f\u00e5 ut det mesta av din Pico W. <a href=\"https:\/\/picockpit.com\/raspberry-pi\/everything-about-the-raspberry-pi-pico-w\/\">Klicka h\u00e4r f\u00f6r att f\u00e5 veta saker som du inte visste.<\/a><\/p>\n\n\n\n<p><\/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%2Fsv%2Fdiy-wireless-servo-switch-controller-with-raspberry-pi-pico-w%2F&text=DIY%20wireless%20servo%20switch%20controller%20with%20Raspberry%20Pi%20Pico%20W\" title=\"Dela p\u00e5 X\" aria-label=\"Dela p\u00e5 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\">dela<\/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%2Fsv%2Fdiy-wireless-servo-switch-controller-with-raspberry-pi-pico-w%2F\" title=\"Dela p\u00e5 Facebook\" aria-label=\"Dela p\u00e5 Facebook\" 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\">dela<\/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%2Fsv%2Fdiy-wireless-servo-switch-controller-with-raspberry-pi-pico-w%2F&text=DIY%20wireless%20servo%20switch%20controller%20with%20Raspberry%20Pi%20Pico%20W\" title=\"Dela p\u00e5 Telegram\" aria-label=\"Dela p\u00e5 Telegram\" 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\">dela<\/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%2Fsv%2Fdiy-wireless-servo-switch-controller-with-raspberry-pi-pico-w%2F\" title=\"Dela p\u00e5 Reddit\" aria-label=\"Dela p\u00e5 Reddit\" 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\">dela<\/span>&nbsp;<\/a><\/li><\/ul><\/div>","protected":false},"excerpt":{"rendered":"<p>Ett av de st\u00f6rsta problemen jag har \u00e4r att g\u00e5 upp ur s\u00e4ngen f\u00f6r att sl\u00e4cka ljuset i sovrummet. Det \u00e4r v\u00e4ldigt sv\u00e5rt att g\u00f6ra det n\u00e4r man ligger och myser i s\u00e4ngen. S\u00e5 h\u00e4r vill jag ber\u00e4tta f\u00f6r dig hur du l\u00f6ser det problemet med en Pico W Servo switch controller. Du f\u00f6rst\u00e5r, f\u00f6r n\u00e5gra \u00e5r sedan...<\/p>","protected":false},"author":2,"featured_media":2854,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10,3],"tags":[425,545,543,11,221,486,447,187,484,544],"class_list":["post-2824","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-raspberry-pi-pico","category-raspberry-pi-how-to","tag-light","tag-lights","tag-microservo","tag-pico","tag-pico-w","tag-project","tag-projects","tag-raspberry-pi","tag-servo","tag-sg90"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>DIY wireless servo switch controller with Raspberry Pi Pico W | PiCockpit<\/title>\n<meta name=\"description\" content=\"Make DIY wireless servo switch controller to turn off light switches, appliances and much more with the Raspberry Pi Pico W and SoftAP!\" \/>\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\/sv\/diy-wireless-servo-switch-controller-with-raspberry-pi-pico-w\/\" \/>\n<meta property=\"og:locale\" content=\"sv_SE\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"DIY wireless servo switch controller with Raspberry Pi Pico W | PiCockpit\" \/>\n<meta property=\"og:description\" content=\"Make DIY wireless servo switch controller to turn off light switches, appliances and much more with the Raspberry Pi Pico W and SoftAP!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/picockpit.com\/raspberry-pi\/sv\/diy-wireless-servo-switch-controller-with-raspberry-pi-pico-w\/\" \/>\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-07-19T12:43:06+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-08-22T14:46:06+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/featured-image-4.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1778\" \/>\n\t<meta property=\"og:image:height\" content=\"1000\" \/>\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=\"Skriven av\" \/>\n\t<meta name=\"twitter:data1\" content=\"raspi berry\" \/>\n\t<meta name=\"twitter:label2\" content=\"Ber\u00e4knad l\u00e4stid\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minuter\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/diy-wireless-servo-switch-controller-with-raspberry-pi-pico-w\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/diy-wireless-servo-switch-controller-with-raspberry-pi-pico-w\\\/\"},\"author\":{\"name\":\"raspi berry\",\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/#\\\/schema\\\/person\\\/7af3a7a8c999bc722029ef9ca9d78eee\"},\"headline\":\"DIY wireless servo switch controller with Raspberry Pi Pico W\",\"datePublished\":\"2022-07-19T12:43:06+00:00\",\"dateModified\":\"2023-08-22T14:46:06+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/diy-wireless-servo-switch-controller-with-raspberry-pi-pico-w\\\/\"},\"wordCount\":1308,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/diy-wireless-servo-switch-controller-with-raspberry-pi-pico-w\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/featured-image-4.jpg\",\"keywords\":[\"light\",\"lights\",\"microservo\",\"Pico\",\"Pico W\",\"project\",\"Projects\",\"Raspberry Pi\",\"servo\",\"SG90\"],\"articleSection\":[\"Raspberry Pi Pico\",\"Tutorials\"],\"inLanguage\":\"sv-SE\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/diy-wireless-servo-switch-controller-with-raspberry-pi-pico-w\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/diy-wireless-servo-switch-controller-with-raspberry-pi-pico-w\\\/\",\"url\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/diy-wireless-servo-switch-controller-with-raspberry-pi-pico-w\\\/\",\"name\":\"DIY wireless servo switch controller with Raspberry Pi Pico W | PiCockpit\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/diy-wireless-servo-switch-controller-with-raspberry-pi-pico-w\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/diy-wireless-servo-switch-controller-with-raspberry-pi-pico-w\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/featured-image-4.jpg\",\"datePublished\":\"2022-07-19T12:43:06+00:00\",\"dateModified\":\"2023-08-22T14:46:06+00:00\",\"description\":\"Make DIY wireless servo switch controller to turn off light switches, appliances and much more with the Raspberry Pi Pico W and SoftAP!\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/diy-wireless-servo-switch-controller-with-raspberry-pi-pico-w\\\/#breadcrumb\"},\"inLanguage\":\"sv-SE\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/diy-wireless-servo-switch-controller-with-raspberry-pi-pico-w\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"sv-SE\",\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/diy-wireless-servo-switch-controller-with-raspberry-pi-pico-w\\\/#primaryimage\",\"url\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/featured-image-4.jpg\",\"contentUrl\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/featured-image-4.jpg\",\"width\":1778,\"height\":1000,\"caption\":\"DIY wireless servo switch controller with Raspberry Pi Pico W\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/diy-wireless-servo-switch-controller-with-raspberry-pi-pico-w\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Tutorials\",\"item\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/category\\\/raspberry-pi-how-to\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"DIY wireless servo switch controller with Raspberry Pi Pico W\"}]},{\"@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\":\"sv-SE\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/#organization\",\"name\":\"PiCockpit.com\",\"url\":\"https:\\\/\\\/picockpit.com\\\/raspberry-pi\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"sv-SE\",\"@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\":\"sv-SE\",\"@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\\\/sv\\\/author\\\/raspi-berry\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"DIY tr\u00e5dl\u00f6s servobrytare med Raspberry Pi Pico W | PiCockpit","description":"G\u00f6r en tr\u00e5dl\u00f6s tr\u00e5dl\u00f6s servokontroll f\u00f6r att st\u00e4nga av ljusbrytare, apparater och mycket mer med Raspberry Pi Pico W och SoftAP!","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\/sv\/diy-wireless-servo-switch-controller-with-raspberry-pi-pico-w\/","og_locale":"sv_SE","og_type":"article","og_title":"DIY wireless servo switch controller with Raspberry Pi Pico W | PiCockpit","og_description":"Make DIY wireless servo switch controller to turn off light switches, appliances and much more with the Raspberry Pi Pico W and SoftAP!","og_url":"https:\/\/picockpit.com\/raspberry-pi\/sv\/diy-wireless-servo-switch-controller-with-raspberry-pi-pico-w\/","og_site_name":"PiCockpit","article_publisher":"https:\/\/www.facebook.com\/pi3gshop","article_published_time":"2022-07-19T12:43:06+00:00","article_modified_time":"2023-08-22T14:46:06+00:00","og_image":[{"width":1778,"height":1000,"url":"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/featured-image-4.jpg","type":"image\/jpeg"}],"author":"raspi berry","twitter_card":"summary_large_image","twitter_creator":"@pi3g","twitter_site":"@pi3g","twitter_misc":{"Skriven av":"raspi berry","Ber\u00e4knad l\u00e4stid":"8 minuter"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/picockpit.com\/raspberry-pi\/diy-wireless-servo-switch-controller-with-raspberry-pi-pico-w\/#article","isPartOf":{"@id":"https:\/\/picockpit.com\/raspberry-pi\/diy-wireless-servo-switch-controller-with-raspberry-pi-pico-w\/"},"author":{"name":"raspi berry","@id":"https:\/\/picockpit.com\/raspberry-pi\/#\/schema\/person\/7af3a7a8c999bc722029ef9ca9d78eee"},"headline":"DIY wireless servo switch controller with Raspberry Pi Pico W","datePublished":"2022-07-19T12:43:06+00:00","dateModified":"2023-08-22T14:46:06+00:00","mainEntityOfPage":{"@id":"https:\/\/picockpit.com\/raspberry-pi\/diy-wireless-servo-switch-controller-with-raspberry-pi-pico-w\/"},"wordCount":1308,"commentCount":2,"publisher":{"@id":"https:\/\/picockpit.com\/raspberry-pi\/#organization"},"image":{"@id":"https:\/\/picockpit.com\/raspberry-pi\/diy-wireless-servo-switch-controller-with-raspberry-pi-pico-w\/#primaryimage"},"thumbnailUrl":"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/featured-image-4.jpg","keywords":["light","lights","microservo","Pico","Pico W","project","Projects","Raspberry Pi","servo","SG90"],"articleSection":["Raspberry Pi Pico","Tutorials"],"inLanguage":"sv-SE","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/picockpit.com\/raspberry-pi\/diy-wireless-servo-switch-controller-with-raspberry-pi-pico-w\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/picockpit.com\/raspberry-pi\/diy-wireless-servo-switch-controller-with-raspberry-pi-pico-w\/","url":"https:\/\/picockpit.com\/raspberry-pi\/diy-wireless-servo-switch-controller-with-raspberry-pi-pico-w\/","name":"DIY tr\u00e5dl\u00f6s servobrytare med Raspberry Pi Pico W | PiCockpit","isPartOf":{"@id":"https:\/\/picockpit.com\/raspberry-pi\/#website"},"primaryImageOfPage":{"@id":"https:\/\/picockpit.com\/raspberry-pi\/diy-wireless-servo-switch-controller-with-raspberry-pi-pico-w\/#primaryimage"},"image":{"@id":"https:\/\/picockpit.com\/raspberry-pi\/diy-wireless-servo-switch-controller-with-raspberry-pi-pico-w\/#primaryimage"},"thumbnailUrl":"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/featured-image-4.jpg","datePublished":"2022-07-19T12:43:06+00:00","dateModified":"2023-08-22T14:46:06+00:00","description":"G\u00f6r en tr\u00e5dl\u00f6s tr\u00e5dl\u00f6s servokontroll f\u00f6r att st\u00e4nga av ljusbrytare, apparater och mycket mer med Raspberry Pi Pico W och SoftAP!","breadcrumb":{"@id":"https:\/\/picockpit.com\/raspberry-pi\/diy-wireless-servo-switch-controller-with-raspberry-pi-pico-w\/#breadcrumb"},"inLanguage":"sv-SE","potentialAction":[{"@type":"ReadAction","target":["https:\/\/picockpit.com\/raspberry-pi\/diy-wireless-servo-switch-controller-with-raspberry-pi-pico-w\/"]}]},{"@type":"ImageObject","inLanguage":"sv-SE","@id":"https:\/\/picockpit.com\/raspberry-pi\/diy-wireless-servo-switch-controller-with-raspberry-pi-pico-w\/#primaryimage","url":"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/featured-image-4.jpg","contentUrl":"https:\/\/picockpit.com\/raspberry-pi\/wp-content\/uploads\/2022\/07\/featured-image-4.jpg","width":1778,"height":1000,"caption":"DIY wireless servo switch controller with Raspberry Pi Pico W"},{"@type":"BreadcrumbList","@id":"https:\/\/picockpit.com\/raspberry-pi\/diy-wireless-servo-switch-controller-with-raspberry-pi-pico-w\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/picockpit.com\/raspberry-pi\/"},{"@type":"ListItem","position":2,"name":"Tutorials","item":"https:\/\/picockpit.com\/raspberry-pi\/category\/raspberry-pi-how-to\/"},{"@type":"ListItem","position":3,"name":"DIY wireless servo switch controller with Raspberry Pi Pico W"}]},{"@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":"sv-SE"},{"@type":"Organization","@id":"https:\/\/picockpit.com\/raspberry-pi\/#organization","name":"PiCockpit.com","url":"https:\/\/picockpit.com\/raspberry-pi\/","logo":{"@type":"ImageObject","inLanguage":"sv-SE","@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":"hallonb\u00e4r","image":{"@type":"ImageObject","inLanguage":"sv-SE","@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":"Jag \u00e4r h\u00e4r f\u00f6r att hj\u00e4lpa dig med alla dina Raspberry Pi-relaterade fr\u00e5gor och \u00e4lskar att dela med mig av nya projektid\u00e9er f\u00f6r Raspberry Pi och ge snabba tips. Sj\u00e4lvklart hj\u00e4lper jag dig ocks\u00e5 med PiCockpit och hur du kan g\u00f6ra din Raspberry Pi \u00e4nnu enklare att anv\u00e4nda med denna l\u00f6sning f\u00f6r \u00f6vervakning av Raspberry Pi :-)","sameAs":["https:\/\/picockpit.com"],"url":"https:\/\/picockpit.com\/raspberry-pi\/sv\/author\/raspi-berry\/"}]}},"_links":{"self":[{"href":"https:\/\/picockpit.com\/raspberry-pi\/sv\/wp-json\/wp\/v2\/posts\/2824","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/picockpit.com\/raspberry-pi\/sv\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/picockpit.com\/raspberry-pi\/sv\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/picockpit.com\/raspberry-pi\/sv\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/picockpit.com\/raspberry-pi\/sv\/wp-json\/wp\/v2\/comments?post=2824"}],"version-history":[{"count":26,"href":"https:\/\/picockpit.com\/raspberry-pi\/sv\/wp-json\/wp\/v2\/posts\/2824\/revisions"}],"predecessor-version":[{"id":4877,"href":"https:\/\/picockpit.com\/raspberry-pi\/sv\/wp-json\/wp\/v2\/posts\/2824\/revisions\/4877"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/picockpit.com\/raspberry-pi\/sv\/wp-json\/wp\/v2\/media\/2854"}],"wp:attachment":[{"href":"https:\/\/picockpit.com\/raspberry-pi\/sv\/wp-json\/wp\/v2\/media?parent=2824"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/picockpit.com\/raspberry-pi\/sv\/wp-json\/wp\/v2\/categories?post=2824"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/picockpit.com\/raspberry-pi\/sv\/wp-json\/wp\/v2\/tags?post=2824"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}