I want to make a timer library. The cpp file I have written is:
#include "avr/interrupt.h"
#include "Arduino.h"
#include "AllTimer.h"
AllTimer::AllTimer()
{}
void AllTimer::dofun(void)
{
TIFR1 |= _BV(OCF1A);
TCCR1B = 0X00;
digitalWrite(13,!digitalRead(13));
}
void AllTimer::setTimer(void)
{
TCNT1 = 0x0BDC;
TCCR1A = 0x00;
TCCR1B = 0x00;
TCCR1B |= (1<<CS12) && (1<<CS10);
TIMSK1 |= (1<<TOIE1);
sei();
}
ISR (TIMER1_OVF_vect)
{
dofun();
}
And the header file:
#ifndef AllTimer_h
#define AllTimer_h
class AllTimer{
public:
AllTimer();
void setTimer(void);
private:
void dofun(void);
};
#endif
While compiling the file i am getting the following error:
sketch_jan05a.cpp: In function ‘void __vector_13()’:
sketch_jan05a.cpp:34:9: error: ‘dofun’ was not declared in this scope
readTouchscreenParamsGeneric
in header vsreadTouchScreenParamsGeneric
in cpp. Generates the same error message. Doing a search all, case-insensitive, led me to believe I had made no typos.... when in doubt, also turn on case-sensitive search.