{"id":419,"date":"2023-08-29T18:23:02","date_gmt":"2023-08-29T15:23:02","guid":{"rendered":"https:\/\/www.facadium.com.tr\/blog\/?p=419"},"modified":"2023-08-29T18:32:41","modified_gmt":"2023-08-29T15:32:41","slug":"arduino-ile-toplama-islemi","status":"publish","type":"post","link":"https:\/\/www.facadium.com.tr\/blog\/arduino-ile-toplama-islemi\/","title":{"rendered":"Arduino ile Toplama \u0130\u015flemi"},"content":{"rendered":"\n<p>Merhabalar, bu yaz\u0131m\u0131zda Arduino yaz\u0131l\u0131m dilinde matematiksel i\u015flemlerden toplama i\u015flemini yapaca\u011f\u0131z. A\u015fa\u011f\u0131da kodlar\u0131 verilen toplama i\u015flemini a\u00e7\u0131klamaya \u00e7al\u0131\u015ft\u0131k. Sizler de benzer \u00f6rnekler yaparak kendinizi geli\u015ftirebilirsiniz. Matematiksel i\u015flemlere ilerleyen g\u00fcnlerde devam edece\u011fiz.<\/p>\n\n\n\n<p>\u0130lk \u00f6nce bilgisayar ile ileti\u015fimi sa\u011flamak i\u00e7in <strong>Serial.begin(9600)<\/strong> \u00f6zelli\u011finden faydalan\u0131yoruz. Ve bu i\u015flemi s\u00fcrekli yapmamas\u0131 i\u00e7in bu kod sat\u0131r\u0131n\u0131 <strong>void setup<\/strong> b\u00f6l\u00fcm\u00fcne yaz\u0131yoruz. Bu sayede d\u00f6ng\u00fcye girmeyecek ve bir sefer bu kod \u00e7al\u0131\u015facak.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>void setup() {\n  \/\/ put your setup code here, to run once:\n  Serial.begin(9600);\n}<\/code><\/pre>\n\n\n\n<p>Daha sonra <strong>void loop<\/strong> b\u00f6l\u00fcm\u00fcne toplanacak say\u0131lar\u0131m\u0131z\u0131 yaz\u0131yoruz. Ancak burada say\u0131lar\u0131m\u0131z\u0131 yazarken say\u0131lar\u0131 direk yazam\u0131yoruz. Bunun yerine bir de\u011fi\u015fken tan\u0131ml\u0131yoruz. Daha sonra bu de\u011fi\u015fkenleri toplamada kullanaca\u011f\u0131z. \u00d6rnek olarak v ve b harflerini de\u011fi\u015fken ad\u0131 olarak kulland\u0131k. Bunun yerine sizler de farkl\u0131 adlar ile de\u011fi\u015fkenlerinizi tan\u0131mlayabilirsiniz. Burada de\u011fi\u015fkenleri tan\u0131mlarken mutlaka de\u011fi\u015fkenin t\u00fcr\u00fcn\u00fc belirtmelisiniz. E\u011fer tamsay\u0131 ise<strong> int<\/strong> ondal\u0131kl\u0131 bir say\u0131 ise de\u011fi\u015fkeniniz <strong>float<\/strong> olacakt\u0131r. De\u011fi\u015fken tan\u0131mlama ve t\u00fcrlerinin anlat\u0131ld\u0131\u011f\u0131 blog yaz\u0131m\u0131zda bu konu daha derinlemesine i\u015flenmi\u015ftir.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\n  int v = 15;\n  float b = 3.125;\n\n  float c = v + b;\n<\/code><\/pre>\n\n\n\n<p>Burada ekrana yaz\u0131y\u0131 yazd\u0131rmak i\u00e7in <strong>Serial.print()<\/strong> fonksiyonundan faydalan\u0131yoruz. Ancak e\u011fer siz <strong>void setup<\/strong> k\u0131sm\u0131nda <strong>Serial.begin(9600) <\/strong>belirtmediyseniz bu a\u015famada <strong>Serial.print()<\/strong> ile sonucu ekrana yazd\u0131r deseniz dahi program do\u011fru \u00e7al\u0131\u015facak ancak ekranda bir \u00e7\u0131kt\u0131 g\u00f6remeyeceksiniz. Bu konuya dikkat etmelisiniz. Ayr\u0131ca yaz\u0131l\u0131mda sa\u011f alt k\u0131s\u0131mda <strong>baud<\/strong> b\u00f6l\u00fcm\u00fcndeki de\u011fer <strong>9600<\/strong> de\u011fil de ba\u015fka bir de\u011fer ise <strong>void setup<\/strong> k\u0131sm\u0131na<strong> Serial.begin(9600)<\/strong> yazsan\u0131z da bu \u00e7\u0131kt\u0131n\u0131z ekranda g\u00f6r\u00fcnmeyecektir. Buna da dikkat etmelisiniz. <\/p>\n\n\n\n<p><strong>while (1); <\/strong>ile program sonsuz d\u00f6ng\u00fcye girmeyecek ve bir defa \u00e7al\u0131\u015facakt\u0131r ve sonucu ekrana yazacakt\u0131r.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>void setup() {\n  \/\/ put your setup code here, to run once:\n  Serial.begin(9600);\n}\n\nvoid loop() { \n  \/\/ put your main code here, to run repeatedly:\n\n  int v = 15;\n  float b = 3.125;\n\n  float c = v + b;\n\n  Serial.println(c);\n  while (1);  \/\/ bu fonksiyon sadece serial.println alt\u0131na yaz\u0131l\u0131rsa program sonu\u00e7 verecektir.\n}<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Merhabalar, bu yaz\u0131m\u0131zda Arduino yaz\u0131l\u0131m dilinde matematiksel i\u015flemlerden toplama i\u015flemini yapaca\u011f\u0131z. A\u015fa\u011f\u0131da kodlar\u0131 verilen toplama i\u015flemini a\u00e7\u0131klamaya \u00e7al\u0131\u015ft\u0131k. Sizler de benzer \u00f6rnekler yaparak kendinizi geli\u015ftirebilirsiniz. [&#8230;]<\/p>\n","protected":false},"author":3,"featured_media":424,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[12,11,56,55,9],"class_list":["post-419","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-arduino-ile-robotik-kodlama","tag-arduino","tag-bilisim","tag-matematik","tag-toplama-islemi","tag-yazilim"],"_links":{"self":[{"href":"https:\/\/www.facadium.com.tr\/blog\/wp-json\/wp\/v2\/posts\/419","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.facadium.com.tr\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.facadium.com.tr\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.facadium.com.tr\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.facadium.com.tr\/blog\/wp-json\/wp\/v2\/comments?post=419"}],"version-history":[{"count":1,"href":"https:\/\/www.facadium.com.tr\/blog\/wp-json\/wp\/v2\/posts\/419\/revisions"}],"predecessor-version":[{"id":421,"href":"https:\/\/www.facadium.com.tr\/blog\/wp-json\/wp\/v2\/posts\/419\/revisions\/421"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.facadium.com.tr\/blog\/wp-json\/wp\/v2\/media\/424"}],"wp:attachment":[{"href":"https:\/\/www.facadium.com.tr\/blog\/wp-json\/wp\/v2\/media?parent=419"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.facadium.com.tr\/blog\/wp-json\/wp\/v2\/categories?post=419"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.facadium.com.tr\/blog\/wp-json\/wp\/v2\/tags?post=419"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}