Sitting like 10 hours on my lcd. (128x64 graphic lcd). Im using the u8g Lib and could some 1 tell me how the *** you can clear the freaking Screen???
Things i already tried. Not working:
-u8g.firstPage();
-u8g.nextPage();
- Installing GLCD Lib and using its GLCD.clearScreen(); function.
HELP! How dare can a Lib Creator not implement a function to clear the Screen? Why does he have to make it soo hard...
My Code:
#include <U8glib.h>
const int speaker = 4;
const int b_1 = 7;
const int b_a = 6;
const int b_b = 5;
int wait = 0;
void clearScreen(){
u8g.drawBox(50, 50, 20, 10);
}
U8GLIB_ST7920_128X64 u8g(13, 11, 12, U8G_PIN_NONE);
void draw(void) {
u8g.drawCircle(20, 20, 10);
u8g.drawDisc(30, 30, 10);
u8g.drawLine(60, 30, 90, 50);
u8g.drawBox(50, 50, 20, 10);
}
void setup(void) {
pinMode(speaker,OUTPUT);
pinMode(b_1, INPUT);
pinMode(b_a, INPUT);
pinMode(b_b, INPUT);
u8g.firstPage();
do {
u8g.drawFrame(5, 5, 120, 54);
u8g.setFont(u8g_font_fub20);
u8g.drawStr(16, 43, "BersOS");
digitalWrite(speaker,HIGH);
delay(50);
digitalWrite(speaker,LOW);
} while( u8g.nextPage() );
delay(2000);
// Insert ClearScreen here
}
void loop(void) {
if(wait==0){
wait=1;
if(digitalRead(b_1) == HIGH){
digitalWrite(speaker, HIGH);
delay(20);
digitalWrite(speaker,LOW);
}
if(digitalRead(b_a) == HIGH){
digitalWrite(speaker, HIGH);
delay(20);
digitalWrite(speaker,LOW);
}
if(digitalRead(b_b) == HIGH){
digitalWrite(speaker, HIGH);
delay(20);
digitalWrite(speaker,LOW);
}
}
delay(150);
wait=0;
}