Advertisement
MGRedder

Skærm kode

Jan 18th, 2019
66
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Arduino 1.21 KB | None
  1. void LCD_Skaerm(){
  2.   {
  3.   //LCD RØD
  4.   lcd.clear();
  5.   lcd.setCursor(0,0);
  6.   lcd.print("Sorted cans   ");
  7.   delay(1);
  8.   lcd.setCursor(0,1);
  9.   lcd.print("Red   = "); //Viser den røde farve
  10.   lcd.setCursor(8,1);
  11.   lcd.print(Red);
  12.   delay(1000);
  13.   }
  14.   { //LCD GRØN
  15.   lcd.clear();
  16.   lcd.setCursor(0,0);
  17.   lcd.print("Sorted cans   ");
  18.   delay(1);
  19.   lcd.setCursor(0,1);
  20.   lcd.print("Green = "); //Viser den grønne farve
  21.   lcd.setCursor(8,1);
  22.   lcd.print(Green);
  23.   delay(1000);
  24.   }
  25.   {
  26. //LCD BLÅ
  27.   lcd.clear();
  28.   lcd.setCursor(0,0);
  29.   lcd.print("Sorted cans   ");
  30.   delay(1);
  31.   lcd.setCursor(0,1);
  32.   lcd.print("Blue  = "); //Viser den blå farve
  33.   lcd.setCursor(8,1);
  34.   lcd.print(Blue);
  35.   delay(1000);
  36.   }
  37.     {
  38. //LCD BLÅ
  39.   lcd.clear();
  40.   lcd.setCursor(0,0);
  41.   lcd.print("Sorted cans   ");
  42.   delay(1);
  43.   lcd.setCursor(0,1);
  44.   lcd.print("Black =  "); //Viser den sorte farve
  45.   lcd.setCursor(9,1);
  46.   lcd.print(Black);
  47.   delay(1000);
  48.   }
  49.   {
  50. //TOTAL DÅSER
  51.   lcd.clear();
  52.   lcd.setCursor(0,0);
  53.   lcd.print("Sorted cans   ");
  54.   delay(1);
  55.   lcd.setCursor(0,1);
  56.   lcd.print("Total = "); //Viser total sorterede dåser
  57.   lcd.setCursor(8,1);
  58.   lcd.print(Red+Green+Blue+Black);
  59.   delay(1500);
  60.   }
Advertisement
RAW Paste Data Copied
Advertisement