   }
 
   // Print the interrupt counter
-  TRACE(counter);
+  TRACE(intPin.get_counter());
 }

#include "Cosa/Trace.hh"
#include "Cosa/Memory.h"

// Callback for interrupt pin(2); updates a counter
volatile uint16_t counter = 0;

void do_interrupt(InterruptPin* pin, void* env)
{
  counter++;
}

// Input and output pins
InterruptPin intPin(2, InterruptPin::ON_RISING_MODE, do_interrupt);
PWMPin ledPin(5);
InputPin onoffPin(7);
AnalogPin tempVCC(8, AnalogPin::A1V1_REFERENCE);

  TRACE(sizeof(Pin));
  TRACE(sizeof(InputPin));
  TRACE(sizeof(InterruptPin));
  TRACE(sizeof(CounterInterruptPin));
  TRACE(sizeof(AnalogPin));
  TRACE(sizeof(OutputPin));
  TRACE(sizeof(PWMPin));
