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: