{"id":156,"date":"2013-07-18T08:30:18","date_gmt":"2013-07-18T08:30:18","guid":{"rendered":"http:\/\/justmakeit.es\/?p=156"},"modified":"2013-07-18T08:30:27","modified_gmt":"2013-07-18T08:30:27","slug":"first-steps-mypersonalarduinoproject_1","status":"publish","type":"post","link":"http:\/\/justmakeit.es\/?p=156","title":{"rendered":"First steps myPersonalArduinoProject_1"},"content":{"rendered":"<p>Hoy he empezado a trastear con los componentes que he recibido para la construcci\u00f3n del marcador electr\u00f3nico del futbol\u00edn en la oficina.<\/p>\n<p>Me ha costado encontrar el problema que estaba teniendo para conectar el sensor de ultrasonidos, porque no estaba colocando bien el cable de alimentaci\u00f3n.<\/p>\n<p>El c\u00f3digo del sketch de pruebas para hacer funcionar el sensor HC-SR04, es el siguiente:<\/p>\n<pre>#define trigPin 8\r\n#define echoPin 9\r\n\r\n  void setup() {\r\n    Serial.begin (9600);\r\n    pinMode(trigPin, OUTPUT);\r\n    pinMode(echoPin, INPUT);\r\n  }\r\n\r\n  void loop() {\r\n    long duration, distance;\r\n    digitalWrite(trigPin, LOW); \/\/ Added this line\r\n    delayMicroseconds(2); \/\/ Added this line\r\n    digitalWrite(trigPin, HIGH);\r\n    delayMicroseconds(10); \/\/ Added this line\r\n    digitalWrite(trigPin, LOW);\r\n    duration = pulseIn(echoPin, HIGH);\r\n    distance = (duration\/2) \/ 29.1;\r\n    if (distance &gt;= 200 || distance &lt;= 0)\r\n    {\r\n      Serial.print(\"Out of range..\");\r\n      Serial.println(distance);\r\n    } else {\r\n      Serial.print(distance);\r\n      Serial.println(\" cm\");\r\n    }\r\n    delay(500);\r\n  }<\/pre>\n<p>Y esta es la configuraci\u00f3n de la placa<\/p>\n<p><a href=\"http:\/\/justmakeit.es\/wp-content\/uploads\/2013\/07\/20130712_144218.jpg\"><img loading=\"lazy\" decoding=\"async\" alt=\"20130712_144218\" src=\"http:\/\/justmakeit.es\/wp-content\/uploads\/2013\/07\/20130712_144218-1024x768.jpg\" width=\"625\" height=\"468\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hoy he empezado a trastear con los componentes que he recibido para la construcci\u00f3n del marcador electr\u00f3nico del futbol\u00edn en &hellip; <a href=\"http:\/\/justmakeit.es\/?p=156\" class=\"btn btn-readmore\">Read More <span class=\"screen-reader-text\"> \u00abFirst steps myPersonalArduinoProject_1\u00bb<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-156","post","type-post","status-publish","format-standard","hentry","category-arduino"],"_links":{"self":[{"href":"http:\/\/justmakeit.es\/index.php?rest_route=\/wp\/v2\/posts\/156","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/justmakeit.es\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/justmakeit.es\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/justmakeit.es\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/justmakeit.es\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=156"}],"version-history":[{"count":7,"href":"http:\/\/justmakeit.es\/index.php?rest_route=\/wp\/v2\/posts\/156\/revisions"}],"predecessor-version":[{"id":164,"href":"http:\/\/justmakeit.es\/index.php?rest_route=\/wp\/v2\/posts\/156\/revisions\/164"}],"wp:attachment":[{"href":"http:\/\/justmakeit.es\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=156"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/justmakeit.es\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=156"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/justmakeit.es\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=156"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}