{"id":1216,"date":"2025-06-02T15:29:11","date_gmt":"2025-06-02T12:29:11","guid":{"rendered":"https:\/\/com47276.wordpress.com\/?page_id=1216"},"modified":"2025-06-02T15:29:11","modified_gmt":"2025-06-02T12:29:11","slug":"parking","status":"publish","type":"page","link":"https:\/\/oleksandraryshniak24.thkit.ee\/wp1\/parking\/","title":{"rendered":"Parking"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">\u00dclesanne 7.2 &#8220;Parking&#8221;<\/h2>\n\n\n\n<h4 class=\"wp-block-heading\">T\u00f6\u00f6 kirjeldus:<\/h4>\n\n\n\n<p>Autode parkla, mis loendab vabu kohti.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">T\u00f6\u00f6 protsess:<\/h4>\n\n\n\n<p>Kui auto l\u00e4heneb t\u00f5kkepuule, loeb andur ja t\u00f5stab t\u00f5kkepuu \u00fcles, ning ekraanil kuvatakse, et \u00fcks koht on h\u00f5ivatud. Ekraanil kuvatakse alati vabade kohtade arv. Kui auto lahkub parklast, loeb teine andur ja t\u00f5stab t\u00f5kkepuu \u00fcles. Samuti on olemas lamp, mis p\u00f5leb alati, kui vabu kohti on veel saadaval.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Kasutatud komponeendid:<\/h4>\n\n\n\n<p>Servo mootor \u2014 1<br>Emaplaat \u2014 1<br>LED \u2014 1<br>Taikisti \u2014 2 (220 Om)<br>Juhe \u2014 20<br>Arendusplaat \u2014 1<br>LCD ekraan \u2014 1<br>Potentsiomeeter \u2014 1<br>HC-SR04 \u2014 2<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Skeem:<\/h4>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/oleksandraryshniak24.thkit.ee\/wp1\/wp-content\/uploads\/2025\/06\/image-1.png?w=698\" alt=\"\" class=\"wp-image-1225\" \/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\">Programm:<\/h4>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\n#include &lt;Servo.h&gt;\n#include &lt;LiquidCrystal.h&gt;\n\n#define ECHO_PIN1 10\n#define TRIG_PIN1 9\n#define ECHO_PIN 8\n#define TRIG_PIN 7\n\nLiquidCrystal lcd(12, 11, 5, 4, 3, 2);\nconst int LED = 6;\nServo servo;\nconst int total = 5;\nint car = 0;\n\nvoid setup() {\n  servo.attach(13);\n  Serial.begin(9600);\n  servo.write(0);\n  pinMode(LED, OUTPUT);\n\n  lcd.begin(16, 2);\n  lcd.clear();\n  lcd.setCursor(0, 0);\n  lcd.print(&quot;Tere tulemast!&quot;);\n  delay(2000);\n  updateLCD();\n\n  pinMode(ECHO_PIN1, INPUT);\n  pinMode(TRIG_PIN1, OUTPUT);\n  pinMode(ECHO_PIN, INPUT);\n  pinMode(TRIG_PIN, OUTPUT);\n}\n\nlong readDistance(int trigPin, int echoPin) {\n  digitalWrite(trigPin, LOW);\n  delayMicroseconds(2);\n  digitalWrite(trigPin, HIGH);\n  delayMicroseconds(10);\n  digitalWrite(trigPin, LOW);\n  long duration = pulseIn(echoPin, HIGH);\n  long distance = duration * 0.034 \/ 2;\n  Serial.print(&quot;Distance from pins &quot;);\n  Serial.print(trigPin);\n  Serial.print(&quot;,&quot;);\n  Serial.print(echoPin);\n  Serial.print(&quot;: &quot;);\n  Serial.println(distance);\n  return distance;\n}\n\nvoid led() {\n  if (car &lt; total) {\n    digitalWrite(LED, HIGH);\n  } else {\n    digitalWrite(LED, LOW);\n  }\n}\n\nvoid servo_mootor() {\n  servo.write(90);\n  delay(3000);\n  servo.write(0);\n}\n\nvoid updateLCD() {\n  lcd.clear();\n  lcd.setCursor(0, 0);\n  lcd.print(&quot;Vabad kohad: &quot;);\n  lcd.print(total - car);\n}\n\nvoid loop() {\n  long entry = readDistance(TRIG_PIN, ECHO_PIN);\n  long exit_ = readDistance(TRIG_PIN1, ECHO_PIN1);\n\n  if (entry &gt; 0 &amp;&amp; entry &lt; 20 &amp;&amp; car &lt; total) {\n    car++;\n    servo_mootor();\n    led();\n\n    lcd.clear();\n    lcd.setCursor(0, 0);\n    lcd.print(&quot;Uks koht hoivatud&quot;);\n    lcd.setCursor(0, 1);\n    lcd.print(&quot;Alles: &quot;);\n    lcd.print(car);\n    delay(5000);\n    updateLCD();\n  }\n\n  if (exit_ &gt; 0 &amp;&amp; exit_ &lt; 20 &amp;&amp; car &gt; 0) {\n    car--;\n    servo_mootor();\n    led();\n\n    lcd.clear();\n    lcd.setCursor(0, 0);\n    lcd.print(&quot;Koht vabanes&quot;);\n    lcd.setCursor(0, 1);\n    lcd.print(&quot;Hoivatud: &quot;);\n    lcd.print(car);\n    delay(5000);\n    updateLCD();\n  }\n\n  delay(300);\n}\n\n    \n<\/pre><\/div>\n\n\n<h4 class=\"wp-block-heading\">Video:<\/h4>\n\n\n\n<p><a href=\"https:\/\/drive.google.com\/file\/d\/1f7Uwt1wCSTsxnaC5q0co6oJzlHBTbySX\/view?usp=sharing\">https:\/\/drive.google.com\/file\/d\/1f7Uwt1wCSTsxnaC5q0co6oJzlHBTbySX\/view?usp=sharing<\/a><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Uued funktsioonid:<\/h4>\n\n\n\n<p>digitalMicroseconds () &#8211; aja m\u00e4\u00e4ramine mikrosekundites digitaalsete s\u00fcndmuste vahel.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Rakendamine:<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Automaatuksed<\/li>\n\n\n\n<li>Turvas\u00fcsteemid<\/li>\n\n\n\n<li>Parkimiss\u00fcsteem<\/li>\n\n\n\n<li>Kohaloleku kontroll<\/li>\n\n\n\n<li>Objektide m\u00f5\u00f5tmete m\u00f5\u00f5tmine<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u00dclesanne 7.2 &#8220;Parking&#8221; T\u00f6\u00f6 kirjeldus: Autode parkla, mis loendab vabu kohti. T\u00f6\u00f6 protsess: Kui auto l\u00e4heneb t\u00f5kkepuule, loeb andur ja [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"page-with-title","meta":{"footnotes":""},"class_list":["post-1216","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Parking - Oleksandra Ryshniak Portfolio<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/oleksandraryshniak24.thkit.ee\/wp1\/parking\/\" \/>\n<meta property=\"og:locale\" content=\"et_EE\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Parking - Oleksandra Ryshniak Portfolio\" \/>\n<meta property=\"og:description\" content=\"\u00dclesanne 7.2 &#8220;Parking&#8221; T\u00f6\u00f6 kirjeldus: Autode parkla, mis loendab vabu kohti. T\u00f6\u00f6 protsess: Kui auto l\u00e4heneb t\u00f5kkepuule, loeb andur ja [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/oleksandraryshniak24.thkit.ee\/wp1\/parking\/\" \/>\n<meta property=\"og:site_name\" content=\"Oleksandra Ryshniak Portfolio\" \/>\n<meta property=\"og:image\" content=\"https:\/\/oleksandraryshniak24.thkit.ee\/wp1\/wp-content\/uploads\/2025\/06\/image.png\" \/>\n\t<meta property=\"og:image:width\" content=\"698\" \/>\n\t<meta property=\"og:image:height\" content=\"690\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutit\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/oleksandraryshniak24.thkit.ee\\\/wp1\\\/parking\\\/\",\"url\":\"https:\\\/\\\/oleksandraryshniak24.thkit.ee\\\/wp1\\\/parking\\\/\",\"name\":\"Parking - Oleksandra Ryshniak Portfolio\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/oleksandraryshniak24.thkit.ee\\\/wp1\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/oleksandraryshniak24.thkit.ee\\\/wp1\\\/parking\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/oleksandraryshniak24.thkit.ee\\\/wp1\\\/parking\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/oleksandraryshniak24.thkit.ee\\\/wp1\\\/wp-content\\\/uploads\\\/2025\\\/06\\\/image-1.png?w=698\",\"datePublished\":\"2025-06-02T12:29:11+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/oleksandraryshniak24.thkit.ee\\\/wp1\\\/parking\\\/#breadcrumb\"},\"inLanguage\":\"et\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/oleksandraryshniak24.thkit.ee\\\/wp1\\\/parking\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"et\",\"@id\":\"https:\\\/\\\/oleksandraryshniak24.thkit.ee\\\/wp1\\\/parking\\\/#primaryimage\",\"url\":\"https:\\\/\\\/oleksandraryshniak24.thkit.ee\\\/wp1\\\/wp-content\\\/uploads\\\/2025\\\/06\\\/image.png\",\"contentUrl\":\"https:\\\/\\\/oleksandraryshniak24.thkit.ee\\\/wp1\\\/wp-content\\\/uploads\\\/2025\\\/06\\\/image.png\",\"width\":698,\"height\":690},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/oleksandraryshniak24.thkit.ee\\\/wp1\\\/parking\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/oleksandraryshniak24.thkit.ee\\\/wp1\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Parking\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/oleksandraryshniak24.thkit.ee\\\/wp1\\\/#website\",\"url\":\"https:\\\/\\\/oleksandraryshniak24.thkit.ee\\\/wp1\\\/\",\"name\":\"Oleksandra Ryshniak Portfolio\",\"description\":\"\u041f\u0440\u043e\u0441\u0442\u043e \u0435\u0449\u0435 \u043e\u0434\u0438\u043d WordPress \u0441\u0430\u0439\u0442\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/oleksandraryshniak24.thkit.ee\\\/wp1\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"et\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Parking - Oleksandra Ryshniak Portfolio","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:\/\/oleksandraryshniak24.thkit.ee\/wp1\/parking\/","og_locale":"et_EE","og_type":"article","og_title":"Parking - Oleksandra Ryshniak Portfolio","og_description":"\u00dclesanne 7.2 &#8220;Parking&#8221; T\u00f6\u00f6 kirjeldus: Autode parkla, mis loendab vabu kohti. T\u00f6\u00f6 protsess: Kui auto l\u00e4heneb t\u00f5kkepuule, loeb andur ja [&hellip;]","og_url":"https:\/\/oleksandraryshniak24.thkit.ee\/wp1\/parking\/","og_site_name":"Oleksandra Ryshniak Portfolio","og_image":[{"width":698,"height":690,"url":"https:\/\/oleksandraryshniak24.thkit.ee\/wp1\/wp-content\/uploads\/2025\/06\/image.png","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutit"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/oleksandraryshniak24.thkit.ee\/wp1\/parking\/","url":"https:\/\/oleksandraryshniak24.thkit.ee\/wp1\/parking\/","name":"Parking - Oleksandra Ryshniak Portfolio","isPartOf":{"@id":"https:\/\/oleksandraryshniak24.thkit.ee\/wp1\/#website"},"primaryImageOfPage":{"@id":"https:\/\/oleksandraryshniak24.thkit.ee\/wp1\/parking\/#primaryimage"},"image":{"@id":"https:\/\/oleksandraryshniak24.thkit.ee\/wp1\/parking\/#primaryimage"},"thumbnailUrl":"https:\/\/oleksandraryshniak24.thkit.ee\/wp1\/wp-content\/uploads\/2025\/06\/image-1.png?w=698","datePublished":"2025-06-02T12:29:11+00:00","breadcrumb":{"@id":"https:\/\/oleksandraryshniak24.thkit.ee\/wp1\/parking\/#breadcrumb"},"inLanguage":"et","potentialAction":[{"@type":"ReadAction","target":["https:\/\/oleksandraryshniak24.thkit.ee\/wp1\/parking\/"]}]},{"@type":"ImageObject","inLanguage":"et","@id":"https:\/\/oleksandraryshniak24.thkit.ee\/wp1\/parking\/#primaryimage","url":"https:\/\/oleksandraryshniak24.thkit.ee\/wp1\/wp-content\/uploads\/2025\/06\/image.png","contentUrl":"https:\/\/oleksandraryshniak24.thkit.ee\/wp1\/wp-content\/uploads\/2025\/06\/image.png","width":698,"height":690},{"@type":"BreadcrumbList","@id":"https:\/\/oleksandraryshniak24.thkit.ee\/wp1\/parking\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/oleksandraryshniak24.thkit.ee\/wp1\/"},{"@type":"ListItem","position":2,"name":"Parking"}]},{"@type":"WebSite","@id":"https:\/\/oleksandraryshniak24.thkit.ee\/wp1\/#website","url":"https:\/\/oleksandraryshniak24.thkit.ee\/wp1\/","name":"Oleksandra Ryshniak Portfolio","description":"\u041f\u0440\u043e\u0441\u0442\u043e \u0435\u0449\u0435 \u043e\u0434\u0438\u043d WordPress \u0441\u0430\u0439\u0442","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/oleksandraryshniak24.thkit.ee\/wp1\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"et"}]}},"_links":{"self":[{"href":"https:\/\/oleksandraryshniak24.thkit.ee\/wp1\/wp-json\/wp\/v2\/pages\/1216","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/oleksandraryshniak24.thkit.ee\/wp1\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/oleksandraryshniak24.thkit.ee\/wp1\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/oleksandraryshniak24.thkit.ee\/wp1\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/oleksandraryshniak24.thkit.ee\/wp1\/wp-json\/wp\/v2\/comments?post=1216"}],"version-history":[{"count":0,"href":"https:\/\/oleksandraryshniak24.thkit.ee\/wp1\/wp-json\/wp\/v2\/pages\/1216\/revisions"}],"wp:attachment":[{"href":"https:\/\/oleksandraryshniak24.thkit.ee\/wp1\/wp-json\/wp\/v2\/media?parent=1216"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}