 volatile unsigned long phaccu;   // pahse accumulator
 volatile unsigned long tword_m;  // dds tuning word m
 
+// LCD
+unsigned int xPos = 0;
+byte scopeBuf[478]; 
 /************************************ SETUP *****************************************************************/
 void setup()
 {
   // LCD setup - uses delay() and therefore must go before any interrupts
-  myGLCD.InitLCD();
+  LCD.InitLCD();
   
   // Audio setup
   pinMode(AUDIOPIN, OUTPUT); // output / frequency output

/************************************ LOOP ******************************************************************/
void loop()
{
  // LCD
  myGLCD.fillScr(VGA_RED);
  
  // Audio
  while(1) {
     if (c4ms > 250) {                 // timer / wait fou a full second
      c4ms=0;
      dfreq=analogRead(0);             // read Poti on analog pin 0 to adjust output frequency from 0..1023 Hz


  phaccu=phaccu+tword_m; // soft DDS, phase accu with 32 bits
  icnt=phaccu >> 24;     // use upper 8 bits for phase accu as frequency information
                         // read value fron ROM sine table and send to PWM DAC
  sig = pgm_read_byte_near(sine256 + icnt);
  OCR2A= sig;   
  // fill scope buffer
  scopeBuf[xPos] = sig - 160;
  xPos++;
  if (xPos > 478){ 
    xPos = 0;
  }
  
  if(icnt1++ == 125) {  // increment variable c4ms all 4 milliseconds
    c4ms++;
    icnt1=0;
   }   
}

/************************************** LCD FUNCTIONS *******************************************************/
void oscilloscope(){
  LCD.fillScr(VGA_RED); // clear screen
  LCD.setColor(VGA_WHITE); // set wave color
  for(int i = 1; i < 478; i++){
    //drawLine(x1, y1, x2, y2);
    LCD.drawLine(i-1, scopeBuf[i-1], i, scopeBuf[i]);
  }
}
