 // play value on analog out pin
 void play_level(void) { 
 
-  // toggle wave skew value
+  // toggle waves
   if (step >= INT_FREQ * 2) {
-    if (wave.getSkew() == 2.0) {
-      wave.setSkew(8.0);
-      wave.compute();
-      debug = 8.0;
+    if (pwave == &wave1) {
+      pwave = &wave2;
+      debug = 1;
     } else {
-      wave.setSkew(2.0);
-      wave.compute();
-      debug = 2.0;
+      pwave = &wave1;
+      debug = 2;
     }
     step = 0;
   }
   
-  if (time >= wave.getPeriod()) {
-    time = time - wave.getPeriod();
+  if (time >= pwave->getPeriod()) {
+    time = time - wave1.getPeriod();
   }
 
-  double val = wave.approx(time) * 2000 + 2000; // help with dc offset
+  double val = pwave->approx(time) * 2000 + 2000; // help with dc offset
   analogWrite(outPin, val);
 
-  debug = val;
+  /* debug = val; */
   
   time = time + interrupt_callback_time;
   step++;

  pinMode(ledPin, OUTPUT);
  pinMode(outPin, OUTPUT);

  wave.init(20);
  wave.compute();
  
  Serial.begin(115200);
  Serial.println("serial on");

double interrupt_callback_time = (double) (1.0 / INT_FREQ);

// use volatile for shared variables
volatile unsigned int step = 0;
volatile double time = 0;
volatile double debug;

IntervalTimer myTimer; // init Teensy timer
asymmetry::ATrianglewave wave1;
asymmetry::ATrianglewave wave2;
asymmetry::ATrianglewave *pwave;

void setup() {
  analogWriteResolution(12); // 12bit = 4096 levels (max is 13 bit)
