Advertisement
Narayan

Untitled

Feb 21st, 2016
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.96 KB | None | 0 0
  1. #include <LiquidCrystal.h> //Include LCDs LibraryLiquidCrystal lcd(12, 11, 5, 4, 3, 2); //Attach LCDs and Arduino pin comunnication
  2.  
  3. int time; //Entire variable declaration(time)
  4.  
  5. void setup(){
  6.   lcd.begin(16, 2);             //LCD begins. dimension: 16x2(Coluns x Rows)
  7.   lcd.setCursor(0, 0);          // Positions the cursor in the first column (0) and the firt row (1) at LCD
  8.   lcd.print("LiquidCrystal.h"); //LCD write comand"LiquidCrystal.h"
  9.   lcd.setCursor(0, 1);          // Positions the cursor in the first column (0) and the second row (1) at LCD
  10.   lcd.print("GarageLab");       // LCD write command "GarageLab"
  11. }
  12.  
  13. void loop(){
  14.  
  15.   lcd.setCursor(13, 1); // Positions the cursor on the fourteenth column (13) and the second line (1) LCD
  16.   lcd.print(time); // Write the current value of the count variable in the LCD
  17.  
  18.   delay(1000); // Waits for 1 second
  19.  
  20.   time++; // Increment count variable
  21.  
  22.   if(time == 600){
  23.     time = 0; //... resets the count variable
  24.   }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement