Does anyone have any success stories of using the NewPing library for multiple sensors on a Teensy 4.0 ?
I was really excited when I found the NewPing library, because I am trying to read many ultrasonic sensors at once! Ive tried in the past to do this and gave up so this library seemed like it might be a some magic for me, buttt i seem to have a problem compiling the example sketch that uses multiple sensors.
So I load up the 'NewPing15SensorsTimer' example sketch that is included in the NewPing library found here: https://bitbucket.org/teckel12/arduino-new-ping/wiki/Home
and get an error like this
well i did some searching and it seems like others have had this problem, and it is reported to be solved with this updated library for Teensy 4.0
https://github.com/mjs513/NewPing_t4
but when I try this library i get this error where it can't find the check_timer , timer_stop , and ping_timer functions. :
I've tried messing around in the .h file, but I really dont know C++ that well sooo needless to say I can't make it work. Does anyone have any suggestions? Am I missing something?
Thank you!
I was really excited when I found the NewPing library, because I am trying to read many ultrasonic sensors at once! Ive tried in the past to do this and gave up so this library seemed like it might be a some magic for me, buttt i seem to have a problem compiling the example sketch that uses multiple sensors.
So I load up the 'NewPing15SensorsTimer' example sketch that is included in the NewPing library found here: https://bitbucket.org/teckel12/arduino-new-ping/wiki/Home
and get an error like this
Code:
C:\Users\moogtron 4k\Documents\Arduino\libraries\NewPing\src\NewPing.cpp: In constructor 'NewPing::NewPing(uint8_t, uint8_t, unsigned int)':
C:\Users\moogtron 4k\Documents\Arduino\libraries\NewPing\src\NewPing.cpp:19:17: error: cannot convert 'volatile uint32_t* {aka volatile long unsigned int*}' to 'volatile uint8_t* {aka volatile unsigned char*}' in assignment
_triggerOutput = portOutputRegister(digitalPinToPort(trigger_pin)); // Get the output port register for the trigger pin.
^
C:\Users\moogtron 4k\Documents\Arduino\libraries\NewPing\src\NewPing.cpp:20:13: error: cannot convert 'volatile uint32_t* {aka volatile long unsigned int*}' to 'volatile uint8_t* {aka volatile unsigned char*}' in assignment
_echoInput = portInputRegister(digitalPinToPort(echo_pin)); // Get the input port register for the echo pin.
^
Using library NewPing at version 1.9.1 in folder: C:\Users\moogtron 4k\Documents\Arduino\libraries\NewPing
Error compiling for board Teensy 4.0.
well i did some searching and it seems like others have had this problem, and it is reported to be solved with this updated library for Teensy 4.0
https://github.com/mjs513/NewPing_t4
but when I try this library i get this error where it can't find the check_timer , timer_stop , and ping_timer functions. :
Code:
C:\Users\moogtron 4k\Documents\Arduino\libraries\NewPing_t4-master\examples\NewPing15SensorsTimer/NewPing15SensorsTimer.pde:65: undefined reference to `NewPing::check_timer()'
C:\Users\MOOGTR~1\AppData\Local\Temp\arduino_build_837948\sketch\NewPing15SensorsTimer.pde.cpp.o: In function `loop':
C:\Users\moogtron 4k\Documents\Arduino\libraries\NewPing_t4-master\examples\NewPing15SensorsTimer/NewPing15SensorsTimer.pde:55: undefined reference to `NewPing::timer_stop()'
C:\Users\moogtron 4k\Documents\Arduino\libraries\NewPing_t4-master\examples\NewPing15SensorsTimer/NewPing15SensorsTimer.pde:58: undefined reference to `NewPing::ping_timer(void (*)(), unsigned int)'
collect2.exe: error: ld returned 1 exit status
Using library NewPing_t4-master at version 1.9.0 in folder: C:\Users\moogtron 4k\Documents\Arduino\libraries\NewPing_t4-master
Error compiling for board Teensy 4.0.
I've tried messing around in the .h file, but I really dont know C++ that well sooo needless to say I can't make it work. Does anyone have any suggestions? Am I missing something?
Thank you!