Does NewPing support ATTiny13?
Hi, Firstly thank you so such a great library but I am trying to get my HCSR04 sensor work ATTiny13? Does your library support this? I am able to compile the code for ATTiny85 but not for ATTiny13.
Errors I get are below: C:\My Documents\Circuits\Sketches\libraries\NewPing-1.9.1\src\NewPing.cpp: In static member function 'static void NewPing::timer_us(unsigned int, void (*)())': C:\My Documents\Circuits\Sketches\libraries\NewPing-1.9.1\src\NewPing.cpp:254:3: error: 'OCR2A' was not declared in this scope OCR2A = min((frequency>>2) - 1, 255); // Every count is 4uS, so divide by 4 (bitwise shift right 2) subtract one, then make sure we don't go over 255 limit.
Comments (4)
-
repo owner -
repo owner - changed status to resolved
Change
#define TIMER_ENABLED true
tofalse
in theNewPing.h
file. This is designed for you to change as needed. -
reporter Great! , I did not notice that. I made the change and it works well now. Also, can you tell if disabling timers preserves the accuracy of results?
-
repo owner Has nothing to do with accuracy. It has to do with using the methods that use a timer, which isn't available on the Tiny as it doesn't have the timers needed.
- Log in to comment