Question about using SR04, SRF05, SRF06, DYP-ME007 ultrasonic sensors on Teensy 3
Trying to use new ping library with SR04, SRF05, SRF06, DYP-ME007 - http://code.google.com/p/arduino-new-ping/
But obviously getting bunch of errors:
D:\stm32\arduino-1.0.3\libraries\NewPing\NewPing.cpp: In static member function 'static void NewPing::timer_us(unsigned int, void (*)())':
D:\stm32\arduino-1.0.3\libraries\NewPing\NewPing.cpp:151:2: error: 'OCR2A' was not declared in this scope
D:\stm32\arduino-1.0.3\libraries\NewPing\NewPing.cpp:152:2: error: 'TIMSK2' was not declared in this scope
D:\stm32\arduino-1.0.3\libraries\NewPing\NewPing.cpp:152:16: error: 'OCIE2A' was not declared in this scope
D:\stm32\arduino-1.0.3\libraries\NewPing\NewPing.cpp: In static member function 'static void NewPing::timer_ms(long unsigned int, void (*)())':
D:\stm32\arduino-1.0.3\libraries\NewPing\NewPing.cpp:167:2: error: 'OCR2A' was not declared in this scope
D:\stm32\arduino-1.0.3\libraries\NewPing\NewPing.cpp:168:2: error: 'TIMSK2' was not declared in this scope
D:\stm32\arduino-1.0.3\libraries\NewPing\NewPing.cpp:168:16: error: 'OCIE2A' was not declared in this scope
D:\stm32\arduino-1.0.3\libraries\NewPing\NewPing.cpp: In static member function 'static void NewPing::timer_stop()':
D:\stm32\arduino-1.0.3\libraries\NewPing\NewPing.cpp:177:2: error: 'TIMSK2' was not declared in this scope
D:\stm32\arduino-1.0.3\libraries\NewPing\NewPing.cpp:177:17: error: 'OCIE2A' was not declared in this scope
D:\stm32\arduino-1.0.3\libraries\NewPing\NewPing.cpp: In static member function 'static void NewPing::timer_setup()':
D:\stm32\arduino-1.0.3\libraries\NewPing\NewPing.cpp:195:2: error: 'ASSR' was not declared in this scope
D:\stm32\arduino-1.0.3\libraries\NewPing\NewPing.cpp:195:15: error: 'AS2' was not declared in this scope
D:\stm32\arduino-1.0.3\libraries\NewPing\NewPing.cpp:196:2: error: 'TCCR2A' was not declared in this scope
D:\stm32\arduino-1.0.3\libraries\NewPing\NewPing.cpp:196:15: error: 'WGM21' was not declared in this scope
D:\stm32\arduino-1.0.3\libraries\NewPing\NewPing.cpp:197:2: error: 'TCCR2B' was not declared in this scope
D:\stm32\arduino-1.0.3\libraries\NewPing\NewPing.cpp:197:15: error: 'CS22' was not declared in this scope
D:\stm32\arduino-1.0.3\libraries\NewPing\NewPing.cpp:198:2: error: 'TCNT2' was not declared in this scope
D:\stm32\arduino-1.0.3\libraries\NewPing\NewPing.cpp: At global scope:
D:\stm32\arduino-1.0.3\libraries\NewPing\NewPing.cpp:214:4: error: expected constructor, destructor, or type conversion before '(' token
Because this library using Atmega specific stuff.
What can I do to make this work?
Trying to use new ping library with SR04, SRF05, SRF06, DYP-ME007 - http://code.google.com/p/arduino-new-ping/
But obviously getting bunch of errors:
D:\stm32\arduino-1.0.3\libraries\NewPing\NewPing.cpp: In static member function 'static void NewPing::timer_us(unsigned int, void (*)())':
D:\stm32\arduino-1.0.3\libraries\NewPing\NewPing.cpp:151:2: error: 'OCR2A' was not declared in this scope
D:\stm32\arduino-1.0.3\libraries\NewPing\NewPing.cpp:152:2: error: 'TIMSK2' was not declared in this scope
D:\stm32\arduino-1.0.3\libraries\NewPing\NewPing.cpp:152:16: error: 'OCIE2A' was not declared in this scope
D:\stm32\arduino-1.0.3\libraries\NewPing\NewPing.cpp: In static member function 'static void NewPing::timer_ms(long unsigned int, void (*)())':
D:\stm32\arduino-1.0.3\libraries\NewPing\NewPing.cpp:167:2: error: 'OCR2A' was not declared in this scope
D:\stm32\arduino-1.0.3\libraries\NewPing\NewPing.cpp:168:2: error: 'TIMSK2' was not declared in this scope
D:\stm32\arduino-1.0.3\libraries\NewPing\NewPing.cpp:168:16: error: 'OCIE2A' was not declared in this scope
D:\stm32\arduino-1.0.3\libraries\NewPing\NewPing.cpp: In static member function 'static void NewPing::timer_stop()':
D:\stm32\arduino-1.0.3\libraries\NewPing\NewPing.cpp:177:2: error: 'TIMSK2' was not declared in this scope
D:\stm32\arduino-1.0.3\libraries\NewPing\NewPing.cpp:177:17: error: 'OCIE2A' was not declared in this scope
D:\stm32\arduino-1.0.3\libraries\NewPing\NewPing.cpp: In static member function 'static void NewPing::timer_setup()':
D:\stm32\arduino-1.0.3\libraries\NewPing\NewPing.cpp:195:2: error: 'ASSR' was not declared in this scope
D:\stm32\arduino-1.0.3\libraries\NewPing\NewPing.cpp:195:15: error: 'AS2' was not declared in this scope
D:\stm32\arduino-1.0.3\libraries\NewPing\NewPing.cpp:196:2: error: 'TCCR2A' was not declared in this scope
D:\stm32\arduino-1.0.3\libraries\NewPing\NewPing.cpp:196:15: error: 'WGM21' was not declared in this scope
D:\stm32\arduino-1.0.3\libraries\NewPing\NewPing.cpp:197:2: error: 'TCCR2B' was not declared in this scope
D:\stm32\arduino-1.0.3\libraries\NewPing\NewPing.cpp:197:15: error: 'CS22' was not declared in this scope
D:\stm32\arduino-1.0.3\libraries\NewPing\NewPing.cpp:198:2: error: 'TCNT2' was not declared in this scope
D:\stm32\arduino-1.0.3\libraries\NewPing\NewPing.cpp: At global scope:
D:\stm32\arduino-1.0.3\libraries\NewPing\NewPing.cpp:214:4: error: expected constructor, destructor, or type conversion before '(' token
Because this library using Atmega specific stuff.
What can I do to make this work?
Last edited: