{"id":1086,"date":"2018-12-06T23:06:20","date_gmt":"2018-12-06T23:06:20","guid":{"rendered":"https:\/\/zhutarduino.wordpress.com\/?page_id=1086"},"modified":"2018-12-06T23:06:20","modified_gmt":"2018-12-06T23:06:20","slug":"learning-arduino-ep-41-joystick-controlled-pan-and-tilt-platform","status":"publish","type":"page","link":"https:\/\/thezhut.com\/?page_id=1086","title":{"rendered":"Learning Arduino EP #41: Joystick Controlled pan and tilt platform"},"content":{"rendered":"<h1 style=\"text-align:center;\">Today we&#8217;ll take a look at how to use a joystick with an Arduino to control a pan and tilt Servo platform.<\/h1>\n<p>&nbsp;<\/p>\n<p><iframe loading=\"lazy\" title=\"Learning Arduino EP #41: Joystick Controlled pan and tilt platform\" width=\"640\" height=\"360\" src=\"https:\/\/www.youtube.com\/embed\/XItnIMqF4CA?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/p>\n<p>&nbsp;<\/p>\n<h1><a href=\"https:\/\/www.facebook.com\/zarduino\/\" target=\"_blank\" rel=\"noopener noreferrer\">Check us out on Facebook!<\/a><\/h1>\n<p>&nbsp;<\/p>\n<h2>ARDUINO Code:<\/h2>\n<p>#include &lt;Servo.h&gt;<\/p>\n<p>Servo servoX;<br \/>\nServo servoY;<br \/>\nint valX;<br \/>\nint valY;<\/p>\n<p>void setup() {<br \/>\nservoX.attach(3);<br \/>\nservoY.attach(5);<br \/>\n}<\/p>\n<p>void loop() {<br \/>\nvalX = analogRead(A1);<br \/>\nvalX = map(valX, 0, 1023, 0, 180);<br \/>\nservoX.write(valX);<br \/>\ndelay(25);<\/p>\n<p>valY = analogRead(A2);<br \/>\nvalY = map(valY, 0, 1023, 0, 180);<br \/>\nservoY.write(valY);<br \/>\ndelay(25);<\/p>\n<p>}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today we&#8217;ll take a look at how to use a joystick with an Arduino to control a pan and tilt Servo platform. &nbsp; &nbsp; Check us out on Facebook! &nbsp; ARDUINO Code: #include &lt;Servo.h&gt; Servo servoX; Servo servoY; int valX; &hellip; <a href=\"https:\/\/thezhut.com\/?page_id=1086\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"parent":809,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":"","_links_to":"","_links_to_target":""},"class_list":["post-1086","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/thezhut.com\/index.php?rest_route=\/wp\/v2\/pages\/1086","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thezhut.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/thezhut.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/thezhut.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/thezhut.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1086"}],"version-history":[{"count":0,"href":"https:\/\/thezhut.com\/index.php?rest_route=\/wp\/v2\/pages\/1086\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/thezhut.com\/index.php?rest_route=\/wp\/v2\/pages\/809"}],"wp:attachment":[{"href":"https:\/\/thezhut.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1086"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}