I proting my function code to header file. but many error is bothering me. So, i want to know cause of error. Or, i hope you to write header file code for me. please help me. And i write my header and function code.
This is original function.
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void korean(int i, int n)
{
if (i == 1) //1!
{
byte a_1[8] = {
B00000,
B00000,
B00010,
B11010,
B01011,
B01010,
B00010,
B00010,
};
lcd.createChar(n, a_1);
lcd.setCursor(n - 1, 0);
lcd.write(byte(n));
}
else if (i == 2) //2!
{
byte a_1[8] = {
B00000,
B00010,
B11011,
B01010,
B01010,
B00000,
B11110,
B00010,
};
lcd.createChar(n, a_1);
lcd.setCursor(n - 1, 0);
lcd.write(byte(n));
}
}
#endif
This is header file code.
#ifndef korean_c
#include "Arduino.h"
#include "LiquidCrystal.h"
void korean(LiquidCrystal &lcd, int i, int n)
{
if (i == 1) //1!
{
byte a_1[8] = {
B00000,
B00000,
B00010,
B11010,
B01011,
B01010,
B00010,
B00010,
};
lcd.createChar(n, a_1);
lcd.setCursor(n - 1, 0);
lcd.write(byte(n));
}
else if (i == 2) //2!
{
byte a_1[8] = {
B00000,
B00010,
B11011,
B01010,
B01010,
B00000,
B11110,
B00010,
};
lcd.createChar(n, a_1);
lcd.setCursor(n - 1, 0);
lcd.write(byte(n));
}
}
This is error code.
Arduino: 1.6.5 (Mac OS X), Board: "Arduino/Genuino Uno"
In file included from sketch_oct18c.ino:1:0:
/Applications/Arduino.app/Contents/Java/libraries/Korean_c/Korean_c.h:7:1: error: expected class-name before '{' token
{
^
/Applications/Arduino.app/Contents/Java/libraries/Korean_c/Korean_c.h:9:12: error: expected unqualified-id before 'int'
korean_c(int i, int n);
^
/Applications/Arduino.app/Contents/Java/libraries/Korean_c/Korean_c.h:9:12: error: expected ')' before 'int'
/Applications/Arduino.app/Contents/Java/libraries/Korean_c/Korean_c.h:10:5: error: declaration does not declare anything [-fpermissive]
void korean_c;
^
/Applications/Arduino.app/Contents/Java/libraries/Korean_c/Korean_c.h:13:1: error: abstract declarator '' used as declaration
};
^
Error compiling.
This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.
If you help me, Thanks a lot.