Willkommen auf unserem Seminar-Blog

Immer auf dem aktuellen Stand bleiben

Dieser Seminar-Blog befindet sich noch im Aufbau und wird in den kommenden Tagen entsprechend verfeinert.

Member Login

Lost your password?

Registration is closed

Sorry, you are not allowed to register by yourself on this site!

You must either be invited by one of our team member or request an invitation by email at viad.info {at} zhdk {dot} ch.

LCD Screen

  Lieferant: Sparkfun Typ: Basic 16 x 2 Character LCD - White on Black 5V Interface: Parallel Software Bibliothek: Arduino/Examples/Libraries/Liquid Crystal Code:
#include <LiquidCrystal.h>

// initialise library with our pin setup
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

byte r = 0;  // variable declaration
byte g = 0;
byte b = 0;

void setup() {
  // setup columns and rows of lcd
  lcd.begin(16, 2);
  // Print to lcd
  lcd.print("RED   GRN   BLU");
//  lcd.print("HUE  SAT  BRI");
}

void loop() {
  lcd.setCursor(0, 1);  // 1st character, second row
  lcd.print(r, DEC);    // data and base

  lcd.setCursor(6, 1);  // 6th character, second row
  lcd.print(g, DEC);

  lcd.setCursor(12, 1);  // 12th character, second row
  lcd.print(b, DEC);

  r++;   // increase count
  g--;
  b++;

  delay(500);
}
Schaltung: