Hello,
i have been trying to write a Library, which sends me a Message over USB every few milliseconds ... but it does not work
is Timer2 needed for USB Connection?
- - - - - - - - - - - - - - - - - - -timerlib.h:
#ifndef timerlib_h
#define timerlib_h
#include "WProgram.h"
void core();
void start();
#endif
- - - - - - - - - - - - - - - - - - - -timerlib.cpp:
#include <timerlib.h>
void core(void){
SerialUSB.println("hello!");
}
void start(void){
Timer2.setChannel1Mode(TIMER_OUTPUTCOMPARE);
Timer2.setPeriod(50000); // in microseconds
Timer2.setCompare1(1); // overflow might be small
Timer2.attachCompare1Interrupt(core);
}