Falls du sehr viele Led's brauchst:
Kannst auch digitale Zustände im 16x2 LCD anzeigen lassen. z.B. mit H und L oder 0 und 1 oder Sonderzeichen _ -.
Da spart man sich ne Menge Verdahtungsarbeit mit Vorwiderstand-LED-Masse.
Hab mir da mal so ein Beispiel-Dings im Ordner abgelegt:
(so mit richtig viel delay drin...
)
/*********************
Example code for the Adafruit RGB Character LCD Shield and Library
This code displays text on the shield, and also reads the buttons on the keypad.
When a button is pressed, the backlight changes color.
**********************/
// include the library code:
#include <Wire.h>
#include <utility/Adafruit_MCP23017.h>
#include <Adafruit_RGBLCDShield.h>
// The shield uses the I2C SCL and SDA pins. On classic Arduinos
// this is Analog 4 and 5 so you can't use those for analogRead() anymore
// However, you can connect other I2C sensors to the I2C bus and share
// the I2C bus.
Adafruit_RGBLCDShield lcd = Adafruit_RGBLCDShield();
// These #defines make it easy to set the backlight color
#define RED 0x1
#define YELLOW 0x3
#define GREEN 0x2
#define TEAL 0x6
#define BLUE 0x4
#define VIOLET 0x5
#define WHITE 0x7
byte smiley[8] = {
B00000,
B10001,
B00000,
B00000,
B10001,
B01110,
B00000,
};
byte high[8] = {
B11111,
B00000,
B00000,
B00000,
B00000,
B00000,
B00000,
};
byte low[8] = {
B00000,
B00000,
B00000,
B00000,
B00000,
B00000,
B11111,
};
void setup() {
// Debugging output
Serial.begin(9600);
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
// Print a message to the LCD. We track how long it takes since
// this library has been optimized a bit and we're proud of it :)
lcd.setBacklight(WHITE);
lcd.createChar(0, smiley);
lcd.createChar(1, high);
lcd.createChar(2, low);
lcd.setCursor(1, 1);
lcd.write(byte(2));
delay(500);
lcd.setCursor(1, 1);
lcd.write(byte(1));
delay(2000);
lcd.setCursor(0, 1);
lcd.write(byte(1));
lcd.setCursor(1, 0);
lcd.write(byte(0));
lcd.setCursor(8, 0);
lcd.print("H");
lcd.setCursor(7, 0);
lcd.print("L");
lcd.setCursor(15, 1);
lcd.print("H");
lcd.setCursor(14, 1);
lcd.print("L");
delay(5000);
lcd.setCursor(8, 0);
lcd.print("L");
lcd.setCursor(7, 0);
lcd.print("H");
lcd.setCursor(15, 1);
lcd.print("L");
lcd.setCursor(14, 1);
lcd.print("H");
}
void loop() {
}