i am making a email notifier but i am getting an error whem compiling could somebody please help me out???
i am using an arduino mega
here is my code:
#include <glcd.h>
#include "fonts/Arial14.h"
#include "fonts/SystemFont5x7.h"
byte counter='0'; //new emails counter
byte prevCounter='0'; //previous new emails counter
int backlight = 10;
void backlightBlink(){ //draws your attention to the screen
int pwm,i;
for(i=0;i<2;i++){
for(pwm=255;pwm>0;pwm--) {analogWrite(backlight,pwm); delay(2);}
for(pwm=0;pwm<256;pwm++) {analogWrite(backlight,pwm); delay(2);}
}
}
void setup(){
Serial.begin(9600);
GLCD.Printf("ArduGmail Notifier");
GLCD.GotoXY(2,2);
GLCD.Printf("new messages");
GLCD.GotoXY(0,2);
GLCD.Printf(counter);
analogWrite(backlight,255); //maximum backlight
}
void loop(){
if (Serial.available()>0){ //python script sends only one character so the number of unread mails can be zero up to nine
prevCounter= counter;
counter = Serial.read();
GLCD.GotoXY(0,2);
GLCD.Printf(counter);
if (int(counter) > int(prevCounter)) {backlightBlink();} //draws your attention
}
}
and here is the error:
arduGmailNotifier.cpp: In function 'void setup()':
arduGmailNotifier:22: error: invalid conversion from 'byte' to 'const char*'
arduGmailNotifier:22: error: initializing argument 1 of 'void gText::Printf(const char*, ...)'
arduGmailNotifier.cpp: In function 'void loop()':
arduGmailNotifier:33: error: invalid conversion from 'byte' to 'const char*'
arduGmailNotifier:33: error: initializing argument 1 of 'void gText::Printf(const char*, ...)'
thank you very very much if you could help me out