<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3996394282062555391</id><updated>2025-02-10T14:05:36.420+07:00</updated><category term="Kalman Filter"/><category term="Arduino Running LED"/><category term="Arduino as DC voltmeter"/><category term="Arduino play vocal"/><category term="Audio Player Arduino"/><category term="Blynk IOT"/><category term="DIY Digital Voltmeter"/><category term="DIY voltmeter"/><category term="Digital Clock Arduino"/><category term="How to drive mosfet"/><category term="How to find Hex file arduino IDE"/><category term="I2C for LCD 16x2"/><category term="IOT LM35 arduino code"/><category term="IOT temperature logging"/><category term="Mosfet"/><category term="Motor Servo"/><category term="PC8574"/><category term="Range finder"/><category term="Running LED Knight Rider using Arduino"/><category term="arduino parking alarm"/><category term="find hex file at arduino IDE developer"/><category term="usb 2.0 serial error"/><category term="usb 2.0 serial error arduino"/><title type='text'>Ardunino Hacks</title><subtitle type='html'>arduino project, arduino example, arduino murah, murah arduino,  sketch, shield arduino, arduino, arduino sketch, arduino bootloader, arduino uno</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://arduinoeasyproject.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3996394282062555391/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://arduinoeasyproject.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>FeHq</name><uri>http://www.blogger.com/profile/11734094429613707887</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>16</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3996394282062555391.post-5154175162364848622</id><published>2024-01-05T21:59:00.005+07:00</published><updated>2024-01-05T21:59:47.709+07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Arduino Running LED"/><category scheme="http://www.blogger.com/atom/ns#" term="Running LED Knight Rider using Arduino"/><title type='text'>Running LED Knight Rider using Arduino </title><content type='html'>&lt;p&gt;&amp;nbsp;Schematic&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBwPdXEB75agRUqAKVwbfMjRG2j0z_tD2uWkbyyClG5zBPNebGtw3JqnJswicAIgUJe-A9ulBniO6cyemeVjZ62G9VVEIjIAEvMf-qO3sJC-bwpMqZ5LvWlj9bj1wW2QdYus7pcJKAxIND94L4dup37cS75qbNC9kchCv0uP_8ak-u4DtnhtCuysc2Hbxe/s518/KnightRiderAduino-arduinoeasyproject.blogspot.com.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;518&quot; data-original-width=&quot;405&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBwPdXEB75agRUqAKVwbfMjRG2j0z_tD2uWkbyyClG5zBPNebGtw3JqnJswicAIgUJe-A9ulBniO6cyemeVjZ62G9VVEIjIAEvMf-qO3sJC-bwpMqZ5LvWlj9bj1wW2QdYus7pcJKAxIND94L4dup37cS75qbNC9kchCv0uP_8ak-u4DtnhtCuysc2Hbxe/w313-h400/KnightRiderAduino-arduinoeasyproject.blogspot.com.jpg&quot; width=&quot;313&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&amp;nbsp;The code:&lt;p&gt;&lt;/p&gt;&lt;div style=&quot;background-color: #fffffe; color: black; font-family: Consolas, &#39;Courier New&#39;, monospace; font-size: 14px; font-weight: normal; line-height: 19px; white-space: pre;&quot;&gt;&lt;div&gt;&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; ledPins[] = {&lt;/span&gt;&lt;span style=&quot;color: #098658;&quot;&gt;13&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #098658;&quot;&gt;12&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #098658;&quot;&gt;11&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #098658;&quot;&gt;10&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #098658;&quot;&gt;9&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #098658;&quot;&gt;8&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #098658;&quot;&gt;7&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #098658;&quot;&gt;6&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #098658;&quot;&gt;5&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #098658;&quot;&gt;4&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;};&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; numLEDs = &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;sizeof&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;(ledPins) / &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;sizeof&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;(ledPins[&lt;/span&gt;&lt;span style=&quot;color: #098658;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;]);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; delayTime = &lt;/span&gt;&lt;span style=&quot;color: #098658;&quot;&gt;80&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;; &lt;/span&gt;&lt;span style=&quot;color: #727c81;&quot;&gt;// Waktu tunda dalam milidetik&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #5e6d03;&quot;&gt;setup&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;() {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; i = &lt;/span&gt;&lt;span style=&quot;color: #098658;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;; i &amp;lt; numLEDs; i++) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #e97366;&quot;&gt;pinMode&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;(ledPins[i], &lt;/span&gt;&lt;span style=&quot;color: #00979c;&quot;&gt;OUTPUT&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #5e6d03;&quot;&gt;loop&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;() {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; i = &lt;/span&gt;&lt;span style=&quot;color: #098658;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;; i &amp;lt; numLEDs; i++) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #e97366;&quot;&gt;digitalWrite&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;(ledPins[i], &lt;/span&gt;&lt;span style=&quot;color: #00979c;&quot;&gt;HIGH&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #e97366;&quot;&gt;delay&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;(delayTime);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #e97366;&quot;&gt;digitalWrite&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;(ledPins[i], &lt;/span&gt;&lt;span style=&quot;color: #00979c;&quot;&gt;LOW&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; i = numLEDs - &lt;/span&gt;&lt;span style=&quot;color: #098658;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;; i &amp;gt;= &lt;/span&gt;&lt;span style=&quot;color: #098658;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;; i--) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #e97366;&quot;&gt;digitalWrite&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;(ledPins[i], &lt;/span&gt;&lt;span style=&quot;color: #00979c;&quot;&gt;HIGH&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #e97366;&quot;&gt;delay&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;(delayTime);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #e97366;&quot;&gt;digitalWrite&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;(ledPins[i], &lt;/span&gt;&lt;span style=&quot;color: #00979c;&quot;&gt;LOW&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;arduinoeasyproject.blogspot.com&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arduinoeasyproject.blogspot.com/feeds/5154175162364848622/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3996394282062555391/5154175162364848622' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3996394282062555391/posts/default/5154175162364848622'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3996394282062555391/posts/default/5154175162364848622'/><link rel='alternate' type='text/html' href='http://arduinoeasyproject.blogspot.com/2024/01/running-led-knight-rider-using-arduino.html' title='Running LED Knight Rider using Arduino '/><author><name>FeHq</name><uri>http://www.blogger.com/profile/11734094429613707887</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBwPdXEB75agRUqAKVwbfMjRG2j0z_tD2uWkbyyClG5zBPNebGtw3JqnJswicAIgUJe-A9ulBniO6cyemeVjZ62G9VVEIjIAEvMf-qO3sJC-bwpMqZ5LvWlj9bj1wW2QdYus7pcJKAxIND94L4dup37cS75qbNC9kchCv0uP_8ak-u4DtnhtCuysc2Hbxe/s72-w313-h400-c/KnightRiderAduino-arduinoeasyproject.blogspot.com.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3996394282062555391.post-8037329053501989002</id><published>2024-01-05T21:54:00.001+07:00</published><updated>2024-01-05T21:54:11.838+07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Arduino as DC voltmeter"/><category scheme="http://www.blogger.com/atom/ns#" term="DIY Digital Voltmeter"/><category scheme="http://www.blogger.com/atom/ns#" term="DIY voltmeter"/><title type='text'>Use Arduino as Bateray AA Checker</title><content type='html'>&lt;p&gt;&amp;nbsp;Schematic&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;528&quot; data-original-width=&quot;722&quot; height=&quot;293&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRLBFNibeuQgjFBJdkNU6e1YZk9w_Qt1Jqe3_47j1FOz9g0hCze_pm1XcBXjzRLmF8UkPnVWmHgjrVp_S38x3x1819k8NX97lEmSP99t_jTz14DQlFrN4gmWJBf90BYja0miH1WKYSeGF4SmUoA8GxGqdpj5QV_7piQb3nbI_WRS3pOccD6rw8oJx954yh/w400-h293/Voltmeter_using_arduino_arduinoeasyproject.blogspot.com.png&quot; title=&quot;Fig 1. Schematic circuit arduino as voltmeter&quot; width=&quot;400&quot; /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRLBFNibeuQgjFBJdkNU6e1YZk9w_Qt1Jqe3_47j1FOz9g0hCze_pm1XcBXjzRLmF8UkPnVWmHgjrVp_S38x3x1819k8NX97lEmSP99t_jTz14DQlFrN4gmWJBf90BYja0miH1WKYSeGF4SmUoA8GxGqdpj5QV_7piQb3nbI_WRS3pOccD6rw8oJx954yh/s722/Voltmeter_using_arduino_arduinoeasyproject.blogspot.com.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;Maximum input voltage measurement is 5 volt as maximum internal ADC in IC Atmega328. If want to expand measurement can use voltage divider circuit.&amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;The code:&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;div style=&quot;background-color: #fffffe; color: black; font-family: Consolas, &#39;Courier New&#39;, monospace; font-size: 14px; font-weight: normal; line-height: 19px; white-space: pre;&quot;&gt;&lt;div&gt;&lt;span style=&quot;color: blue;&quot;&gt;#include&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;Wire.h&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: blue;&quot;&gt;#include&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;LiquidCrystal_I2C.h&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;LiquidCrystal_I2C lcd(&lt;/span&gt;&lt;span style=&quot;color: #3030c0;&quot;&gt;0x27&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #098658;&quot;&gt;16&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #098658;&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;); &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #727c81;&quot;&gt;// Alamat I2C untuk LCD 16x2&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: blue;&quot;&gt;const&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; sensorPin = &lt;/span&gt;&lt;span style=&quot;color: #00979c;&quot;&gt;A0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #727c81;&quot;&gt;// Pin sensor tegangan&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: blue;&quot;&gt;const&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; redLedPin = &lt;/span&gt;&lt;span style=&quot;color: #098658;&quot;&gt;8&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #727c81;&quot;&gt;// Pin LED merah&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: blue;&quot;&gt;const&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; yellowLedPin = &lt;/span&gt;&lt;span style=&quot;color: #098658;&quot;&gt;9&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #727c81;&quot;&gt;// Pin LED kuning&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: blue;&quot;&gt;const&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; greenLedPin = &lt;/span&gt;&lt;span style=&quot;color: #098658;&quot;&gt;10&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;; &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #727c81;&quot;&gt;// Pin LED hijau&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #5e6d03;&quot;&gt;setup&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;() {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; lcd.&lt;/span&gt;&lt;span style=&quot;color: #e97366;&quot;&gt;begin&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #098658;&quot;&gt;16&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #098658;&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;); &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #727c81;&quot;&gt;// Inisialisasi LCD&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; lcd.backlight(); &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #727c81;&quot;&gt;// Aktifkan backlight LCD&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #e97366;&quot;&gt;pinMode&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;(redLedPin, &lt;/span&gt;&lt;span style=&quot;color: #00979c;&quot;&gt;OUTPUT&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #e97366;&quot;&gt;pinMode&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;(yellowLedPin, &lt;/span&gt;&lt;span style=&quot;color: #00979c;&quot;&gt;OUTPUT&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #e97366;&quot;&gt;pinMode&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;(greenLedPin, &lt;/span&gt;&lt;span style=&quot;color: #00979c;&quot;&gt;OUTPUT&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #5e6d03;&quot;&gt;loop&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;() {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #727c81;&quot;&gt;// Baca tegangan dari sensor&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; sensorValue = &lt;/span&gt;&lt;span style=&quot;color: #e97366;&quot;&gt;analogRead&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;(sensorPin);&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #727c81;&quot;&gt;// Konversi nilai sensor menjadi tegangan (0-5V)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;float&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; voltage = sensorValue * (&lt;/span&gt;&lt;span style=&quot;color: #098658;&quot;&gt;5.0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; / &lt;/span&gt;&lt;span style=&quot;color: #098658;&quot;&gt;1023.0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #727c81;&quot;&gt;// Tampilkan tegangan di LCD&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; lcd.clear();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; lcd.setCursor(&lt;/span&gt;&lt;span style=&quot;color: #098658;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #098658;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; lcd.&lt;/span&gt;&lt;span style=&quot;color: #e97366;&quot;&gt;print&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Tegangan: &quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; lcd.&lt;/span&gt;&lt;span style=&quot;color: #e97366;&quot;&gt;print&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;(voltage);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; lcd.&lt;/span&gt;&lt;span style=&quot;color: #e97366;&quot;&gt;print&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;V&quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; lcd.setCursor(&lt;/span&gt;&lt;span style=&quot;color: #098658;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #098658;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; lcd.&lt;/span&gt;&lt;span style=&quot;color: #e97366;&quot;&gt;print&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Sensor: &quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; lcd.&lt;/span&gt;&lt;span style=&quot;color: #e97366;&quot;&gt;print&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;(sensorValue);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; lcd.&lt;/span&gt;&lt;span style=&quot;color: #e97366;&quot;&gt;print&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;&quot; ADC&quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;); &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #727c81;&quot;&gt;// Tentukan warna LED sesuai dengan rentang tegangan&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; (voltage &amp;gt;= &lt;/span&gt;&lt;span style=&quot;color: #098658;&quot;&gt;0.0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &amp;amp;&amp;amp; voltage &amp;lt;= &lt;/span&gt;&lt;span style=&quot;color: #098658;&quot;&gt;0.6&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #e97366;&quot;&gt;digitalWrite&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;(redLedPin, &lt;/span&gt;&lt;span style=&quot;color: #00979c;&quot;&gt;HIGH&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #e97366;&quot;&gt;digitalWrite&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;(yellowLedPin, &lt;/span&gt;&lt;span style=&quot;color: #00979c;&quot;&gt;LOW&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #e97366;&quot;&gt;digitalWrite&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;(greenLedPin, &lt;/span&gt;&lt;span style=&quot;color: #00979c;&quot;&gt;LOW&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; } &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;else&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; (voltage &amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #098658;&quot;&gt;0.6&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &amp;amp;&amp;amp; voltage &amp;lt;= &lt;/span&gt;&lt;span style=&quot;color: #098658;&quot;&gt;1.2&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #e97366;&quot;&gt;digitalWrite&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;(redLedPin, &lt;/span&gt;&lt;span style=&quot;color: #00979c;&quot;&gt;LOW&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #e97366;&quot;&gt;digitalWrite&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;(yellowLedPin, &lt;/span&gt;&lt;span style=&quot;color: #00979c;&quot;&gt;HIGH&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #e97366;&quot;&gt;digitalWrite&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;(greenLedPin, &lt;/span&gt;&lt;span style=&quot;color: #00979c;&quot;&gt;LOW&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; } &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;else&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; (voltage &amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #098658;&quot;&gt;1.2&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt; ) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #e97366;&quot;&gt;digitalWrite&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;(redLedPin, &lt;/span&gt;&lt;span style=&quot;color: #00979c;&quot;&gt;LOW&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #e97366;&quot;&gt;digitalWrite&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;(yellowLedPin, &lt;/span&gt;&lt;span style=&quot;color: #00979c;&quot;&gt;LOW&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #e97366;&quot;&gt;digitalWrite&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;(greenLedPin, &lt;/span&gt;&lt;span style=&quot;color: #00979c;&quot;&gt;HIGH&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #e97366;&quot;&gt;delay&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #098658;&quot;&gt;1000&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;); &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #727c81;&quot;&gt;// Tunda selama 1 detik sebelum membaca ulang tegangan&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;color: black;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&amp;nbsp;&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;arduinoeasyproject.blogspot.com&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arduinoeasyproject.blogspot.com/feeds/8037329053501989002/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3996394282062555391/8037329053501989002' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3996394282062555391/posts/default/8037329053501989002'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3996394282062555391/posts/default/8037329053501989002'/><link rel='alternate' type='text/html' href='http://arduinoeasyproject.blogspot.com/2024/01/use-arduino-as-bateray-aa-checker.html' title='Use Arduino as Bateray AA Checker'/><author><name>FeHq</name><uri>http://www.blogger.com/profile/11734094429613707887</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhRLBFNibeuQgjFBJdkNU6e1YZk9w_Qt1Jqe3_47j1FOz9g0hCze_pm1XcBXjzRLmF8UkPnVWmHgjrVp_S38x3x1819k8NX97lEmSP99t_jTz14DQlFrN4gmWJBf90BYja0miH1WKYSeGF4SmUoA8GxGqdpj5QV_7piQb3nbI_WRS3pOccD6rw8oJx954yh/s72-w400-h293-c/Voltmeter_using_arduino_arduinoeasyproject.blogspot.com.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3996394282062555391.post-4266445471022006767</id><published>2023-08-05T21:29:00.002+07:00</published><updated>2023-08-05T21:29:42.110+07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="I2C for LCD 16x2"/><category scheme="http://www.blogger.com/atom/ns#" term="PC8574"/><title type='text'> Arduino coding for display LCD 16x2 using I2C wire</title><content type='html'>&lt;p&gt;&amp;nbsp;Arduino code to display text on a 16x2 LCD using the I2C wire library and an I2C LCD module (PCF8574):&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5W_bfFF4CY6bGPZ4hxy2v0sFWJbNpaiIaI2TD1eweHyG2vYqKAIKc55CUI7_n9j8wN-n3fCJKxzl_WvnWWZWew8DP2G0XZN9jqSXFp-mg_R8xloeSrKHC_8gpvXnI5I8_L6VUYs4t3YLo4LbFkZ8h50ApAKs-aQgpRax1u7Gj5F6dpZbg3NIRLli03xUt/s397/PCF8574_I2C_lcd_16x2.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;365&quot; data-original-width=&quot;397&quot; height=&quot;184&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5W_bfFF4CY6bGPZ4hxy2v0sFWJbNpaiIaI2TD1eweHyG2vYqKAIKc55CUI7_n9j8wN-n3fCJKxzl_WvnWWZWew8DP2G0XZN9jqSXFp-mg_R8xloeSrKHC_8gpvXnI5I8_L6VUYs4t3YLo4LbFkZ8h50ApAKs-aQgpRax1u7Gj5F6dpZbg3NIRLli03xUt/w200-h184/PCF8574_I2C_lcd_16x2.png&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-J0bfRnApfE7qXvr4Li8dbuQgLk42T39jwmMMQ1Swgv2JVgQB4fIzwHEV-Rkx6DC9DY1poIcSmWreNuEbgZjGbFItCEO_-81ZnTe8Ebx0cMz57mk-hproABsf0sng0uUmvf0jQos8xKn47UvM2-Umn4yW4Ds47Rr-sN-UTcFyjNQy10avJ84RMN7CFtxH/s2048/PCF8574_I2C_lcd_16x2_2_arduinoeasyproject.blogspot.com.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;831&quot; data-original-width=&quot;2048&quot; height=&quot;163&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-J0bfRnApfE7qXvr4Li8dbuQgLk42T39jwmMMQ1Swgv2JVgQB4fIzwHEV-Rkx6DC9DY1poIcSmWreNuEbgZjGbFItCEO_-81ZnTe8Ebx0cMz57mk-hproABsf0sng0uUmvf0jQos8xKn47UvM2-Umn4yW4Ds47Rr-sN-UTcFyjNQy10avJ84RMN7CFtxH/w400-h163/PCF8574_I2C_lcd_16x2_2_arduinoeasyproject.blogspot.com.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;First, make sure you have installed the &quot;LiquidCrystal_I2C&quot; library. If you haven&#39;t, you can download it from the Library Manager in the Arduino IDE.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family: courier; font-size: small;&quot;&gt;&lt;span&gt;#include &amp;lt;Wire.h&amp;gt;&lt;br /&gt;#include &amp;lt;LiquidCrystal_I2C.h&amp;gt;&lt;br /&gt;&lt;br /&gt;// Set the LCD address (0x27 or 0x3F) according to your module&lt;br /&gt;#define I2C_ADDR 0x27&lt;br /&gt;&lt;br /&gt;// Set the LCD size (16x2)&lt;br /&gt;#define LCD_COLUMNS 16&lt;br /&gt;#define LCD_ROWS 2&lt;br /&gt;&lt;br /&gt;// Create an instance of the LCD object&lt;br /&gt;LiquidCrystal_I2C lcd(I2C_ADDR, LCD_COLUMNS, LCD_ROWS);&lt;br /&gt;&lt;br /&gt;void setup() {&lt;br /&gt;&amp;nbsp; // Initialize the LCD&lt;br /&gt;&amp;nbsp; lcd.begin(LCD_COLUMNS, LCD_ROWS);&lt;br /&gt;&lt;br /&gt;&amp;nbsp; // Turn on the backlight (if available)&lt;br /&gt;&amp;nbsp; lcd.backlight();&lt;br /&gt;&lt;br /&gt;&amp;nbsp; // Write text to the LCD&lt;br /&gt;&amp;nbsp; lcd.print(&quot;Hello, World!&quot;);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void loop() {&lt;br /&gt;&amp;nbsp; // Add your code here (if needed)&lt;br /&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;In this example, we use the &quot;LiquidCrystal_I2C&quot; library to simplify the communication between the Arduino and the I2C LCD module (PCF8574). The library provides functions like lcd.print(), lcd.setCursor(), lcd.clear(), and more to control the LCD easily.&lt;br /&gt;&lt;br /&gt;Make sure you have connected the SDA and SCL pins of the I2C module to the corresponding pins on your Arduino. Also, don&#39;t forget to provide power and ground connections.&lt;br /&gt;&lt;br /&gt;Before uploading the code to your Arduino, double-check the I2C address of your LCD module. If it&#39;s different from 0x27, update the line #define I2C_ADDR 0x27 with the correct address.&lt;br /&gt;&lt;br /&gt;That&#39;s it! Now you should be able to see the &quot;Hello, World!&quot; message on your 16x2 LCD connected via I2C. Good luck with your project!&lt;/p&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;arduinoeasyproject.blogspot.com&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arduinoeasyproject.blogspot.com/feeds/4266445471022006767/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3996394282062555391/4266445471022006767' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3996394282062555391/posts/default/4266445471022006767'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3996394282062555391/posts/default/4266445471022006767'/><link rel='alternate' type='text/html' href='http://arduinoeasyproject.blogspot.com/2023/08/arduino-coding-for-display-lcd-16x2.html' title=' Arduino coding for display LCD 16x2 using I2C wire'/><author><name>FeHq</name><uri>http://www.blogger.com/profile/11734094429613707887</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5W_bfFF4CY6bGPZ4hxy2v0sFWJbNpaiIaI2TD1eweHyG2vYqKAIKc55CUI7_n9j8wN-n3fCJKxzl_WvnWWZWew8DP2G0XZN9jqSXFp-mg_R8xloeSrKHC_8gpvXnI5I8_L6VUYs4t3YLo4LbFkZ8h50ApAKs-aQgpRax1u7Gj5F6dpZbg3NIRLli03xUt/s72-w200-h184-c/PCF8574_I2C_lcd_16x2.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3996394282062555391.post-7769085503605665093</id><published>2023-03-05T23:06:00.005+07:00</published><updated>2023-03-05T23:06:55.931+07:00</updated><title type='text'>Color sensor calibration TCS 3200</title><content type='html'>&lt;p&gt;Calibrating a color sensor like the TCS 3200 typically involves a few steps to ensure accurate color readings. Here&#39;s a general outline of the calibration process:&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;ol style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Clean the sensor: Before calibrating the sensor, make sure it is free from dust and debris that could affect its readings. Use a clean cloth or compressed air to remove any contaminants from the sensor surface.&lt;/li&gt;&lt;li&gt;Choose a calibration surface: Next, select a surface to use as your calibration target. Ideally, this surface should be a neutral color (e.g. white or gray) and have a matte finish to minimize reflections. You may also want to choose a surface that is representative of the types of colors you&#39;ll be measuring with the sensor.&lt;/li&gt;&lt;li&gt;Measure the target: Place the calibration target under the sensor and measure its color using the sensor&#39;s built-in LEDs. Record the RGB values for the target color.&lt;/li&gt;&lt;li&gt;Calculate correction factors: Compare the measured RGB values to the expected values for the target color, and calculate correction factors to adjust the sensor&#39;s readings. For example, if the sensor consistently reads red as slightly brighter than expected, you could apply a correction factor to decrease the reported red value.&lt;/li&gt;&lt;li&gt;Apply correction factors: Once you have calculated correction factors for each color channel, apply them to the sensor&#39;s readings. You may need to adjust the correction factors over time as the sensor&#39;s performance changes or you encounter different lighting conditions.&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;Note that the exact calibration process may vary depending on your specific sensor and application. Be sure to consult the manufacturer&#39;s documentation for detailed instructions and recommended best practices.&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;http://wiki.sunfounder.cc/images/0/03/TCS3200_1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;250&quot; data-original-width=&quot;327&quot; height=&quot;250&quot; src=&quot;http://wiki.sunfounder.cc/images/0/03/TCS3200_1.jpg&quot; width=&quot;327&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;&lt;b&gt;&lt;u&gt;To calibrate the TCS3200 color sensor, you can follow these steps:&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;ol style=&quot;text-align: left;&quot;&gt;&lt;li&gt;First of all, connect the TCS3200 sensor to the Arduino board and install the basic programming code which will read the colors from the sensor and display them on the serial monitor.&lt;/li&gt;&lt;li&gt;Place the sensor on a white surface, then read the RGB color values on the serial monitor. Make sure the RGB value on white is around (255,255,255). If not, you can adjust the gain value on the sensor to optimize color readability.&lt;/li&gt;&lt;li&gt;After setting the gain, place the sensor on a black surface and read the RGB color values on the serial monitor. Make sure the RGB value on black is around (0,0,0).&lt;/li&gt;&lt;li&gt;After adjusting white and black, you can use other colors for reference such as red, green, blue or other colors. Make sure the resulting RGB value is as expected.&lt;/li&gt;&lt;li&gt;Finally, you can adjust the integration time (INTEG) on the sensor to optimize color rendering. The longer the integration time, the more accurate the color reading results, but the slower the data processing speed. You can try to time the integration from 2,4,8,16, and 32 clock cycles.&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;Here is an example of basic program code to read RGB values on the TCS3200 color sensor:&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;#include &amp;lt;Adafruit_TCS3200.h&amp;gt;&lt;br /&gt;Adafruit_TCS3200 colorSensor(TCS3200_S2, TCS3200_S3, TCS3200_OUT);&lt;br /&gt;void setup() {&lt;br /&gt;&amp;nbsp; Serial.begin(9600);&lt;br /&gt;&amp;nbsp; colorSensor.begin();&lt;br /&gt;}&lt;br /&gt;void loop() {&lt;br /&gt;&amp;nbsp; colorSensor.setResolution(TCS3200_18BIT);&lt;br /&gt;&amp;nbsp; colorSensor.writeRegister(0x00, TCS3200_MEASUREMENT_MODE);&lt;br /&gt;&amp;nbsp; delay(50);&lt;br /&gt;&amp;nbsp; &amp;nbsp;uint16_t red = colorSensor.readRed();&lt;br /&gt;&amp;nbsp; uint16_t green = colorSensor.readGreen();&lt;br /&gt;&amp;nbsp; uint16_t blue = colorSensor.readBlue();&lt;br /&gt;&amp;nbsp; Serial.print(&quot;RGB: &quot;);&lt;br /&gt;&amp;nbsp; Serial.print(red);&lt;br /&gt;&amp;nbsp; Serial.print(&quot; &quot;);&lt;br /&gt;&amp;nbsp; Serial.print(green);&lt;br /&gt;&amp;nbsp; Serial.print(&quot; &quot;);&lt;br /&gt;&amp;nbsp; Serial.println(blue);&lt;br /&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;You can calibrate the sensor by changing the gain and integration time in the following sections:&lt;/span&gt;&lt;/p&gt;&lt;blockquote style=&quot;border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;&quot;&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;colorSensor.setGain(TCS3200_GAIN_1X);&lt;br /&gt;colorSensor.setIntegrationTime(TCS3200_INTEGRATIONTIME_2_4MS);&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;div&gt;&lt;span style=&quot;font-family: times;&quot;&gt;If the color reading results are still not accurate, you can try adjusting the gain and integration time until the resulting RGB values are as expected.&lt;/span&gt;&lt;/div&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;arduinoeasyproject.blogspot.com&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arduinoeasyproject.blogspot.com/feeds/7769085503605665093/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3996394282062555391/7769085503605665093' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3996394282062555391/posts/default/7769085503605665093'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3996394282062555391/posts/default/7769085503605665093'/><link rel='alternate' type='text/html' href='http://arduinoeasyproject.blogspot.com/2023/03/color-sensor-calibration-tcs-3200.html' title='Color sensor calibration TCS 3200'/><author><name>FeHq</name><uri>http://www.blogger.com/profile/11734094429613707887</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3996394282062555391.post-5123711961184460577</id><published>2023-02-06T09:26:00.003+07:00</published><updated>2023-02-06T09:27:24.714+07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Arduino play vocal"/><title type='text'>Arduino code for play vocal</title><content type='html'>&lt;p style=&quot;text-align: justify;&quot;&gt;This code uses the &lt;a href=&quot;https://docs.arduino.cc/learn/built-in-libraries/software-serial&quot; target=&quot;_blank&quot;&gt;SoftwareSerial library&lt;/a&gt; to create a serial communication between the Arduino and a Bluetooth module. The Bluetooth module should be connected to the specified RX and TX pins and set to 9600 baud rate.&lt;br /&gt;&lt;br /&gt;Note that this code is just a basic example and may need modifications depending on the specific setup and requirements.&lt;/p&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;#include &amp;lt;SoftwareSerial.h&amp;gt;&lt;br /&gt;SoftwareSerial mySerial(10, 11); // RX, TX&lt;br /&gt;void setup() {&lt;br /&gt;&amp;nbsp; mySerial.begin(9600);&lt;br /&gt;&amp;nbsp; pinMode(9, OUTPUT);&lt;br /&gt;&amp;nbsp; digitalWrite(9, LOW);&lt;br /&gt;}&lt;br /&gt;void loop() {&lt;br /&gt;&amp;nbsp; if (mySerial.available()) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; digitalWrite(9, HIGH);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; mySerial.write(mySerial.read());&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;}&lt;/span&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;&amp;nbsp;&lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;&amp;nbsp;&lt;/p&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;arduinoeasyproject.blogspot.com&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arduinoeasyproject.blogspot.com/feeds/5123711961184460577/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3996394282062555391/5123711961184460577' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3996394282062555391/posts/default/5123711961184460577'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3996394282062555391/posts/default/5123711961184460577'/><link rel='alternate' type='text/html' href='http://arduinoeasyproject.blogspot.com/2023/02/arduino-code-for-play-vocal.html' title='Arduino code for play vocal'/><author><name>FeHq</name><uri>http://www.blogger.com/profile/11734094429613707887</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3996394282062555391.post-7037162236566603863</id><published>2023-02-02T13:37:00.007+07:00</published><updated>2023-02-02T13:48:57.159+07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Blynk IOT"/><category scheme="http://www.blogger.com/atom/ns#" term="IOT LM35 arduino code"/><category scheme="http://www.blogger.com/atom/ns#" term="IOT temperature logging"/><title type='text'>IOT arduino logging data to web server</title><content type='html'>&lt;p style=&quot;text-align: justify;&quot;&gt;To log data from an Arduino IoT device to a web server, you can follow these general steps:&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Connect the Arduino to the internet, either through Wi-Fi or Ethernet.&lt;/li&gt;&lt;li&gt;Use a library such as the HTTPClient library to make HTTP requests to the server.&lt;/li&gt;&lt;li&gt;Write code to format the data you want to log into a JSON or CSV string.&lt;/li&gt;&lt;li&gt;Send the data as a POST request to a server-side script (e.g. PHP, Python, Node.js) that can receive and store the data in a database.&lt;/li&gt;&lt;li&gt;On the server side, use a database management system such as MySQL or MongoDB to store the data.&lt;/li&gt;&lt;li&gt;Optionally, you can also retrieve the data from the database and display it on a web page.&lt;/li&gt;&lt;/ol&gt;Here is an example of sending data from an Arduino to a server:&lt;p&gt;&lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;#include &amp;lt;WiFi.h&amp;gt;&lt;br /&gt;#include &amp;lt;HTTPClient.h&amp;gt;&lt;br /&gt;&lt;br /&gt;const char* ssid&amp;nbsp; &amp;nbsp; &amp;nbsp;= &quot;your_SSID&quot;;&lt;br /&gt;const char* password = &quot;your_PASSWORD&quot;;&lt;br /&gt;const char* serverName = &quot;your_SERVER_IP_ADDRESS&quot;;&lt;br /&gt;&lt;br /&gt;void setup() {&lt;br /&gt;&amp;nbsp; WiFi.begin(ssid, password);&lt;br /&gt;&amp;nbsp; while (WiFi.status() != WL_CONNECTED) {&lt;br /&gt;&amp;nbsp; &amp;nbsp; delay(1000);&lt;br /&gt;&amp;nbsp; &amp;nbsp; Serial.println(&quot;Connecting to WiFi...&quot;);&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&amp;nbsp; Serial.println(&quot;Connected to WiFi&quot;);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void loop() {&lt;br /&gt;&amp;nbsp; HTTPClient http;&lt;br /&gt;&amp;nbsp; http.begin(&quot;http://&quot; + String(serverName) + &quot;/data&quot;);&lt;br /&gt;&amp;nbsp; http.addHeader(&quot;Content-Type&quot;, &quot;application/json&quot;);&lt;br /&gt;&amp;nbsp; int httpResponseCode = http.POST(&quot;{\&quot;value\&quot;:\&quot;&quot; + String(analogRead(A0)) + &quot;\&quot;}&quot;);&lt;br /&gt;&amp;nbsp; String response = http.getString();&lt;br /&gt;&amp;nbsp; Serial.println(httpResponseCode);&lt;br /&gt;&amp;nbsp; Serial.println(response);&lt;br /&gt;&amp;nbsp; http.end();&lt;br /&gt;&amp;nbsp; delay(10000);&lt;br /&gt;}&lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;u&gt;&lt;b&gt;Here some example to temperature logging by LM35 temperature sensor:&lt;/b&gt;&lt;/u&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;u&gt;&lt;b&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEgKW4lzSJex57Te7MfpNoC8jAr6JlZrgKMvDxvaISEki_7sENbU_HAicbayAmjEC0hiJJUe7Muy09CfDPdiIEROBu00kTEeCEQXL2n8G6JF56RoWwmbKtcB7K71UkCh92V0THmNbdOl9Ss_s5c9Vno5ccDoe89HNiTzjx5bVey3B0ny1WWMdwfGav5KKQ&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;&quot; data-original-height=&quot;195&quot; data-original-width=&quot;225&quot; height=&quot;178&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEgKW4lzSJex57Te7MfpNoC8jAr6JlZrgKMvDxvaISEki_7sENbU_HAicbayAmjEC0hiJJUe7Muy09CfDPdiIEROBu00kTEeCEQXL2n8G6JF56RoWwmbKtcB7K71UkCh92V0THmNbdOl9Ss_s5c9Vno5ccDoe89HNiTzjx5bVey3B0ny1WWMdwfGav5KKQ=w205-h178&quot; width=&quot;205&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/b&gt;&lt;/u&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Here is an example of how you could log temperature data from an LM35 temperature sensor connected to an Arduino to a web server:&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;#include &amp;lt;WiFi.h&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;#include &amp;lt;HTTPClient.h&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;const char* ssid&amp;nbsp; &amp;nbsp; &amp;nbsp;= &quot;your_SSID&quot;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;const char* password = &quot;your_PASSWORD&quot;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;const char* serverName = &quot;your_SERVER_IP_ADDRESS&quot;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;const int temperaturePin = A0;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;void setup() {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; WiFi.begin(ssid, password);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; while (WiFi.status() != WL_CONNECTED) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; delay(1000);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; Serial.println(&quot;Connecting to WiFi...&quot;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; Serial.println(&quot;Connected to WiFi&quot;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; pinMode(temperaturePin, INPUT);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;void loop() {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; int reading = analogRead(temperaturePin);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; float voltage = reading * 5.0 / 1024;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; float temperature = (voltage - 0.5) * 100;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; HTTPClient http;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; http.begin(&quot;http://&quot; + String(serverName) + &quot;/data&quot;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; http.addHeader(&quot;Content-Type&quot;, &quot;application/json&quot;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; int httpResponseCode = http.POST(&quot;{\&quot;temperature\&quot;:\&quot;&quot; + String(temperature) + &quot;\&quot;}&quot;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; String response = http.getString();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; Serial.println(httpResponseCode);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; Serial.println(response);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; http.end();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; delay(10000);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;This code connects to a Wi-Fi network using the WiFi.begin method and waits until the connection is established. The pinMode method is used to set the pin connected to the LM35 to INPUT mode. In the loop function, the code reads the analog value from the LM35, converts it to a temperature value, and then sends a POST request to the server containing the temperature data in JSON format. The server&#39;s response is printed to the serial monitor for debugging purposes.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Here is an example of how you could log temperature data from an LM35 temperature sensor connected to an Arduino to the Blynk cloud platform:&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;#include &amp;lt;WiFi.h&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;#include &amp;lt;BlynkSimpleEsp32.h&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;char auth[] = &quot;your_BLYNK_AUTH_TOKEN&quot;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;char ssid[] = &quot;your_SSID&quot;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;char pass[] = &quot;your_PASSWORD&quot;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;const int temperaturePin = A0;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;void setup() {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; WiFi.begin(ssid, pass);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; while (WiFi.status() != WL_CONNECTED) {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; delay(1000);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; &amp;nbsp; Serial.println(&quot;Connecting to WiFi...&quot;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; Serial.println(&quot;Connected to WiFi&quot;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; Blynk.begin(auth, ssid, pass);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; pinMode(temperaturePin, INPUT);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;void loop() {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; int reading = analogRead(temperaturePin);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; float voltage = reading * 5.0 / 1024;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; float temperature = (voltage - 0.5) * 100;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; Blynk.virtualWrite(V0, temperature);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&amp;nbsp; delay(1000);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;This code connects to a Wi-Fi network using the WiFi.begin method and waits until the connection is established. The Blynk.begin method is used to initialize the Blynk library with the auth token and the Wi-Fi credentials. The pinMode method is used to set the pin connected to the LM35 to INPUT mode. In the loop function, the code reads the analog value from the LM35, converts it to a temperature value, and then sends the temperature data to Blynk&#39;s virtual pin 0 using the Blynk.virtualWrite method. The data can be displayed in a Blynk app using various widgets such as a gauge or a chart.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;arduinoeasyproject.blogspot.com&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arduinoeasyproject.blogspot.com/feeds/7037162236566603863/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3996394282062555391/7037162236566603863' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3996394282062555391/posts/default/7037162236566603863'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3996394282062555391/posts/default/7037162236566603863'/><link rel='alternate' type='text/html' href='http://arduinoeasyproject.blogspot.com/2023/02/iot-arduino-logging-data-to-web-server.html' title='IOT arduino logging data to web server'/><author><name>FeHq</name><uri>http://www.blogger.com/profile/11734094429613707887</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/a/AVvXsEgKW4lzSJex57Te7MfpNoC8jAr6JlZrgKMvDxvaISEki_7sENbU_HAicbayAmjEC0hiJJUe7Muy09CfDPdiIEROBu00kTEeCEQXL2n8G6JF56RoWwmbKtcB7K71UkCh92V0THmNbdOl9Ss_s5c9Vno5ccDoe89HNiTzjx5bVey3B0ny1WWMdwfGav5KKQ=s72-w205-h178-c" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3996394282062555391.post-3123314948901770284</id><published>2023-01-19T07:04:00.001+07:00</published><updated>2023-01-19T07:04:05.235+07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Digital Clock Arduino"/><title type='text'>Arduino circuit for digital clock and Coding</title><content type='html'>&lt;p style=&quot;text-align: justify;&quot;&gt;An Arduino circuit for a digital clock can be created using an Arduino board, a 16x2 LCD display, a real-time clock module, and a few passive components such as resistors and a capacitor. The real-time clock module, such as the DS1307, provides the timekeeping functionality, while the LCD display is used to display the current time. The Arduino board is used to control the LCD and interface with the real-time clock module. A simple circuit diagram could be:&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;Arduino ------------------------- LCD&lt;br /&gt;|&lt;br /&gt;|&lt;br /&gt;R1,R2&lt;br /&gt;|&lt;br /&gt;|&lt;br /&gt;DS1307&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://simple-circuit.com/wp-content/uploads/2017/11/arduino-ds1307-rtc-with-lcd-and-set-buttons-circuit.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;399&quot; data-original-width=&quot;800&quot; height=&quot;320&quot; src=&quot;https://simple-circuit.com/wp-content/uploads/2017/11/arduino-ds1307-rtc-with-lcd-and-set-buttons-circuit.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;i&gt;&lt;u&gt;&lt;b&gt;Arduino oding for clock display&lt;/b&gt;&lt;/u&gt;&lt;/i&gt;&lt;br /&gt;Here is an example of Arduino code for displaying the current time on an LCD using a real-time clock module:&lt;br /&gt;&lt;br /&gt;Copy code&lt;br /&gt;#include &amp;lt;Wire.h&amp;gt;&lt;br /&gt;#include &amp;lt;LiquidCrystal_I2C.h&amp;gt;&lt;br /&gt;#include &amp;lt;RTClib.h&amp;gt;&lt;br /&gt;&lt;br /&gt;RTC_DS1307 rtc;&lt;br /&gt;LiquidCrystal_I2C lcd(0x27, 16, 2);&lt;br /&gt;&lt;br /&gt;void setup() {&lt;br /&gt;&amp;nbsp; lcd.begin();&lt;br /&gt;&amp;nbsp; lcd.backlight();&lt;br /&gt;&amp;nbsp; rtc.begin();&lt;br /&gt;&amp;nbsp; if (!rtc.isrunning()) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; lcd.print(&quot;RTC is NOT running!&quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // following line sets the RTC to the date &amp;amp; time this sketch was compiled&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void loop() {&lt;br /&gt;&amp;nbsp; DateTime now = rtc.now();&lt;br /&gt;&amp;nbsp; lcd.setCursor(0, 0);&lt;br /&gt;&amp;nbsp; lcd.print(now.hour(), DEC);&lt;br /&gt;&amp;nbsp; lcd.print(&#39;:&#39;);&lt;br /&gt;&amp;nbsp; lcd.print(now.minute(), DEC);&lt;br /&gt;&amp;nbsp; lcd.print(&#39;:&#39;);&lt;br /&gt;&amp;nbsp; lcd.print(now.second(), DEC);&lt;br /&gt;&amp;nbsp; lcd.setCursor(0, 1);&lt;br /&gt;&amp;nbsp; lcd.print(now.day(), DEC);&lt;br /&gt;&amp;nbsp; lcd.print(&#39;/&#39;);&lt;br /&gt;&amp;nbsp; lcd.print(now.month(), DEC);&lt;br /&gt;&amp;nbsp; lcd.print(&#39;/&#39;);&lt;br /&gt;&amp;nbsp; lcd.print(now.year(), DEC);&lt;br /&gt;&amp;nbsp; delay(1000);&lt;br /&gt;}&lt;br /&gt;&amp;nbsp;&lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;This code uses the Wire and RTClib libraries to interface with the real-time clock module. The LiquidCrystal_I2C library is used to control the LCD display. The code first checks if the real-time clock is running, and sets the time if it is not. Then, in the loop, it continuously updates the LCD display with the current time and date retrieved from the real-time clock.&lt;br /&gt;&lt;br /&gt;Note: in the code above, you can see that the I2C address of the LCD is 0x27, if it&#39;s different for you, you need to change that to the correct one.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;arduinoeasyproject.blogspot.com&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arduinoeasyproject.blogspot.com/feeds/3123314948901770284/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3996394282062555391/3123314948901770284' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3996394282062555391/posts/default/3123314948901770284'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3996394282062555391/posts/default/3123314948901770284'/><link rel='alternate' type='text/html' href='http://arduinoeasyproject.blogspot.com/2023/01/arduino-circuit-for-digital-clock-and.html' title='Arduino circuit for digital clock and Coding'/><author><name>FeHq</name><uri>http://www.blogger.com/profile/11734094429613707887</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3996394282062555391.post-4404193072201473849</id><published>2023-01-19T06:55:00.004+07:00</published><updated>2023-01-19T06:56:05.285+07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Kalman Filter"/><title type='text'>KALMAN FILTER IN ARDUINO without Header file kalman.h</title><content type='html'>&lt;p style=&quot;text-align: justify;&quot;&gt;This is a basic Kalman filter that uses a constant measurement noise and process noise. You can adjust these values to fine-tune the filter for your specific application. The filter takes a measurement (z_measured) and uses it to estimate the real value (z_real). The estimated value is then updated with each new measurement.&lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;#define MEASUREMENT_NOISE 0.1&lt;br /&gt;#define PROCESS_NOISE 0.05&lt;br /&gt;&lt;br /&gt;double x_est_last = 0;&lt;br /&gt;double P_last = 0;&lt;br /&gt;double K;&lt;br /&gt;double P;&lt;br /&gt;double x_temp_est;&lt;br /&gt;double x_est;&lt;br /&gt;double z_measured = 0; // the measured value&lt;br /&gt;double z_real = 0; // the real value&lt;br /&gt;&lt;br /&gt;void KalmanFilter()&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; x_temp_est = x_est_last;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; P = P_last + PROCESS_NOISE;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; K = P / (P + MEASUREMENT_NOISE);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; x_est = x_temp_est + K * (z_measured - x_temp_est);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; P = (1 - K) * P;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; x_est_last = x_est;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; P_last = P;&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;&lt;/p&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://cdn.imgbin.com/12/24/21/imgbin-simultaneous-localization-and-mapping-autonomous-underwater-vehicle-robotics-technology-extended-kalman-filter-robotics-B7pjZtXfL3DLMBjvEwyJAxrkx.jpg&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;707&quot; data-original-width=&quot;728&quot; height=&quot;388&quot; src=&quot;https://cdn.imgbin.com/12/24/21/imgbin-simultaneous-localization-and-mapping-autonomous-underwater-vehicle-robotics-technology-extended-kalman-filter-robotics-B7pjZtXfL3DLMBjvEwyJAxrkx.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&amp;nbsp;&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;arduinoeasyproject.blogspot.com&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arduinoeasyproject.blogspot.com/feeds/4404193072201473849/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3996394282062555391/4404193072201473849' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3996394282062555391/posts/default/4404193072201473849'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3996394282062555391/posts/default/4404193072201473849'/><link rel='alternate' type='text/html' href='http://arduinoeasyproject.blogspot.com/2023/01/kalman-filter-in-arduino-without-header.html' title='KALMAN FILTER IN ARDUINO without Header file kalman.h'/><author><name>FeHq</name><uri>http://www.blogger.com/profile/11734094429613707887</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3996394282062555391.post-7314971871042236543</id><published>2023-01-17T09:25:00.005+07:00</published><updated>2023-01-17T09:34:28.893+07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Kalman Filter"/><title type='text'>Arduino Code for Kalman Filter</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;The Kalman filter is a mathematical algorithm that uses a series of measurements observed over time, containing noise (random variations) and other inaccuracies, and produces estimates of unknown variables that tend to be more accurate than those based on a single measurement alone. It is used in a wide range of applications, including signal processing, control systems, and navigation.&lt;br /&gt;&lt;br /&gt;The filter is named after its inventor, Rudolf Kalman, who first described it in a paper published in 1960. It is based on a series of mathematical equations that describe how the variables of interest (such as the position and velocity of an object) evolve over time, and how these variables are related to the measurements that are being made. The filter uses these equations to estimate the values of the variables based on the measurements, and then updates these estimates as new measurements become available.&lt;br /&gt;&lt;br /&gt;The Kalman filter is particularly useful in systems where the variables of interest are subject to random variations (noise) and other inaccuracies, and where the measurements are also subject to similar errors. The filter is able to take into account the uncertainty in the measurements and the system dynamics, and produce estimates that are optimal in some sense (e.g., minimum variance).&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;b&gt;&lt;i&gt;&lt;u&gt;Case Study&lt;/u&gt;&lt;/i&gt;&lt;/b&gt;&lt;/p&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;The LM35 is a precision temperature sensor that can be used to measure temperature in degrees Celsius. It can be used in conjunction with a Kalman filter to filter out noise and provide a more accurate temperature reading. Here is an example circuit for using an LM35 with a Kalman filter on an Arduino:&lt;/div&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;#include &amp;lt;Kalman.h&amp;gt;&lt;br /&gt;&lt;br /&gt;Kalman kalman;&lt;br /&gt;int lm35Pin = A0; // The pin the LM35 is connected to&lt;br /&gt;double temperature;&lt;br /&gt;double filteredTemperature;&lt;br /&gt;&lt;br /&gt;void setup() {&lt;br /&gt;&amp;nbsp; Serial.begin(9600);&lt;br /&gt;&amp;nbsp; kalman.setMeasurementNoise(0.1); &lt;span style=&quot;font-size: x-small;&quot;&gt;// Set the measurement noise variance&lt;/span&gt;&lt;br /&gt;&amp;nbsp; kalman.setProcessNoise(0.01); &lt;span style=&quot;font-size: x-small;&quot;&gt;// Set the process noise variance&lt;/span&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void loop() {&lt;br /&gt;&amp;nbsp; temperature = analogRead(lm35Pin) * 0.48828125; &lt;span style=&quot;font-size: x-small;&quot;&gt;// Read the LM35 and convert to degrees Celsius&lt;/span&gt;&lt;br /&gt;&amp;nbsp; filteredTemperature = kalman.updateEstimate(temperature);&lt;span style=&quot;font-size: x-small;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;// Update the filtered temperature estimate&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &lt;/span&gt;&lt;br /&gt;&amp;nbsp; Serial.print(&quot;Temperature: &quot;);&lt;br /&gt;&amp;nbsp; Serial.print(temperature);&lt;br /&gt;&amp;nbsp; Serial.print(&quot;\tFiltered Temperature: &quot;);&lt;br /&gt;&amp;nbsp; Serial.println(filteredTemperature);&lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp; delay(100);&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;In this example, the LM35 is connected to pin A0 on the Arduino, and the analogRead() function is used to read the voltage output of the LM35. The voltage is then converted to temperature in degrees Celsius using the LM35&#39;s voltage-to-temperature conversion factor.&lt;br /&gt;&lt;br /&gt;The Kalman filter is used to filter out noise in the temperature measurement by updating the estimate of the temperature with the new measurement and the previous estimate.&lt;br /&gt;&lt;br /&gt;You should adjust the measurement noise and process noise variance to match your system&#39;s characteristics and specific requirements.&lt;br /&gt;&lt;br /&gt;It&#39;s important to note that the example code is for illustrative purposes only and may need to be modified to work with your specific hardware and application.&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;Here another Example Code&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;===========================================================&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;#include &amp;lt;Kalman.h&amp;gt;&lt;br /&gt;&lt;br /&gt;Kalman kalmanX; // Create Kalman filter objects&lt;br /&gt;Kalman kalmanY;&lt;br /&gt;&lt;br /&gt;double x = 0; // Set initial values&lt;br /&gt;double y = 0;&lt;br /&gt;double dx, dy;&lt;br /&gt;&lt;br /&gt;void setup() {&lt;br /&gt;&amp;nbsp; Serial.begin(9600);&lt;br /&gt;&lt;br /&gt;&amp;nbsp; // Set the measurement noise variance for each filter&lt;br /&gt;&amp;nbsp; kalmanX.setMeasurementNoise(1);&lt;br /&gt;&amp;nbsp; kalmanY.setMeasurementNoise(1);&lt;br /&gt;&lt;br /&gt;&amp;nbsp; // Set the process noise variance for each filter&lt;br /&gt;&amp;nbsp; kalmanX.setProcessNoise(0.01);&lt;br /&gt;&amp;nbsp; kalmanY.setProcessNoise(0.01);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;void loop() {&lt;br /&gt;&amp;nbsp; x = kalmanX.updateEstimate(x + dx); // Update the estimate for x&lt;br /&gt;&amp;nbsp; y = kalmanY.updateEstimate(y + dy); // Update the estimate for y&lt;br /&gt;&lt;br /&gt;&amp;nbsp; Serial.print(&quot;X: &quot;);&lt;br /&gt;&amp;nbsp; Serial.print(x);&lt;br /&gt;&amp;nbsp; Serial.print(&quot;\tY: &quot;);&lt;br /&gt;&amp;nbsp; Serial.println(y);&lt;br /&gt;&lt;br /&gt;&amp;nbsp; delay(100);&lt;br /&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;arduinoeasyproject.blogspot.com&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arduinoeasyproject.blogspot.com/feeds/7314971871042236543/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3996394282062555391/7314971871042236543' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3996394282062555391/posts/default/7314971871042236543'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3996394282062555391/posts/default/7314971871042236543'/><link rel='alternate' type='text/html' href='http://arduinoeasyproject.blogspot.com/2023/01/arduino-code-for-kalman-filter.html' title='Arduino Code for Kalman Filter'/><author><name>FeHq</name><uri>http://www.blogger.com/profile/11734094429613707887</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3996394282062555391.post-3300015571562046565</id><published>2022-03-19T21:35:00.007+07:00</published><updated>2023-02-06T09:22:58.102+07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="How to drive mosfet"/><category scheme="http://www.blogger.com/atom/ns#" term="Mosfet"/><title type='text'>How to Drive MOSFET with ARDUINO </title><content type='html'>&lt;table class=&quot;highlight tab-size js-file-line-container js-code-nav-container js-tagsearch-file&quot; data-paste-markdown-skip=&quot;&quot; data-tab-size=&quot;8&quot; data-tagsearch-lang=&quot;C++&quot; data-tagsearch-path=&quot;Fading.ino&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;blob-code blob-code-inner js-file-line&quot; id=&quot;LC1&quot;&gt;&lt;span class=&quot;pl-c&quot;&gt;This is example how to drive Mosfet using arduino, port to drive is port 9 as PWM can send data from 0 to 255 as analog voltage from 0 to 5V.&lt;br /&gt;Video example at :&amp;nbsp;&lt;a href=&quot;https://youtu.be/-zfrnw4Iwpg&quot;&gt;https://youtu.be/-zfrnw4Iwpg&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*&lt;/span&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEi1T3XAYaeuig14J5BU0UREOnoVe3jeaRYVRWC0GnW0gq14svvjO50JVkCn-qy-Xgjy5OABc2N2bci4N2qc9jsADikTLic7sI5i54lp1QR62jq8TSGpTqP57zV70MdZ8dASWJqes0dgbHiXk83SyIvSODDYdFOhL8uUeJfAiBsWNJUyMcHlpXciZ3FLwA=s1053&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;648&quot; data-original-width=&quot;1053&quot; height=&quot;246&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEi1T3XAYaeuig14J5BU0UREOnoVe3jeaRYVRWC0GnW0gq14svvjO50JVkCn-qy-Xgjy5OABc2N2bci4N2qc9jsADikTLic7sI5i54lp1QR62jq8TSGpTqP57zV70MdZ8dASWJqes0dgbHiXk83SyIvSODDYdFOhL8uUeJfAiBsWNJUyMcHlpXciZ3FLwA=w400-h246&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;table class=&quot;highlight tab-size js-file-line-container js-code-nav-container js-tagsearch-file&quot; data-paste-markdown-skip=&quot;&quot; data-tab-size=&quot;8&quot; data-tagsearch-lang=&quot;C++&quot; data-tagsearch-path=&quot;Fading.ino&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;blob-code blob-code-inner js-file-line&quot; id=&quot;LC2&quot;&gt;&lt;span class=&quot;pl-c&quot;&gt;  Fading&lt;/span&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;table class=&quot;highlight tab-size js-file-line-container js-code-nav-container js-tagsearch-file&quot; data-paste-markdown-skip=&quot;&quot; data-tab-size=&quot;8&quot; data-tagsearch-lang=&quot;C++&quot; data-tagsearch-path=&quot;Fading.ino&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;blob-code blob-code-inner js-file-line&quot; id=&quot;LC3&quot;&gt;&lt;span class=&quot;pl-c&quot;&gt;  This example shows how to fade an LED using the analogWrite() function.&lt;/span&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;table class=&quot;highlight tab-size js-file-line-container js-code-nav-container js-tagsearch-file&quot; data-paste-markdown-skip=&quot;&quot; data-tab-size=&quot;8&quot; data-tagsearch-lang=&quot;C++&quot; data-tagsearch-path=&quot;Fading.ino&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;blob-code blob-code-inner js-file-line&quot; id=&quot;LC4&quot;&gt;&lt;span class=&quot;pl-c&quot;&gt;  The circuit:&lt;/span&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;(modified)&lt;table class=&quot;highlight tab-size js-file-line-container js-code-nav-container js-tagsearch-file&quot; data-paste-markdown-skip=&quot;&quot; data-tab-size=&quot;8&quot; data-tagsearch-lang=&quot;C++&quot; data-tagsearch-path=&quot;Fading.ino&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;blob-code blob-code-inner js-file-line&quot; id=&quot;LC5&quot;&gt;&lt;span class=&quot;pl-c&quot;&gt;  - GATE MOSFET attached from digital pin 9 to&amp;nbsp; through 100 ohm resistor.&lt;/span&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&amp;nbsp;&lt;table class=&quot;highlight tab-size js-file-line-container js-code-nav-container js-tagsearch-file&quot; data-paste-markdown-skip=&quot;&quot; data-tab-size=&quot;8&quot; data-tagsearch-lang=&quot;C++&quot; data-tagsearch-path=&quot;Fading.ino&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;blob-code blob-code-inner js-file-line&quot; id=&quot;LC6&quot;&gt;&lt;span class=&quot;pl-c&quot;&gt;&lt;/span&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;table class=&quot;highlight tab-size js-file-line-container js-code-nav-container js-tagsearch-file&quot; data-paste-markdown-skip=&quot;&quot; data-tab-size=&quot;8&quot; data-tagsearch-lang=&quot;C++&quot; data-tagsearch-path=&quot;Fading.ino&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;blob-code blob-code-inner js-file-line&quot; id=&quot;LC7&quot;&gt;&lt;span class=&quot;pl-c&quot;&gt;  created 1 Nov 2008&lt;/span&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;table class=&quot;highlight tab-size js-file-line-container js-code-nav-container js-tagsearch-file&quot; data-paste-markdown-skip=&quot;&quot; data-tab-size=&quot;8&quot; data-tagsearch-lang=&quot;C++&quot; data-tagsearch-path=&quot;Fading.ino&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;blob-code blob-code-inner js-file-line&quot; id=&quot;LC8&quot;&gt;&lt;span class=&quot;pl-c&quot;&gt;  by David A. Mellis&lt;/span&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;table class=&quot;highlight tab-size js-file-line-container js-code-nav-container js-tagsearch-file&quot; data-paste-markdown-skip=&quot;&quot; data-tab-size=&quot;8&quot; data-tagsearch-lang=&quot;C++&quot; data-tagsearch-path=&quot;Fading.ino&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;blob-code blob-code-inner js-file-line&quot; id=&quot;LC9&quot;&gt;&lt;span class=&quot;pl-c&quot;&gt;  modified 30 Aug 2011&lt;/span&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;table class=&quot;highlight tab-size js-file-line-container js-code-nav-container js-tagsearch-file&quot; data-paste-markdown-skip=&quot;&quot; data-tab-size=&quot;8&quot; data-tagsearch-lang=&quot;C++&quot; data-tagsearch-path=&quot;Fading.ino&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;blob-code blob-code-inner js-file-line&quot; id=&quot;LC10&quot;&gt;&lt;span class=&quot;pl-c&quot;&gt;  by Tom Igoe&lt;/span&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;table class=&quot;highlight tab-size js-file-line-container js-code-nav-container js-tagsearch-file&quot; data-paste-markdown-skip=&quot;&quot; data-tab-size=&quot;8&quot; data-tagsearch-lang=&quot;C++&quot; data-tagsearch-path=&quot;Fading.ino&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;blob-code blob-code-inner js-file-line&quot; id=&quot;LC11&quot;&gt;&lt;span class=&quot;pl-c&quot;&gt;&lt;/span&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;table class=&quot;highlight tab-size js-file-line-container js-code-nav-container js-tagsearch-file&quot; data-paste-markdown-skip=&quot;&quot; data-tab-size=&quot;8&quot; data-tagsearch-lang=&quot;C++&quot; data-tagsearch-path=&quot;Fading.ino&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;blob-code blob-code-inner js-file-line&quot; id=&quot;LC12&quot;&gt;&lt;span class=&quot;pl-c&quot;&gt;  This example code is in the public domain.&lt;/span&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;table class=&quot;highlight tab-size js-file-line-container js-code-nav-container js-tagsearch-file&quot; data-paste-markdown-skip=&quot;&quot; data-tab-size=&quot;8&quot; data-tagsearch-lang=&quot;C++&quot; data-tagsearch-path=&quot;Fading.ino&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;blob-code blob-code-inner js-file-line&quot; id=&quot;LC13&quot;&gt;&lt;span class=&quot;pl-c&quot;&gt;&lt;/span&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;table class=&quot;highlight tab-size js-file-line-container js-code-nav-container js-tagsearch-file&quot; data-paste-markdown-skip=&quot;&quot; data-tab-size=&quot;8&quot; data-tagsearch-lang=&quot;C++&quot; data-tagsearch-path=&quot;Fading.ino&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;blob-code blob-code-inner js-file-line&quot; id=&quot;LC14&quot;&gt;&lt;span class=&quot;pl-c&quot;&gt;  https://www.arduino.cc/en/Tutorial/BuiltInExamples/Fading&lt;/span&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;table class=&quot;highlight tab-size js-file-line-container js-code-nav-container js-tagsearch-file&quot; data-paste-markdown-skip=&quot;&quot; data-tab-size=&quot;8&quot; data-tagsearch-lang=&quot;C++&quot; data-tagsearch-path=&quot;Fading.ino&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;blob-code blob-code-inner js-file-line&quot; id=&quot;LC15&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;span class=&quot;pl-c&quot;&gt;*/&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;table class=&quot;highlight tab-size js-file-line-container js-code-nav-container js-tagsearch-file&quot; data-paste-markdown-skip=&quot;&quot; data-tab-size=&quot;8&quot; data-tagsearch-lang=&quot;C++&quot; data-tagsearch-path=&quot;Fading.ino&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;blob-code blob-code-inner js-file-line&quot; id=&quot;LC16&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;table class=&quot;highlight tab-size js-file-line-container js-code-nav-container js-tagsearch-file&quot; data-paste-markdown-skip=&quot;&quot; data-tab-size=&quot;8&quot; data-tagsearch-lang=&quot;C++&quot; data-tagsearch-path=&quot;Fading.ino&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;blob-code blob-code-inner js-file-line&quot; id=&quot;LC17&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;span class=&quot;pl-k&quot;&gt;int&lt;/span&gt; ledPin = &lt;span class=&quot;pl-c1&quot;&gt;9&lt;/span&gt;;    &lt;span class=&quot;pl-c&quot;&gt;&lt;span class=&quot;pl-c&quot;&gt;//&lt;/span&gt; LED connected to digital pin 9&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;table class=&quot;highlight tab-size js-file-line-container js-code-nav-container js-tagsearch-file&quot; data-paste-markdown-skip=&quot;&quot; data-tab-size=&quot;8&quot; data-tagsearch-lang=&quot;C++&quot; data-tagsearch-path=&quot;Fading.ino&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;blob-code blob-code-inner js-file-line&quot; id=&quot;LC18&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;table class=&quot;highlight tab-size js-file-line-container js-code-nav-container js-tagsearch-file&quot; data-paste-markdown-skip=&quot;&quot; data-tab-size=&quot;8&quot; data-tagsearch-lang=&quot;C++&quot; data-tagsearch-path=&quot;Fading.ino&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;blob-code blob-code-inner js-file-line&quot; id=&quot;LC19&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;span class=&quot;pl-k&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;pl-en&quot;&gt;setup&lt;/span&gt;() {&lt;/span&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;table class=&quot;highlight tab-size js-file-line-container js-code-nav-container js-tagsearch-file&quot; data-paste-markdown-skip=&quot;&quot; data-tab-size=&quot;8&quot; data-tagsearch-lang=&quot;C++&quot; data-tagsearch-path=&quot;Fading.ino&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;blob-code blob-code-inner js-file-line&quot; id=&quot;LC20&quot;&gt;  &lt;span style=&quot;font-family: courier;&quot;&gt;&lt;span class=&quot;pl-c&quot;&gt;&lt;span class=&quot;pl-c&quot;&gt;//&lt;/span&gt; nothing happens in setup&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;table class=&quot;highlight tab-size js-file-line-container js-code-nav-container js-tagsearch-file&quot; data-paste-markdown-skip=&quot;&quot; data-tab-size=&quot;8&quot; data-tagsearch-lang=&quot;C++&quot; data-tagsearch-path=&quot;Fading.ino&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;blob-code blob-code-inner js-file-line&quot; id=&quot;LC21&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;}&lt;/span&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;table class=&quot;highlight tab-size js-file-line-container js-code-nav-container js-tagsearch-file&quot; data-paste-markdown-skip=&quot;&quot; data-tab-size=&quot;8&quot; data-tagsearch-lang=&quot;C++&quot; data-tagsearch-path=&quot;Fading.ino&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;blob-code blob-code-inner js-file-line&quot; id=&quot;LC22&quot;&gt;
&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;table class=&quot;highlight tab-size js-file-line-container js-code-nav-container js-tagsearch-file&quot; data-paste-markdown-skip=&quot;&quot; data-tab-size=&quot;8&quot; data-tagsearch-lang=&quot;C++&quot; data-tagsearch-path=&quot;Fading.ino&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;blob-code blob-code-inner js-file-line&quot; id=&quot;LC23&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;span class=&quot;pl-k&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;pl-en&quot;&gt;loop&lt;/span&gt;() {&lt;/span&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;table class=&quot;highlight tab-size js-file-line-container js-code-nav-container js-tagsearch-file&quot; data-paste-markdown-skip=&quot;&quot; data-tab-size=&quot;8&quot; data-tagsearch-lang=&quot;C++&quot; data-tagsearch-path=&quot;Fading.ino&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;blob-code blob-code-inner js-file-line&quot; id=&quot;LC24&quot;&gt;  &lt;span style=&quot;font-family: courier;&quot;&gt;&lt;span class=&quot;pl-c&quot;&gt;&lt;span class=&quot;pl-c&quot;&gt;//&lt;/span&gt; fade in from min to max in increments of 5 points:&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;table class=&quot;highlight tab-size js-file-line-container js-code-nav-container js-tagsearch-file&quot; data-paste-markdown-skip=&quot;&quot; data-tab-size=&quot;8&quot; data-tagsearch-lang=&quot;C++&quot; data-tagsearch-path=&quot;Fading.ino&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;blob-code blob-code-inner js-file-line&quot; id=&quot;LC25&quot;&gt;  &lt;span style=&quot;font-family: courier;&quot;&gt;&lt;span class=&quot;pl-k&quot;&gt;for&lt;/span&gt; (&lt;span class=&quot;pl-k&quot;&gt;int&lt;/span&gt; fadeValue = &lt;span class=&quot;pl-c1&quot;&gt;0&lt;/span&gt; ; fadeValue &amp;lt;= &lt;span class=&quot;pl-c1&quot;&gt;255&lt;/span&gt;; fadeValue += &lt;span class=&quot;pl-c1&quot;&gt;5&lt;/span&gt;) {&lt;/span&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;table class=&quot;highlight tab-size js-file-line-container js-code-nav-container js-tagsearch-file&quot; data-paste-markdown-skip=&quot;&quot; data-tab-size=&quot;8&quot; data-tagsearch-lang=&quot;C++&quot; data-tagsearch-path=&quot;Fading.ino&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;blob-code blob-code-inner js-file-line&quot; id=&quot;LC26&quot;&gt;    &lt;span style=&quot;font-family: courier;&quot;&gt;&lt;span class=&quot;pl-c&quot;&gt;&lt;span class=&quot;pl-c&quot;&gt;//&lt;/span&gt; sets the value (range from 0 to 255):&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;table class=&quot;highlight tab-size js-file-line-container js-code-nav-container js-tagsearch-file&quot; data-paste-markdown-skip=&quot;&quot; data-tab-size=&quot;8&quot; data-tagsearch-lang=&quot;C++&quot; data-tagsearch-path=&quot;Fading.ino&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;blob-code blob-code-inner js-file-line&quot; id=&quot;LC27&quot;&gt;    &lt;span style=&quot;font-family: courier;&quot;&gt;&lt;span class=&quot;pl-c1&quot;&gt;analogWrite&lt;/span&gt;(ledPin, fadeValue);&lt;/span&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;table class=&quot;highlight tab-size js-file-line-container js-code-nav-container js-tagsearch-file&quot; data-paste-markdown-skip=&quot;&quot; data-tab-size=&quot;8&quot; data-tagsearch-lang=&quot;C++&quot; data-tagsearch-path=&quot;Fading.ino&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;blob-code blob-code-inner js-file-line&quot; id=&quot;LC28&quot;&gt;    &lt;span style=&quot;font-family: courier;&quot;&gt;&lt;span class=&quot;pl-c&quot;&gt;&lt;span class=&quot;pl-c&quot;&gt;//&lt;/span&gt; wait for 30 milliseconds to see the dimming effect&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;table class=&quot;highlight tab-size js-file-line-container js-code-nav-container js-tagsearch-file&quot; data-paste-markdown-skip=&quot;&quot; data-tab-size=&quot;8&quot; data-tagsearch-lang=&quot;C++&quot; data-tagsearch-path=&quot;Fading.ino&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;blob-code blob-code-inner js-file-line&quot; id=&quot;LC29&quot;&gt;    &lt;span style=&quot;font-family: courier;&quot;&gt;&lt;span class=&quot;pl-c1&quot;&gt;delay&lt;/span&gt;(&lt;span class=&quot;pl-c1&quot;&gt;30&lt;/span&gt;);&lt;/span&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;table class=&quot;highlight tab-size js-file-line-container js-code-nav-container js-tagsearch-file&quot; data-paste-markdown-skip=&quot;&quot; data-tab-size=&quot;8&quot; data-tagsearch-lang=&quot;C++&quot; data-tagsearch-path=&quot;Fading.ino&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;blob-code blob-code-inner js-file-line&quot; id=&quot;LC30&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;  }&lt;/span&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;table class=&quot;highlight tab-size js-file-line-container js-code-nav-container js-tagsearch-file&quot; data-paste-markdown-skip=&quot;&quot; data-tab-size=&quot;8&quot; data-tagsearch-lang=&quot;C++&quot; data-tagsearch-path=&quot;Fading.ino&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;blob-code blob-code-inner js-file-line&quot; id=&quot;LC31&quot;&gt;
&lt;span style=&quot;font-family: courier;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;table class=&quot;highlight tab-size js-file-line-container js-code-nav-container js-tagsearch-file&quot; data-paste-markdown-skip=&quot;&quot; data-tab-size=&quot;8&quot; data-tagsearch-lang=&quot;C++&quot; data-tagsearch-path=&quot;Fading.ino&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;blob-code blob-code-inner js-file-line&quot; id=&quot;LC32&quot;&gt;  &lt;span style=&quot;font-family: courier;&quot;&gt;&lt;span class=&quot;pl-c&quot;&gt;&lt;span class=&quot;pl-c&quot;&gt;//&lt;/span&gt; fade out from max to min in increments of 5 points:&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;table class=&quot;highlight tab-size js-file-line-container js-code-nav-container js-tagsearch-file&quot; data-paste-markdown-skip=&quot;&quot; data-tab-size=&quot;8&quot; data-tagsearch-lang=&quot;C++&quot; data-tagsearch-path=&quot;Fading.ino&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;blob-code blob-code-inner js-file-line&quot; id=&quot;LC33&quot;&gt;  &lt;span style=&quot;font-family: courier;&quot;&gt;&lt;span class=&quot;pl-k&quot;&gt;for&lt;/span&gt; (&lt;span class=&quot;pl-k&quot;&gt;int&lt;/span&gt; fadeValue = &lt;span class=&quot;pl-c1&quot;&gt;255&lt;/span&gt; ; fadeValue &amp;gt;= &lt;span class=&quot;pl-c1&quot;&gt;0&lt;/span&gt;; fadeValue -= &lt;span class=&quot;pl-c1&quot;&gt;5&lt;/span&gt;) {&lt;/span&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;table class=&quot;highlight tab-size js-file-line-container js-code-nav-container js-tagsearch-file&quot; data-paste-markdown-skip=&quot;&quot; data-tab-size=&quot;8&quot; data-tagsearch-lang=&quot;C++&quot; data-tagsearch-path=&quot;Fading.ino&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;blob-code blob-code-inner js-file-line&quot; id=&quot;LC34&quot;&gt;    &lt;span style=&quot;font-family: courier;&quot;&gt;&lt;span class=&quot;pl-c&quot;&gt;&lt;span class=&quot;pl-c&quot;&gt;//&lt;/span&gt; sets the value (range from 0 to 255):&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;table class=&quot;highlight tab-size js-file-line-container js-code-nav-container js-tagsearch-file&quot; data-paste-markdown-skip=&quot;&quot; data-tab-size=&quot;8&quot; data-tagsearch-lang=&quot;C++&quot; data-tagsearch-path=&quot;Fading.ino&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;blob-code blob-code-inner js-file-line&quot; id=&quot;LC35&quot;&gt;    &lt;span style=&quot;font-family: courier;&quot;&gt;&lt;span class=&quot;pl-c1&quot;&gt;analogWrite&lt;/span&gt;(ledPin, fadeValue);&lt;/span&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;table class=&quot;highlight tab-size js-file-line-container js-code-nav-container js-tagsearch-file&quot; data-paste-markdown-skip=&quot;&quot; data-tab-size=&quot;8&quot; data-tagsearch-lang=&quot;C++&quot; data-tagsearch-path=&quot;Fading.ino&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;blob-code blob-code-inner js-file-line&quot; id=&quot;LC36&quot;&gt;    &lt;span style=&quot;font-family: courier;&quot;&gt;&lt;span class=&quot;pl-c&quot;&gt;&lt;span class=&quot;pl-c&quot;&gt;//&lt;/span&gt; wait for 30 milliseconds to see the dimming effect&lt;/span&gt;&lt;/span&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;table class=&quot;highlight tab-size js-file-line-container js-code-nav-container js-tagsearch-file&quot; data-paste-markdown-skip=&quot;&quot; data-tab-size=&quot;8&quot; data-tagsearch-lang=&quot;C++&quot; data-tagsearch-path=&quot;Fading.ino&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;blob-code blob-code-inner js-file-line&quot; id=&quot;LC37&quot;&gt;    &lt;span style=&quot;font-family: courier;&quot;&gt;&lt;span class=&quot;pl-c1&quot;&gt;delay&lt;/span&gt;(&lt;span class=&quot;pl-c1&quot;&gt;30&lt;/span&gt;);&lt;/span&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;table class=&quot;highlight tab-size js-file-line-container js-code-nav-container js-tagsearch-file&quot; data-paste-markdown-skip=&quot;&quot; data-tab-size=&quot;8&quot; data-tagsearch-lang=&quot;C++&quot; data-tagsearch-path=&quot;Fading.ino&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;blob-code blob-code-inner js-file-line&quot; id=&quot;LC38&quot;&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;  }&lt;/span&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;span style=&quot;font-family: courier;&quot;&gt;}&lt;/span&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;arduinoeasyproject.blogspot.com&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arduinoeasyproject.blogspot.com/feeds/3300015571562046565/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3996394282062555391/3300015571562046565' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3996394282062555391/posts/default/3300015571562046565'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3996394282062555391/posts/default/3300015571562046565'/><link rel='alternate' type='text/html' href='http://arduinoeasyproject.blogspot.com/2022/03/how-to-drive-mosfet-with-arduino.html' title='How to Drive MOSFET with ARDUINO '/><author><name>FeHq</name><uri>http://www.blogger.com/profile/11734094429613707887</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/a/AVvXsEi1T3XAYaeuig14J5BU0UREOnoVe3jeaRYVRWC0GnW0gq14svvjO50JVkCn-qy-Xgjy5OABc2N2bci4N2qc9jsADikTLic7sI5i54lp1QR62jq8TSGpTqP57zV70MdZ8dASWJqes0dgbHiXk83SyIvSODDYdFOhL8uUeJfAiBsWNJUyMcHlpXciZ3FLwA=s72-w400-h246-c" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3996394282062555391.post-1276587456113814590</id><published>2021-11-16T17:48:00.003+07:00</published><updated>2021-11-16T18:45:02.820+07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="usb 2.0 serial error"/><category scheme="http://www.blogger.com/atom/ns#" term="usb 2.0 serial error arduino"/><title type='text'>Fix Error Driver for USB 2.0-serial drivers - Arduino </title><content type='html'>&lt;p&gt;&amp;nbsp;This Problem is:&lt;/p&gt;&lt;p&gt;QA:&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #222222; font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Lucida Grande&amp;quot;, Lucida, Verdana, sans-serif; font-size: 15.008px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin-top: 0px; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;Hi to all at arduino&lt;/p&gt;&lt;p style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #222222; font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Lucida Grande&amp;quot;, Lucida, Verdana, sans-serif; font-size: 15.008px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;just wondering if any one can help.&lt;br /&gt;i have an uno r3 and a nano pro.&lt;br /&gt;the uno works great no probs, connects, uploads. really happy with it.&lt;/p&gt;&lt;p style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #222222; font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Lucida Grande&amp;quot;, Lucida, Verdana, sans-serif; font-size: 15.008px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;but when i plug the nano in to xp sp2 pc via usb, it finds new hardware but wont install the drivers. &lt;span style=&quot;color: red;&quot;&gt;&lt;b&gt;i cant find these usb 2.0-serial drivers anywhere&lt;/b&gt;&lt;/span&gt;. iv tried re-installing the ftdi drivers from arduino site but the comm port still does not show up in the ide and i still have usb 2.0-serial flagged up in device manager.&lt;/p&gt;&lt;p style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #222222; font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Lucida Grande&amp;quot;, Lucida, Verdana, sans-serif; font-size: 15.008px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;again, if any ones got the answer please help.&lt;/p&gt;&lt;p style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #222222; font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Lucida Grande&amp;quot;, Lucida, Verdana, sans-serif; font-size: 15.008px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;many thanks&lt;/p&gt;&lt;p style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #222222; font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Lucida Grande&amp;quot;, Lucida, Verdana, sans-serif; font-size: 15.008px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&amp;nbsp;&lt;/p&gt;&lt;p style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #222222; font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Lucida Grande&amp;quot;, Lucida, Verdana, sans-serif; font-size: 15.008px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;Answer:&lt;/p&gt;&lt;p style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #222222; font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Lucida Grande&amp;quot;, Lucida, Verdana, sans-serif; font-size: 15.008px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;Just download this driver &lt;span face=&quot;&amp;quot;Open Sans&amp;quot;, &amp;quot;Lucida Grande&amp;quot;, Lucida, Verdana, sans-serif&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #222222; display: inline; float: none; font-size: 15.008px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;CH341SER&amp;nbsp; on file ZIP &lt;a href=&quot;https://drive.google.com/file/d/0B67VsnuzBw1Eby1pQWNfZUJRX3M/view?usp=sharing&amp;amp;resourcekey=0-nmDU0EmlA1ssacdN-QjPHA&quot; target=&quot;_blank&quot;&gt;on this&lt;/a&gt; then &lt;b&gt;UNZIP&lt;/b&gt; then do like this&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #222222; font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Lucida Grande&amp;quot;, Lucida, Verdana, sans-serif; font-size: 15.008px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;/p&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;/div&gt;&lt;p&gt;1.&amp;nbsp; Open device manager&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgu6t1uISk276YfPpOah3ACjqeLGHURXKODqqSXmSBbdLF3H_boMfkBEXOdm-mcLjVkGXXjpHpSGTHcXJIlet9XWaE44I36hU-bPqIRu5ID8JVjKLwvWg4MRPsU19lrjEBbqXXAOmKWpsUA/s477/usb-2.0-serial-error_arduinoeasyproject.blogspot.com_1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;477&quot; data-original-width=&quot;338&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgu6t1uISk276YfPpOah3ACjqeLGHURXKODqqSXmSBbdLF3H_boMfkBEXOdm-mcLjVkGXXjpHpSGTHcXJIlet9XWaE44I36hU-bPqIRu5ID8JVjKLwvWg4MRPsU19lrjEBbqXXAOmKWpsUA/w284-h400/usb-2.0-serial-error_arduinoeasyproject.blogspot.com_1.png&quot; width=&quot;284&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;2.&amp;nbsp; Righth clik Other devices -&amp;gt; USB2.0 Ser&amp;nbsp;&amp;nbsp; --&amp;gt; update driver&lt;br /&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhebdc07nugPtXQ5nid5GxVDtoZ5IT2oFQAlntGDPOESHWPE8e0U1D7lR9csfTK0qRjVE2910bhYHgAIPrLyab1y7bZez2UFlbEgGVrBgQJnyIBXPw9RKod4kQcIZiMYPrOXpjoyZZVYtO4/s423/usb-2.0-serial-error_arduinoeasyproject.blogspot.com_2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;316&quot; data-original-width=&quot;423&quot; height=&quot;299&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhebdc07nugPtXQ5nid5GxVDtoZ5IT2oFQAlntGDPOESHWPE8e0U1D7lR9csfTK0qRjVE2910bhYHgAIPrLyab1y7bZez2UFlbEgGVrBgQJnyIBXPw9RKod4kQcIZiMYPrOXpjoyZZVYtO4/w400-h299/usb-2.0-serial-error_arduinoeasyproject.blogspot.com_2.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;3. Click update driver---&amp;gt; find folder (driver CH341SER)&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNTiQSGMy0ozJorIDcXDjh3NItKVFe5yfuAmhxvJQg8SWjXxMFO4PmVIr7PAdJKa8VoCmjDcwif7Q6MUZoBrM4ki6KVuM6y_Qai9NTOAqMkT2n3EVz1UJcFwSMKwTsw7lqhmHpD6p65P8Q/s523/usb-2.0-serial-error_arduinoeasyproject.blogspot.com_3.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;346&quot; data-original-width=&quot;523&quot; height=&quot;265&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNTiQSGMy0ozJorIDcXDjh3NItKVFe5yfuAmhxvJQg8SWjXxMFO4PmVIr7PAdJKa8VoCmjDcwif7Q6MUZoBrM4ki6KVuM6y_Qai9NTOAqMkT2n3EVz1UJcFwSMKwTsw7lqhmHpD6p65P8Q/w400-h265/usb-2.0-serial-error_arduinoeasyproject.blogspot.com_3.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;4. Find driver foler for USB2.0&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0TDlmA9nFfMKKZQBbQ-wIKx6l233UQ00foMM0yad6Sdx5-ybL9aaYT-tZI77WItDLTTB1zWe7AUBDNLusw28D9KwxdONFx-L21PcLgofzHebJVuq_MOcWuDESdTAhFmQOiGNeiYB-fToo/s692/usb-2.0-serial-error_arduinoeasyproject.blogspot.com_4.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;465&quot; data-original-width=&quot;692&quot; height=&quot;269&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0TDlmA9nFfMKKZQBbQ-wIKx6l233UQ00foMM0yad6Sdx5-ybL9aaYT-tZI77WItDLTTB1zWe7AUBDNLusw28D9KwxdONFx-L21PcLgofzHebJVuq_MOcWuDESdTAhFmQOiGNeiYB-fToo/w400-h269/usb-2.0-serial-error_arduinoeasyproject.blogspot.com_4.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;5. Finis, succes to install, OK&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1aSLD5d351VJC2ERZCGthsNsL-uJLea7LLeKSqxFwl46MYiK78RZitPrRHgN_rx5fK3P_Aj3HnpfZ-A1qz_STtKmii6E-UBdIwDI9QbVU1h0-TTSSYXVb7ZrVOlyCdli0oq3SL7ZOUfuY/s517/usb-2.0-serial-error_arduinoeasyproject.blogspot.com_5.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;517&quot; data-original-width=&quot;360&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1aSLD5d351VJC2ERZCGthsNsL-uJLea7LLeKSqxFwl46MYiK78RZitPrRHgN_rx5fK3P_Aj3HnpfZ-A1qz_STtKmii6E-UBdIwDI9QbVU1h0-TTSSYXVb7ZrVOlyCdli0oq3SL7ZOUfuY/w279-h400/usb-2.0-serial-error_arduinoeasyproject.blogspot.com_5.png&quot; width=&quot;279&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;Now your PC ready connect to USB arduino &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #222222; font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Lucida Grande&amp;quot;, Lucida, Verdana, sans-serif; font-size: 15.008px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span face=&quot;&amp;quot;Open Sans&amp;quot;, &amp;quot;Lucida Grande&amp;quot;, Lucida, Verdana, sans-serif&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #222222; display: inline; float: none; font-size: 15.008px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #222222; font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Lucida Grande&amp;quot;, Lucida, Verdana, sans-serif; font-size: 15.008px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;span face=&quot;&amp;quot;Open Sans&amp;quot;, &amp;quot;Lucida Grande&amp;quot;, Lucida, Verdana, sans-serif&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #222222; display: inline; float: none; font-size: 15.008px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;p style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #222222; font-family: &amp;quot;Open Sans&amp;quot;, &amp;quot;Lucida Grande&amp;quot;, Lucida, Verdana, sans-serif; font-size: 15.008px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&lt;span face=&quot;&amp;quot;Open Sans&amp;quot;, &amp;quot;Lucida Grande&amp;quot;, Lucida, Verdana, sans-serif&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: white; color: #222222; display: inline; float: none; font-size: 15.008px; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-decoration-color: initial; text-decoration-style: initial; text-decoration-thickness: initial; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot;&gt;&amp;nbsp;&lt;/span&gt; &lt;/p&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;arduinoeasyproject.blogspot.com&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arduinoeasyproject.blogspot.com/feeds/1276587456113814590/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3996394282062555391/1276587456113814590' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3996394282062555391/posts/default/1276587456113814590'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3996394282062555391/posts/default/1276587456113814590'/><link rel='alternate' type='text/html' href='http://arduinoeasyproject.blogspot.com/2021/11/fix-error-driver-for-usb-20-serial.html' title='Fix Error Driver for USB 2.0-serial drivers - Arduino '/><author><name>FeHq</name><uri>http://www.blogger.com/profile/11734094429613707887</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgu6t1uISk276YfPpOah3ACjqeLGHURXKODqqSXmSBbdLF3H_boMfkBEXOdm-mcLjVkGXXjpHpSGTHcXJIlet9XWaE44I36hU-bPqIRu5ID8JVjKLwvWg4MRPsU19lrjEBbqXXAOmKWpsUA/s72-w284-h400-c/usb-2.0-serial-error_arduinoeasyproject.blogspot.com_1.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3996394282062555391.post-666549080437766745</id><published>2017-12-08T10:17:00.002+07:00</published><updated>2017-12-08T10:20:07.227+07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Audio Player Arduino"/><title type='text'>Audio Player dengan Arduino</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h3&gt;
Hardware Required&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Arduino Due Board  
&lt;/li&gt;
&lt;li&gt;8-ohm speaker or headphones
&lt;/li&gt;
&lt;li&gt;Arduino shield with an SD card with cs CS 4 (like the Ethernet shield)
&lt;/li&gt;
&lt;/ul&gt;
Komponen tambahan untuk bagian audio amplifier:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span class=&quot;wikiword&quot;&gt;LM386&lt;/span&gt; (low power audio amplifier)
&lt;/li&gt;
&lt;li&gt;10 kohm potentiometer
&lt;/li&gt;
&lt;li&gt;10 ohm resistor
&lt;/li&gt;
&lt;li&gt;2 x 10 µF capacitor
&lt;/li&gt;
&lt;li&gt;0.05 µF (or 0.1 µF) capacitor
&lt;/li&gt;
&lt;li&gt;250 µF capacitor&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
Skema&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://www.arduino.cc/en/uploads/Tutorial/LM386_AudioDue.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;329&quot; data-original-width=&quot;516&quot; height=&quot;204&quot; src=&quot;https://www.arduino.cc/en/uploads/Tutorial/LM386_AudioDue.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://www.arduino.cc/en/uploads/Tutorial/LM386_AudioDue_bb.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;800&quot; data-original-width=&quot;780&quot; height=&quot;320&quot; src=&quot;https://www.arduino.cc/en/uploads/Tutorial/LM386_AudioDue_bb.png&quot; width=&quot;312&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
File Audio File&lt;/h3&gt;
File audio disimpam di SD card format file .wav&amp;nbsp; misal diberi nama (test .wav) frek sampling 44100 Hz, 16-bit stereo quality.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&lt;b&gt;Code Program:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;sourceblocktext&quot;&gt;
&lt;div class=&quot;arduino&quot;&gt;
&lt;span class=&quot;coMULTI&quot;&gt;/*&lt;br /&gt;
&amp;nbsp; Simple Audio Player&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;Demonstrates the use of the Audio library for the Arduino Due&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;Hardware required :&lt;br /&gt;
&amp;nbsp;* Arduino shield with a SD card on CS4&lt;br /&gt;
&amp;nbsp;* A sound file named &quot;test.wav&quot; in the root directory of the SD card&lt;br /&gt;
&amp;nbsp;* An audio amplifier to connect to the DAC0 and ground&lt;br /&gt;
&amp;nbsp;* A speaker to connect to the audio amplifier&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;Original by Massimo Banzi September 20, 2012&lt;br /&gt;
&amp;nbsp;Modified by Scott Fitzgerald October 19, 2012&lt;br /&gt;
&amp;nbsp;Modified by Arturo Guadalupi December 18, 2015&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;This example code is in the public domain&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;http://www.arduino.cc/en/Tutorial/SimpleAudioPlayer&lt;br /&gt;
&lt;br /&gt;
*/&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;co2&quot;&gt;#include &amp;lt;SD.h&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;co2&quot;&gt;#include &amp;lt;SPI.h&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;co2&quot;&gt;#include &amp;lt;Audio.h&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;kw1&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;setup&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span class=&quot;co1&quot;&gt;// debug output at 9600 baud&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span class=&quot;kw1&quot;&gt;Serial&lt;/span&gt;.&lt;span class=&quot;kw1&quot;&gt;begin&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;9600&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &lt;span class=&quot;co1&quot;&gt;// setup SD-card&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span class=&quot;kw1&quot;&gt;Serial&lt;/span&gt;.&lt;span class=&quot;kw1&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot;Initializing SD card...&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;!&lt;/span&gt;SD.&lt;span class=&quot;kw1&quot;&gt;begin&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;kw1&quot;&gt;Serial&lt;/span&gt;.&lt;span class=&quot;kw1&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot; failed!&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;kw1&quot;&gt;while&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span class=&quot;br0&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span class=&quot;kw1&quot;&gt;Serial&lt;/span&gt;.&lt;span class=&quot;kw1&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot; done.&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span class=&quot;co1&quot;&gt;// hi-speed SPI transfers&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &lt;span class=&quot;co1&quot;&gt;// 44100kHz stereo =&amp;gt; 88200 sample rate&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span class=&quot;co1&quot;&gt;// 100 mSec of prebuffering.&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; Audio.&lt;span class=&quot;kw1&quot;&gt;begin&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;88200&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;br0&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;kw1&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;loop&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span class=&quot;kw1&quot;&gt;int&lt;/span&gt; count &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &lt;span class=&quot;co1&quot;&gt;// open wave file from sdcard&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; File myFile &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; SD.&lt;span class=&quot;me1&quot;&gt;open&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot;test.wav&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;!&lt;/span&gt;myFile&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;co1&quot;&gt;// if the file didn&#39;t open, print an error and stop&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;kw1&quot;&gt;Serial&lt;/span&gt;.&lt;span class=&quot;kw1&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot;error opening test.wav&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;kw1&quot;&gt;while&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span class=&quot;br0&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; const &lt;span class=&quot;kw1&quot;&gt;int&lt;/span&gt; S &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1024&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;co1&quot;&gt;// Number of samples to read in block&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span class=&quot;kw1&quot;&gt;short&lt;/span&gt; buffer&lt;span class=&quot;br0&quot;&gt;[&lt;/span&gt;S&lt;span class=&quot;br0&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &lt;span class=&quot;kw1&quot;&gt;Serial&lt;/span&gt;.&lt;span class=&quot;kw1&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot;Playing&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span class=&quot;co1&quot;&gt;// until the file is not finished&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span class=&quot;kw1&quot;&gt;while&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;myFile.&lt;span class=&quot;kw1&quot;&gt;available&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;co1&quot;&gt;// read from the file into buffer&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; myFile.&lt;span class=&quot;kw1&quot;&gt;read&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;buffer&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; sizeof&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;buffer&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;co1&quot;&gt;// Prepare samples&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;kw1&quot;&gt;int&lt;/span&gt; volume &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1024&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; Audio.&lt;span class=&quot;me1&quot;&gt;prepare&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;buffer&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; S&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; volume&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;co1&quot;&gt;// Feed samples to audio&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; Audio.&lt;span class=&quot;kw1&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;buffer&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; S&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;co1&quot;&gt;// Every 100 block print a &#39;.&#39;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; count&lt;span class=&quot;sy0&quot;&gt;++;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;count &lt;span class=&quot;sy0&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;kw1&quot;&gt;Serial&lt;/span&gt;.&lt;span class=&quot;kw1&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot;.&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; count &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span class=&quot;br0&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span class=&quot;br0&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; myFile.&lt;span class=&quot;me1&quot;&gt;close&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &lt;span class=&quot;kw1&quot;&gt;Serial&lt;/span&gt;.&lt;span class=&quot;kw1&quot;&gt;println&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot;End of file. Thank you for listening!&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span class=&quot;kw1&quot;&gt;while&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kw1&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;br0&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;blogger-post-footer&quot;&gt;arduinoeasyproject.blogspot.com&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arduinoeasyproject.blogspot.com/feeds/666549080437766745/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3996394282062555391/666549080437766745' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3996394282062555391/posts/default/666549080437766745'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3996394282062555391/posts/default/666549080437766745'/><link rel='alternate' type='text/html' href='http://arduinoeasyproject.blogspot.com/2017/12/audio-player-dengan-arduino.html' title='Audio Player dengan Arduino'/><author><name>FeHq</name><uri>http://www.blogger.com/profile/11734094429613707887</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3996394282062555391.post-1661222540098963983</id><published>2017-12-08T10:12:00.003+07:00</published><updated>2017-12-08T10:12:45.022+07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Motor Servo"/><title type='text'>Menggerakkan Servo Motor dengan Setting Potensiometer</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h3&gt;
Hardware Required&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Arduino or Genuino Board  
&lt;/li&gt;
&lt;li&gt;Servo Motor
&lt;/li&gt;
&lt;li&gt;10k ohm potentiometer
&lt;/li&gt;
&lt;li&gt;hook-up wires&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
Skema&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://www.arduino.cc/en/uploads/Tutorial/knob_bb.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;380&quot; data-original-width=&quot;480&quot; height=&quot;253&quot; src=&quot;https://www.arduino.cc/en/uploads/Tutorial/knob_bb.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://www.arduino.cc/en/uploads/Tutorial/knob_schem.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;608&quot; data-original-width=&quot;560&quot; height=&quot;320&quot; src=&quot;https://www.arduino.cc/en/uploads/Tutorial/knob_schem.png&quot; width=&quot;294&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
CODE:&lt;br /&gt;
&lt;div class=&quot;sourceblocktext&quot;&gt;
&lt;div class=&quot;arduino&quot;&gt;
&lt;span class=&quot;coMULTI&quot;&gt;/*&lt;br /&gt;
&amp;nbsp;Controlling a servo position using a potentiometer (variable resistor)&lt;br /&gt;
&amp;nbsp;by Michal Rinott &amp;lt;http://people.interaction-ivrea.it/m.rinott&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;modified on 8 Nov 2013&lt;br /&gt;
&amp;nbsp;by Scott Fitzgerald&lt;br /&gt;
&amp;nbsp;http://www.arduino.cc/en/Tutorial/Knob&lt;br /&gt;
*/&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;co2&quot;&gt;#include &amp;lt;Servo.h&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Servo myservo&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt; &amp;nbsp;&lt;span class=&quot;co1&quot;&gt;// create servo object to control a servo&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;kw1&quot;&gt;int&lt;/span&gt; potpin &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt; &amp;nbsp;&lt;span class=&quot;co1&quot;&gt;// analog pin used to connect the potentiometer&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;kw1&quot;&gt;int&lt;/span&gt; val&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;co1&quot;&gt;// variable to read the value from the analog pin&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;kw1&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;setup&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; myservo.&lt;span class=&quot;me1&quot;&gt;attach&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;9&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt; &amp;nbsp;&lt;span class=&quot;co1&quot;&gt;// attaches the servo on pin 9 to the servo object&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;br0&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;kw1&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;loop&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; val &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;analogRead&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;potpin&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;co1&quot;&gt;// reads the value of the potentiometer (value between 0 and 1023)&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; val &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;map&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;val&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1023&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;180&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;co1&quot;&gt;// scale it to use it with the servo (value between 0 and 180)&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; myservo.&lt;span class=&quot;kw1&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;val&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;co1&quot;&gt;// sets the servo position according to the scaled value&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span class=&quot;kw1&quot;&gt;delay&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;15&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;co1&quot;&gt;// waits for the servo to get there&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;br0&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;blogger-post-footer&quot;&gt;arduinoeasyproject.blogspot.com&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arduinoeasyproject.blogspot.com/feeds/1661222540098963983/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3996394282062555391/1661222540098963983' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3996394282062555391/posts/default/1661222540098963983'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3996394282062555391/posts/default/1661222540098963983'/><link rel='alternate' type='text/html' href='http://arduinoeasyproject.blogspot.com/2017/12/menggerakkan-servo-motor-dengan-setting.html' title='Menggerakkan Servo Motor dengan Setting Potensiometer'/><author><name>FeHq</name><uri>http://www.blogger.com/profile/11734094429613707887</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3996394282062555391.post-3610619885118952629</id><published>2017-12-08T10:07:00.002+07:00</published><updated>2017-12-08T10:07:47.358+07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Range finder"/><title type='text'>Ping Ultrasonic Range Finder</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h3&gt;
Hardware Required&lt;/h3&gt;
&lt;div class=&quot;BOM&quot;&gt;
&lt;ul&gt;
&lt;li&gt;Arduino or Genuino Board
&lt;/li&gt;
&lt;li&gt;Ultrasonic Range Finder
&lt;/li&gt;
&lt;li&gt;hook-up wires&amp;nbsp;&lt;/li&gt;
&lt;li&gt;The &lt;a class=&quot;urllink&quot; href=&quot;http://wiki.seeed.cc/Ultra_Sonic_range_measurement_module/&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;&lt;strong&gt;SEN136B5B&lt;/strong&gt;&lt;/a&gt;
 is an ultrasonic range finder from Seeedstudio.  It detects the 
distance of the closest object in front of the sensor (from 3 cm up to 
400 cm).&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
Circuit&lt;/h3&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://www.arduino.cc/en/uploads/Tutorial/ping_bb.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;338&quot; data-original-width=&quot;545&quot; height=&quot;198&quot; src=&quot;https://www.arduino.cc/en/uploads/Tutorial/ping_bb.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;h3&gt;
&amp;nbsp;&lt;/h3&gt;
&lt;h3&gt;
CODE &lt;/h3&gt;
&lt;pre&gt;/*
  Ping))) Sensor

  This sketch reads a PING))) ultrasonic rangefinder and returns the distance
  to the closest object in range. To do this, it sends a pulse to the sensor to
  initiate a reading, then listens for a pulse to return. The length of the
  returning pulse is proportional to the distance of the object from the sensor.

  The circuit:
 - +V connection of the PING))) attached to +5V
 - GND connection of the PING))) attached to ground
 - SIG connection of the PING))) attached to digital pin 7

  created 3 Nov 2008
  by David A. Mellis
  modified 30 Aug 2011
  by Tom Igoe

  This example code is in the public domain.

  http://www.arduino.cc/en/Tutorial/Ping
*/

// this constant won&#39;t change. It&#39;s the pin number of the sensor&#39;s output:
const int pingPin = 7;

void setup() {
  // initialize serial communication:
  Serial.begin(9600);
}

void loop() {
  // establish variables for duration of the ping, and the distance result
  // in inches and centimeters:
  long duration, inches, cm;

  // The PING))) is triggered by a HIGH pulse of 2 or more microseconds.
  // Give a short LOW pulse beforehand to ensure a clean HIGH pulse:
  pinMode(pingPin, OUTPUT);
  digitalWrite(pingPin, LOW);
  delayMicroseconds(2);
  digitalWrite(pingPin, HIGH);
  delayMicroseconds(5);
  digitalWrite(pingPin, LOW);

  // The same pin is used to read the signal from the PING))): a HIGH pulse
  // whose duration is the time (in microseconds) from the sending of the ping
  // to the reception of its echo off of an object.
  pinMode(pingPin, INPUT);
  duration = pulseIn(pingPin, HIGH);

  // convert the time into a distance
  inches = microsecondsToInches(duration);
  cm = microsecondsToCentimeters(duration);

  Serial.print(inches);
  Serial.print(&quot;in, &quot;);
  Serial.print(cm);
  Serial.print(&quot;cm&quot;);
  Serial.println();

  delay(100);
}

long microsecondsToInches(long microseconds) {
  // According to Parallax&#39;s datasheet for the PING))), there are 73.746
  // microseconds per inch (i.e. sound travels at 1130 feet per second).
  // This gives the distance travelled by the ping, outbound and return,
  // so we divide by 2 to get the distance of the obstacle.
  // See: http://www.parallax.com/dl/docs/prod/acc/28015-PING-v1.3.pdf
  return microseconds / 74 / 2;
}

long microsecondsToCentimeters(long microseconds) {
  // The speed of sound is 340 m/s or 29 microseconds per centimeter.
  // The ping travels out and back, so to find the distance of the object we
  // take half of the distance travelled.
  return microseconds / 29 / 2;
}&lt;/pre&gt;
&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;blogger-post-footer&quot;&gt;arduinoeasyproject.blogspot.com&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arduinoeasyproject.blogspot.com/feeds/3610619885118952629/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3996394282062555391/3610619885118952629' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3996394282062555391/posts/default/3610619885118952629'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3996394282062555391/posts/default/3610619885118952629'/><link rel='alternate' type='text/html' href='http://arduinoeasyproject.blogspot.com/2017/12/ping-ultrasonic-range-finder.html' title='Ping Ultrasonic Range Finder'/><author><name>FeHq</name><uri>http://www.blogger.com/profile/11734094429613707887</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3996394282062555391.post-5906877555428200192</id><published>2014-04-22T10:13:00.001+07:00</published><updated>2014-04-22T10:18:24.891+07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="arduino parking alarm"/><title type='text'>PARKING ALARM CAR</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span id=&quot;goog_661932029&quot;&gt;&lt;/span&gt;&lt;span id=&quot;goog_661932030&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;/* THIS IS PARKING ALARM SYSTEM MODIFICATION FROM PING SENSOR from ARDUINO.CC &lt;/span&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; THIS PROGRAM USING PING SENSOR+LCD+TONE&lt;/span&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; MODIFICATION BY: ARDUINOEASYPROJECT.BLOGSPOT.COM&lt;/span&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; The circuit PING SENSOR:&lt;/span&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; * +V connection of the PING attached to +5V&lt;/span&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; * GND connection of the PING attached to ground&lt;/span&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; * SIG connection of the PING attached to digital pin 7&lt;/span&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; The circuit Piezo:&lt;/span&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; * attached to pin 9&lt;/span&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; * attached to ground&lt;/span&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;*/&lt;/span&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;const int pingPin = 7;&lt;/span&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;float sinVal;&lt;/span&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;int toneVal;&lt;/span&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;int PiezoPin = 9;&amp;nbsp; //Output to piezo pin 9&lt;/span&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;void setup() &lt;/span&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;{&lt;/span&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp; Serial.begin(9600);&lt;/span&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp; pinMode(PiezoPin, OUTPUT);&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;}&lt;/span&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;void loop()&lt;/span&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;{&lt;/span&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp; long duration, inches, cm;&lt;/span&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp; pinMode(pingPin, OUTPUT);&lt;/span&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp; digitalWrite(pingPin, LOW);&lt;/span&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp; delayMicroseconds(2);&lt;/span&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp; digitalWrite(pingPin, HIGH);&lt;/span&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp; delayMicroseconds(5);&lt;/span&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp; digitalWrite(pingPin, LOW);&lt;/span&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp; pinMode(pingPin, INPUT);&lt;/span&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp; duration = pulseIn(pingPin, HIGH);&lt;/span&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp; inches = microsecondsToInches(duration);&lt;/span&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp; cm = microsecondsToCentimeters(duration);&lt;/span&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp; Serial.print(inches);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // THIS SERIAL JUST FOR DEVELOPER TO TEST&lt;/span&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp; Serial.print(&quot;in, &quot;);&lt;/span&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp; Serial.print(cm);&lt;/span&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp; Serial.print(&quot;cm&quot;);&lt;/span&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp; Serial.println();&lt;/span&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp; if (cm &amp;lt;= 25)&amp;nbsp;&amp;nbsp; // &lt;span style=&quot;color: red;&quot;&gt;YOU CAN CHANGE THE DISTANCE WARNING AT THIS&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (int x=0; x&amp;lt;270; x=x+10) &lt;/span&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sinVal = (sin(x*(3.1412/180)));&lt;/span&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; toneVal = 2000+(int(sinVal*1000));&lt;/span&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Serial.println(sinVal);&lt;/span&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tone(PiezoPin, toneVal);&lt;/span&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; delay(5);&lt;/span&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp; else&lt;/span&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp; { noTone(PiezoPin); }&lt;/span&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp; delay(100);&lt;/span&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;}&lt;/span&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;long microsecondsToInches(long microseconds)&lt;/span&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;{&lt;/span&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp; return microseconds / 74 / 2;&lt;/span&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;}&lt;/span&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;long microsecondsToCentimeters(long microseconds)&lt;/span&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;{&lt;/span&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&amp;nbsp;&amp;nbsp; return microseconds / 29 / 2;&lt;/span&gt;&lt;br style=&quot;font-family: inherit;&quot; /&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;This arduino parking alarm system will generate alarm sound when the car move to close the object around 25 cm. It is easy to change save distance, just set the &lt;b&gt;cm variable&lt;/b&gt; in the program that you want.&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;blogger-post-footer&quot;&gt;arduinoeasyproject.blogspot.com&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arduinoeasyproject.blogspot.com/feeds/5906877555428200192/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3996394282062555391/5906877555428200192' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3996394282062555391/posts/default/5906877555428200192'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3996394282062555391/posts/default/5906877555428200192'/><link rel='alternate' type='text/html' href='http://arduinoeasyproject.blogspot.com/2014/04/parking-alarm-car.html' title='PARKING ALARM CAR'/><author><name>FeHq</name><uri>http://www.blogger.com/profile/11734094429613707887</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3996394282062555391.post-6259171181162336630</id><published>2012-04-18T07:48:00.001+07:00</published><updated>2014-04-22T10:09:53.460+07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="find hex file at arduino IDE developer"/><category scheme="http://www.blogger.com/atom/ns#" term="How to find Hex file arduino IDE"/><title type='text'>How to find hex file at Arduino IDE</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Rapid product for microcontrolller project is using arduino, you just write with processing C,&amp;nbsp; then burning hex file it in new project for your custom schematic. But did you find where is hex file? in arduino IDE.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
The answer is you got it at temp folder for your user. This example at winxp.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
1. Open project, example this&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhzLVcBqR7OXAZJUfc0_dGl3c7t2EwwWkh5pQl-XNmOikVbhu6KdLGpE2xqoUPm5RI9nr2WcNtmzdQ0UTNm6e8j53SvI0I9uAEDPV5BM1EJjpAglcDTtdG_PmeFua7SWag7ZxYpMWFw1s_/s1600/hexfile.PNG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhzLVcBqR7OXAZJUfc0_dGl3c7t2EwwWkh5pQl-XNmOikVbhu6KdLGpE2xqoUPm5RI9nr2WcNtmzdQ0UTNm6e8j53SvI0I9uAEDPV5BM1EJjpAglcDTtdG_PmeFua7SWag7ZxYpMWFw1s_/s400/hexfile.PNG&quot; height=&quot;400&quot; width=&quot;332&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
2. Then compile, and goto my document and setting\&quot;your user&quot;\local setting\temp\&quot;find file at new day you compile&quot;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8v7nwcV5xoEmT0xim-aT_N_CHj_VrXfazwTvo90RyCPHvehyphenhyphenGtwQ-vWBVCvd1KiRNuabePwcH77pX4M8Y7TgAosaI4rt0cSFIPNP75oL6Glle5qVgf9d2wid64i3Uw9_ZKRfLWNaqRJe1/s1600/hexfilefolder.PNG&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8v7nwcV5xoEmT0xim-aT_N_CHj_VrXfazwTvo90RyCPHvehyphenhyphenGtwQ-vWBVCvd1KiRNuabePwcH77pX4M8Y7TgAosaI4rt0cSFIPNP75oL6Glle5qVgf9d2wid64i3Uw9_ZKRfLWNaqRJe1/s400/hexfilefolder.PNG&quot; height=&quot;300&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;blogger-post-footer&quot;&gt;arduinoeasyproject.blogspot.com&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://arduinoeasyproject.blogspot.com/feeds/6259171181162336630/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/3996394282062555391/6259171181162336630' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3996394282062555391/posts/default/6259171181162336630'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3996394282062555391/posts/default/6259171181162336630'/><link rel='alternate' type='text/html' href='http://arduinoeasyproject.blogspot.com/2012/04/how-to-find-hex-file-at-arduino.html' title='How to find hex file at Arduino IDE'/><author><name>FeHq</name><uri>http://www.blogger.com/profile/11734094429613707887</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhzLVcBqR7OXAZJUfc0_dGl3c7t2EwwWkh5pQl-XNmOikVbhu6KdLGpE2xqoUPm5RI9nr2WcNtmzdQ0UTNm6e8j53SvI0I9uAEDPV5BM1EJjpAglcDTtdG_PmeFua7SWag7ZxYpMWFw1s_/s72-c/hexfile.PNG" height="72" width="72"/><thr:total>0</thr:total></entry></feed>