{"id":891,"date":"2023-10-05T18:30:40","date_gmt":"2023-10-05T18:30:40","guid":{"rendered":"https:\/\/iotmanager.org\/?p=891"},"modified":"2023-10-05T18:30:51","modified_gmt":"2023-10-05T18:30:51","slug":"servo-ver4-underconstruction","status":"publish","type":"post","link":"https:\/\/iotmanager.org\/en\/2023\/10\/05\/891\/","title":{"rendered":"Servo ver4 (underconstruction)"},"content":{"rendered":"<p>While this is a stub<\/p>\n\n\n\n<p>&#171;int&#187;: 0, &#8212; \u0447\u0438\u0442\u0430\u0435\u043c \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0438\u043b\u0438 \u043a\u0430\u0436\u0434\u0443\u044e int \u0441\u0435\u043a\u0443\u043d\u0434\u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441 \u0430\u043d\u0430\u043b\u043e\u0433\u0430, \u0435\u0441\u043b\u0438 \u044d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0430<br>&#171;pin&#187;: 12, &#8212; \u043f\u0438\u043d \u0434\u043b\u044f \u0441\u0435\u0440\u0432\u043e\u043f\u0440\u0438\u0432\u043e\u0434\u0430<br>&#171;apin&#187;: -1, &#8212; \u043f\u0438\u043d \u0434\u043b\u044f \u0441\u043d\u044f\u0442\u0438\u044f \u0430\u043d\u0430\u043b\u043e\u0433\u0430, \u043f\u0440\u0438 = -1 \u0432\u044b\u043a\u043b\u044e\u0447\u0435\u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f<br>&#171;amap&#187;: &#171;0, 4096, 0, 180&#187; &#8212; \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0430\u043d\u0430\u043b\u043e\u0433\u0430 \u0432 \u043d\u0443\u0436\u043d\u044b\u0439 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d \u0441\u0435\u0440\u0432\u044b, \u0438\u043c\u0435\u0435\u0442 \u0441\u043c\u044b\u0441\u043b \u0435\u0441\u043b\u0438 \u0430\u043d\u0430\u043b\u043e\u0433 \u0432\u043a\u043b\u044e\u0447\u0435\u043d<\/p>\n\n\n\n<p>Everything is just right) in the module everything is there. Please note that the analog can be turned off by setting = -1, then only changing the position by value will work. Either by setting serv = 45; in the script, or by using the slider widget. You&#039;re right, you could stop there and read the analog in the script and pass it on to serv, but this will be clocked for at least one second. In the module, when using an analog, you can set int = 0; then the reaction will be instantaneous.<\/p>\n\n\n\n<p>it should work like this too servo = 160;<\/p>\n\n\n\n<p>Servo-a class for controlling servomotors connected to ESP32 pins. int attach (pin) \u2014 attaches this GPIO pin to the next free channel.<\/p>\n\n\n\n<p>(channels that were previously disabled are used first),<br>returns the channel number, or 0 in case of failure. All contact numbers are allowed,<br>but only contacts are recommended 2,4,12-19,21-23,25-27,32-33.<br>if btn1==1 then servo = 160; if btn2==1 then servo = 20; if btn3==1 then servo = 90; if btn4==1 then servo = 130;<\/p>\n\n\n\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043b \u0432 \u0430\u043d\u0430\u043b\u043e\u0433\u043e\u0432\u044b\u0439 \u0434\u0430\u0442\u0447\u0438\u043a \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u0437\u0430 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435. avgSteps = 1 &#8212; \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e, \u0447\u0438\u0442\u0430\u0435\u0442 \u0441\u044b\u0440\u0435\u0446 \u043a\u0430\u043a \u0435\u0441\u0442\u044c avgSteps &gt; 1 &#8212; \u0437\u0430\u0434\u0430\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0439 \u0430\u043d\u0430\u043b\u043e\u0433\u043e\u0432\u043e\u0433\u043e \u043f\u0438\u043d\u0430 \u0434\u043b\u044f \u0443\u0441\u0440\u0435\u0434\u043d\u0435\u043d\u0438\u044f \u0438 \u0434\u0430\u043b\u0435\u0435 \u0443\u0436\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u0432 value. \u0421\u0435\u0440\u0432\u043e \u0441\u0442\u0430\u043b \u0434\u0432\u0438\u0433\u0430\u0442\u044c\u0441\u044f \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u0435\u0435. \u0441\u043f\u043e\u0441\u043e\u0431 \u0441\u0432\u044f\u0437\u043a\u0438 \u0441\u0435\u0440\u0432\u043e \u0438 \u043d\u0430\u043b\u043e\u0433\u043e\u0432\u043e\u0433\u043e \u0434\u0430\u0442\u0447\u0438\u043a\u0430: if analog &gt; 0 then servo = analog;<\/p>","protected":false},"excerpt":{"rendered":"<p>While this is a stub &#034;int&#034;: 0 \u2014 - we read the value from the analog constantly or every int second, if this function is enabled &#034;pin&#034;: 12 \u2014 - pin for the servo &#034;apin&#034;: -1, - pin for removing the analog, at = -1 the&#034;amap&#034; function is turned off: &#034;0, 4096, 0, 180&#034; - settings for converting analog values to the desired server range, it makes sense if analog is enabled All as \u2026 <a title=\"Servo ver4 (underconstruction)\" class=\"read-more\" href=\"https:\/\/iotmanager.org\/en\/2023\/10\/05\/891\/\" aria-label=\"More on Servo ver4 (underconstruction)\">Read more<\/a><\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[74],"tags":[82],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/iotmanager.org\/en\/wp-json\/wp\/v2\/posts\/891"}],"collection":[{"href":"https:\/\/iotmanager.org\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/iotmanager.org\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/iotmanager.org\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/iotmanager.org\/en\/wp-json\/wp\/v2\/comments?post=891"}],"version-history":[{"count":1,"href":"https:\/\/iotmanager.org\/en\/wp-json\/wp\/v2\/posts\/891\/revisions"}],"predecessor-version":[{"id":892,"href":"https:\/\/iotmanager.org\/en\/wp-json\/wp\/v2\/posts\/891\/revisions\/892"}],"wp:attachment":[{"href":"https:\/\/iotmanager.org\/en\/wp-json\/wp\/v2\/media?parent=891"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/iotmanager.org\/en\/wp-json\/wp\/v2\/categories?post=891"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/iotmanager.org\/en\/wp-json\/wp\/v2\/tags?post=891"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}