{"id":1409,"date":"2017-12-12T12:02:44","date_gmt":"2017-12-12T12:02:44","guid":{"rendered":"http:\/\/easycoding.tn\/?page_id=1409"},"modified":"2018-05-09T10:14:42","modified_gmt":"2018-05-09T10:14:42","slug":"various","status":"publish","type":"page","link":"http:\/\/easycoding.tn\/index.php\/nodemcu\/tuniot-documentation\/various\/","title":{"rendered":"Various"},"content":{"rendered":"<ul>\n<li><strong>Servo write:<br \/>\n<\/strong>Set the angle of the servo in degrees, 0 to 180 on a specific pin. And will make a delay later.<br \/>\n<a href=\"https:\/\/www.youtube.com\/watch?v=Ej-sFyWbFr4\">Video Tutorial<\/a><br \/>\n<strong><span style=\"color: #ff6600;\">Example<\/span><\/strong>: How to use the servo with the ESP826<br \/>\n<strong><img loading=\"lazy\" class=\"size-medium alignleft\" src=\"http:\/\/easycoding.tn\/wp-content\/uploads\/2017\/12\/ServoWrite.jpg\" width=\"280\" height=\"145\" \/><\/strong><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<ul>\n<li><strong><img loading=\"lazy\" class=\" alignright\" src=\"http:\/\/easycoding.tn\/wp-content\/uploads\/2017\/12\/ServoReadDegree.jpg\" width=\"209\" height=\"97\" \/>Servo read degree<\/strong>:<br \/>\nreturn that value set with the last write().<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<ul>\n<li><strong><img loading=\"lazy\" class=\"size-medium alignright\" src=\"http:\/\/easycoding.tn\/wp-content\/uploads\/2017\/12\/ServoIsAttached.jpg\" width=\"316\" height=\"89\" \/>Servo attached<\/strong>:<br \/>\nreturn 1 if the servo is currently attached to a specific pin.<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul>\n<li><strong><img loading=\"lazy\" class=\"size-medium alignright\" src=\"http:\/\/easycoding.tn\/wp-content\/uploads\/2017\/12\/ServoDetach.jpg\" width=\"210\" height=\"43\" \/>Servo detach<\/strong>:<br \/>\nRelease a pin from servo driving.<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul>\n<li><strong><img loading=\"lazy\" class=\"size-medium alignright\" src=\"http:\/\/easycoding.tn\/wp-content\/uploads\/2017\/12\/Delay.jpg\" width=\"170\" height=\"66\" \/>Delay<\/strong>:<br \/>\nPauses the program for the amount of time (in milliseconds) specified as parameter.<br \/>\n<strong><span style=\"color: #ff6600;\">Example<\/span><\/strong>: Blinking the internal LED with a delay &#8211; <a href=\"https:\/\/youtu.be\/HBSH_x6J1lY\">Video<\/a>.<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul>\n<li><strong><img class=\"alignright\" src=\"http:\/\/easycoding.tn\/wp-content\/uploads\/2017\/12\/DHT_TEMPERATURE.jpg\" \/>DHT temperature sensor<\/strong>:<br \/>\nReturn the temperature of the sensor (DHT). First, you have to set the type of sensor: DHT11, DHT21 or DHT22. and the pin where the sensor is connected. You have to chose also the unit of measure.<br \/>\nReturn type: <span style=\"color: #00ff00;\"><strong>Number<\/strong><br \/>\n<\/span><span style=\"color: #ff6600;\"><strong>Example<\/strong><\/span>: Showing the serial monitor the temperature &#8211; <a href=\"https:\/\/youtu.be\/Wi7ctvdWSew\">Video<\/a>.<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul>\n<li><strong><img loading=\"lazy\" class=\"size-medium alignright\" src=\"http:\/\/easycoding.tn\/wp-content\/uploads\/2017\/12\/DHT_Humidity.jpg\" width=\"234\" height=\"118\" \/>DHT humidity sensor<\/strong>:<br \/>\nReturn the humidity of the sensor (DHT). First, you have to set the type of sensor: DHT11, DHT21 or DHT22. and the pin where the sensor is connected. You have to chose also the unit of measure.<br \/>\nReturn type: <span style=\"color: #00ff00;\"><strong>Number<\/strong><\/span><br \/>\n<strong>Example<\/strong>: Showing the serial monitor the temperature &#8211; <a href=\"https:\/\/youtu.be\/Wi7ctvdWSew\">Video<\/a>.<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul>\n<li><strong><img loading=\"lazy\" class=\" alignright\" src=\"http:\/\/easycoding.tn\/wp-content\/uploads\/2017\/12\/Temperature_Analog_Sensor.jpg\" width=\"255\" height=\"74\" \/>Temperature sensor<\/strong>:<br \/>\nReturn the temperature of the analog sensor. <a href=\"http:\/\/wiki.seeed.cc\/Project_Seven-Temperature\/\">More info<\/a>.<br \/>\nReturn type: <span style=\"color: #00ff00;\"><strong>Number<\/strong><\/span><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul>\n<li><strong><img loading=\"lazy\" class=\" alignright\" src=\"http:\/\/easycoding.tn\/wp-content\/uploads\/2017\/12\/Ultra_sonic.jpg\" width=\"290\" height=\"62\" \/>Ultrasonic ranger<\/strong>:<br \/>\nReturn the distance to an obstacle.<br \/>\nReturn type: <span style=\"color: #00ff00;\"><strong>Number<\/strong><\/span><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul>\n<li><strong><img loading=\"lazy\" class=\" alignright\" src=\"http:\/\/easycoding.tn\/wp-content\/uploads\/2017\/12\/ProgramStartedSince.jpg\" width=\"267\" height=\"86\" \/><\/strong><strong>Program started since<\/strong>:<br \/>\nReturn the time in the selected unit (Milliseconds or seconds or minutes) since the program started or uploaded. If you push the reset button, the program will restarted again.<br \/>\nReturn type: <strong><span style=\"color: #00ff00;\">Number<\/span><\/strong><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul>\n<li><strong><img loading=\"lazy\" class=\"size-medium alignright\" src=\"http:\/\/easycoding.tn\/wp-content\/uploads\/2017\/12\/Tone.jpg\" width=\"285\" height=\"63\" \/>Tone<\/strong>:<br \/>\nGenerates a square wave of the specified frequency (and 50% duty cycle) on a pin.<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul>\n<li><img loading=\"lazy\" class=\" alignright\" src=\"http:\/\/easycoding.tn\/wp-content\/uploads\/2017\/12\/ToneDuration.jpg\" width=\"307\" height=\"53\" \/><strong>Tone with duration<\/strong>:<br \/>\nGenerates a square wave of the specified frequency (and 50% duty cycle) on a pin for a certain duration.<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul>\n<li><strong><img loading=\"lazy\" class=\" alignright\" src=\"http:\/\/easycoding.tn\/wp-content\/uploads\/2017\/12\/NoTone.jpg\" width=\"164\" height=\"42\" \/>No Tone<\/strong>:<br \/>\nStops the generation of a square wave triggered by <code>tone()<\/code>. Has no effect if no tone is being generated.<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul>\n<li><strong><img class=\"alignright\" src=\"http:\/\/easycoding.tn\/wp-content\/uploads\/2018\/04\/Various_ArduinoCode.jpg\" \/>Arduino Code<\/strong>:<br \/>\nUse this bloc to add a specific code that TUNIOT can&#8217;t generate. You can also add comments. You can write all your commands in a single line separated by &#8216;;&#8217;<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Servo write: Set the angle of the servo in degrees, 0 to 180 on a specific pin. And will make&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":1007,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"http:\/\/easycoding.tn\/index.php\/wp-json\/wp\/v2\/pages\/1409"}],"collection":[{"href":"http:\/\/easycoding.tn\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/easycoding.tn\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/easycoding.tn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/easycoding.tn\/index.php\/wp-json\/wp\/v2\/comments?post=1409"}],"version-history":[{"count":17,"href":"http:\/\/easycoding.tn\/index.php\/wp-json\/wp\/v2\/pages\/1409\/revisions"}],"predecessor-version":[{"id":1623,"href":"http:\/\/easycoding.tn\/index.php\/wp-json\/wp\/v2\/pages\/1409\/revisions\/1623"}],"up":[{"embeddable":true,"href":"http:\/\/easycoding.tn\/index.php\/wp-json\/wp\/v2\/pages\/1007"}],"wp:attachment":[{"href":"http:\/\/easycoding.tn\/index.php\/wp-json\/wp\/v2\/media?parent=1409"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}