I'm quite happy to have gotten my t6883c gLCD working with my mega32 this afternoon. It seems I need to clear the JTAGEN fuse and then things started working nicely.
I'm using the libraries from
http://en.radzio.dxp.pl/t6963/
and reading a value in from an ADC then drawing the result, however everything draws on top of the previous values. aside from clearing the screen before each draw how can i prevent this?
here's my code so far...
machs@electric-monk:~/avr_projects/code$ cat accelTest001.c #include#include "T6963C.h" #include "Graphic.h" #include "adcSingle.h" void updateDisplay(void); void updateDisplayGraph(void); const char accelXString[9]; const char accelYString[9]; #define axisXScaler (GLCD_PIXELS_PER_LINE / 255) #define axisYScaler (GLCD_NUMBER_OF_LINES / 255) int main(void) { adcInit(); sei(); //enable global interupts adcSingleConversion(); GLCD_Initalize(); // Initalize LCD GLCD_ClearText(); // Clear text area GLCD_ClearCG(); // Clear character generator area GLCD_ClearGraphic(); // Clear graphic area GLCD_TextGoTo(0,0);// set text coordinates GLCD_WriteString("http://en.radzio.dxp.pl/t6963/"); // write text while(1){ updateDisplayGraph(); }; return 0; } void updateDisplayText(void){ //GLCD_ClearText(); // Clear text area itoa(adcValue0, accelYString, 10); itoa(adcValue1, accelXString, 10); GLCD_TextGoTo(0,1);// set text coordinates GLCD_WriteString(accelXString); // write text GLCD_TextGoTo(0,2);// set text coordinates GLCD_WriteString(accelYString); // write text } void updateDisplayGraph(void){ //char width = 8; //char startY = (GLCD_NUMBER_OF_LINES - width )/2; //char startX =0; char length = adcValue0; GLCD_Rectangle ( 0 , 28, length, 8); } machs@electric-monk:~/avr_projects/code$
I've read a bit about using the display's on board RAM and seem to remember something about double buffering from a CS course but am at a lost as where to begin.
thanks