Example sketch
Hi-
I'm running into the below error when I try to compile the EventTimer example sketch. I'm trying to compile it for the Arduino Gemma (https://www.adafruit.com/product/2470) board. The vanilla example builds fine, and the EventTimer sketch builds fine using an Uno board. I assume this prob has to do with the Gemma using a diff chip
NewPingEventTimer.pde: In function 'void loop()': NewPingEventTimer:32: error: 'class NewPing' has no member named 'ping_timer' NewPingEventTimer.pde: In function 'void echoCheck()': NewPingEventTimer:39: error: 'class NewPing' has no member named 'check_timer' 'class NewPing' has no member named 'ping_timer'
Comments (3)
-
repo owner -
repo owner - changed status to resolved
Library is working correctly. Disables timer methods because the ATtiny doesn't support them. This is a hardware limitation of the ATtiny, not NewPing.
-
repo owner - marked as trivial
- Log in to comment
You can't use the timer methods with the ATtiny microcontroller. My library detects that you're running an ATtiny and disables the timer methods, which is why it's reporting that it can't find the methods: ping_timer and check_timer.
Basically, the microcontroller on the Gemma doesn't support what you're trying to do. NewPing will only work with the non-timer methods on the ATtiny (microcontroller limitation, not NewPing). The library is working correctly by disabling those methods. If it didn't disable those methods, you couldn't compile the non-timer methods (like using ping() or ping_median() which is fully supported).
See the NewPingExample sketch, that will compile (once you remove the Serial stuff as the ATtiny84 doesn't support that either). Or, this sketch as a starter (which you'll need to expand to do what you want with the cm variable.