MUstar

IoT 아두이노 0609 - LCD No.1-2

Jun 9th, 2017
67
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <LiquidCrystal.h>
  2.  
  3. int pin_LCD_DATA[8] = {A8,A9,A10,A11,A12,A13,A14,A15};
  4. int pin_LCD_CTRL[3] = {A5,A6,A7};
  5. LiquidCrystal lcd(A5,A6,A7,A8,A9,A10,A11,A12,A13,A14,A15);
  6. void loop2(void);
  7.  
  8. void setup() {
  9.   lcd.begin(16,2);
  10. }
  11.  
  12. void loop() {
  13.   int i, j=16;
  14.   for(i=0; i<17; i++){
  15.     lcd.setCursor(i,0);
  16.     lcd.print("A");
  17.     j--;
  18.     if(j==-1) continue;
  19.     lcd.setCursor(j,1);
  20.     lcd.print("B");
  21.     delay(500);
  22.     lcd.clear();
  23.   }
  24. }
RAW Paste Data