This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en:arduino:examples [2017/08/09 07:24] – kaupo.raid | en:arduino:examples [2020/07/20 09:00] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 162: | Line 162: | ||
| { | { | ||
| // Get digital value of potentiometer | // Get digital value of potentiometer | ||
| - | | + | |
| | | ||
| // When potentiometer digital value is logical " | // When potentiometer digital value is logical " | ||
| Line 199: | Line 199: | ||
| { | { | ||
| // Get analog value of potentiometer | // Get analog value of potentiometer | ||
| - | | + | |
| | | ||
| // Turn LED on | // Turn LED on | ||
| Line 211: | Line 211: | ||
| | | ||
| // Halt the program for potentiometer analog value number of milliseconds | // Halt the program for potentiometer analog value number of milliseconds | ||
| - | delay(poteOlek); | + | delay(potState); |
| } | } | ||
| </ | </ | ||
| Line 238: | Line 238: | ||
| | | ||
| // When potentiometer value is greater than 0 then set LED on halt program for short period | // When potentiometer value is greater than 0 then set LED on halt program for short period | ||
| - | if (poteOlek | + | if (potState |
| { | { | ||
| digitalWrite(led, | digitalWrite(led, | ||
| - | delayMicroseconds(poteOlek); | + | delayMicroseconds(potState); |
| } | } | ||
| | | ||
| Line 248: | Line 248: | ||
| | | ||
| // Halt program for short period | // Halt program for short period | ||
| - | delayMicroseconds(1023 - poteOlek); | + | delayMicroseconds(1023 - potState); |
| } | } | ||
| </ | </ | ||
| Line 457: | Line 457: | ||
| // Print out explaining text | // Print out explaining text | ||
| - | lcd.print(" | + | lcd.print(" |
| lcd.setCursor(0, | lcd.setCursor(0, | ||
| - | lcd.print(" | + | lcd.print(" |
| } | } | ||
| void loop() | void loop() | ||
| Line 482: | Line 482: | ||
| // when infrared sensor does not see anything print out " | // when infrared sensor does not see anything print out " | ||
| - | if(infrapunaNaebObjekti | + | if(proximity |
| else lcd.print(" | else lcd.print(" | ||