   }
 
   // set PWM duty cycle
-  OCR2 = calcAmp();
+  OCR0A = calcAmp();
 }

  // setup pins for output
  //pinMode(3, OUTPUT);
  //pinMode(13, OUTPUT);
  DDRD = _BV(7);

  // setup counter 2 for fast PWM output on pin 3 (arduino)
  //TCCR2A = _BV(COM2B1) | _BV(WGM21) | _BV(WGM20);

  //TIMSK2 = _BV(TOIE2);
  
  // teensy
  TCCR0A = _BV(COM0A1) | _BV(WGM01) | _BV(WGM00);
  TCCR0B = _BV(CS01);
  TIMSK0 = _BV(TOIE0); /* maybe also: _BV(OCIE0A) */

  // begin serial communication
  Serial.begin(9600);
