Moin,
ich habe folgenden Code den ich für mein I2C Display 20x4 zeichen umschreiben möchte:
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#define BACKLIGHT_PIN 13
LiquidCrystal_I2C lcd(0x38); // Set the LCD I2C address
//LiquidCrystal_I2C lcd(0x38, BACKLIGHT_PIN, POSITIVE); // Set the LCD I2C address
// Creat a set of new characters
const uint8_t charBitmap[][8] = {
{ 0xc, 0x12, 0x12, 0xc, 0, 0, 0, 0 },
{ 0x6, 0x9, 0x9, 0x6, 0, 0, 0, 0 },
{ 0x0, 0x6, 0x9, 0x9, 0x6, 0, 0, 0x0 },
{ 0x0, 0xc, 0x12, 0x12, 0xc, 0, 0, 0x0 },
{ 0x0, 0x0, 0xc, 0x12, 0x12, 0xc, 0, 0x0 },
{ 0x0, 0x0, 0x6, 0x9, 0x9, 0x6, 0, 0x0 },
{ 0x0, 0x0, 0x0, 0x6, 0x9, 0x9, 0x6, 0x0 },
{ 0x0, 0x0, 0x0, 0xc, 0x12, 0x12, 0xc, 0x0 }
};
void setup()
{
int charBitmapSize = (sizeof(charBitmap ) / sizeof (charBitmap[0]));
// Switch on the backlight
pinMode ( BACKLIGHT_PIN, OUTPUT );
digitalWrite ( BACKLIGHT_PIN, HIGH );
lcd.begin(16,2); // initialize the lcd
for ( int i = 0; i < charBitmapSize; i++ )
{
lcd.createChar ( i, (uint8_t *)charBitmap );
- }*
- lcd.home (); // go home*
- lcd.print("Hello, ARDUINO "); *
- lcd.setCursor ( 0, 1 ); // go to the next line*
- lcd.print (" FORUM - fm ");*
- delay ( 1000 );*
}
void loop()
{ - lcd.home ();*
- // Do a little animation by writing to the same location*
- for ( int i = 0; i < 2; i++ )*
- {*
- for ( int j = 0; j < 16; j++ )*
- {*
- lcd.print (char(random(7)));*
- }*
- lcd.setCursor ( 0, 1 );*
- }*
- delay (200);*
}
Jetzt habe ich angefangen und überprüfe das natürlich andauernd damit ich keine Schwierigkeiten beim Kompilieren bekomme:
#include <Wire.h>
#inlcude <LCD.h>
#include <LiquidCrystal_I2C.h>
#define I2C_ADDR 0x3F // Define I2C Address
#define BACKLIGHT_PIN 3
#define En_pin 2
#define Rw_pin 1
#define Rs_pin 0
#define D4_pin 4
#define D5_pin 5
#define D6_pin 6
#define D7_pin 7
LiquidCrystal_I2C lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin);
// Creat a set of new characters
const uint8_t charBitmap[][8] = { - { 0xc, 0x12, 0x12, 0xc, 0, 0, 0, 0 },*
- { 0x6, 0x9, 0x9, 0x6, 0, 0, 0, 0 },*
- { 0x0, 0x6, 0x9, 0x9, 0x6, 0, 0, 0x0 },*
- { 0x0, 0xc, 0x12, 0x12, 0xc, 0, 0, 0x0 },*
- { 0x0, 0x0, 0xc, 0x12, 0x12, 0xc, 0, 0x0 },*
- { 0x0, 0x0, 0x6, 0x9, 0x9, 0x6, 0, 0x0 },*
- { 0x0, 0x0, 0x0, 0x6, 0x9, 0x9, 0x6, 0x0 },*
- { 0x0, 0x0, 0x0, 0xc, 0x12, 0x12, 0xc, 0x0 }*
};
void setup()
{
- lcd.begin (20,4,LCD_5x8DOTS);*
- lcd.setBacklightPin(BACKLIGHT_PIN,POSITIVE);*
}
allerdings bekomme ich ab genau den Punkt folgende Fehlermeldung:
HelloWorld_i2c.pde:2:2: error: invalid preprocessing directive #inlcude
kann mich mal einer aufklären was das IDE da von mir will???