itead / Segnix

An Arduino-like Project Based on Linux/Raspberry Pi
110 stars 74 forks source link

include itead_LiquidCrystal.h posts an error when compiling a program with it included #1

Open lesterkell opened 9 years ago

lesterkell commented 9 years ago

Hi, I'm trying to work a Liquid Crystal display using a Raspberry Pi B+ using the itead SDK but when I build the program in C and try to compile it, it posts an error

/usr/local/includeitead_LiquidCrystal.h:50:1: error: unknown type name 'class' /usr/local/includeitead_LiquidCrystal.h:50:21: error: expected '=', ',', ';', 'asm' or 'attribute' before ':' token.

I only downloaded the new version last night from Git hub so I should be up todate. I am knew to raspberry Pi so please bare with me if i'm doing something silly. It does look like all include files that use the defenation 'class' will have the same error.

Any help would be great.

The code i'm using is: //*** // include the library code:

include

#include <stdio.h>
#include <itead_LiquidCrystal.h>
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(16,18,11,12,13,15);

void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
}

main() {

time_t rawtime;
struct tm * timeinfo;

setup();
// set the cursor to column 0, line 1
// (note: line 1 is the second row, since counting begins with 0):    
// lcd.setCursor(0, 0);

// print system time 
time ( &rawtime );
timeinfo = localtime ( &rawtime );
while(1)
    {  
    lcd.setCursor(0,0);
    lcd.print(asctime (timeinfo));
     delay(1000);
     }
}

//**

Thanks.