Go Down

Topic: NewPing and Makeblock (Read 44 times) previous topic - next topic

bombicri

I have Ultimate 2 kit. I built the Makeblock Robotic Arm Tank and I mounted on it 2 motorized ultrasonic sensors HC-SR04 and 1 Me Ultrasonic Sensor. After finishing the mechanical work I started to learn and understand how to program it. From the start I have a problem.
It is said that if I use NewPing Library for HC-SR04 that is possible to conect together "transmit" and "receive" pins of the sensor and to use, in this way, only one signal pin from MegaPi board (1 pin per sensor) beside the +5V and GND pins.
The problem is that when I tried to include NewPing Library in Arduino IDE I got a compilation error. See the image below.

Is any possibility to solve this problem?
I am very in the beginning with my programming skills.
Thanks.

Experienced Dilettante

pert

Don't post screenshots of text! That is very unhelpful. When you encounter an error you'll see a button on the right side of the orange bar "Copy error messages". Click that button. Paste the error in a message here USING CODE TAGS (</> button on the toolbar). It is almost never appropriate to post screenshots but in some cases it is helpful to post images. You should attach and embed the image following these instructions:
http://forum.arduino.cc/index.php?topic=364156

When you encounter an error you'll see a button on the right side of the orange bar "Copy error messages". Click that button. Paste the error in a message here using code tags.

To fix the problem:
  • File > Examples > NewPing > NewPing15Sensors
  • Sketch > Show sketch folder - this will open the NewPing15Sensors example sketch folder
  • Navigate up two folder levels to the NewPing folder
  • Open the file NewPing.h in a text editor. If you're using NewPing 1.9.0 you will find NewPing.h at NewPing/src/NewPing.h.
  • Find the line:

Code: [Select]
#define TIMER_ENABLED true
change it to:
Code: [Select]
#define TIMER_ENABLED false
  • Save the file


Note that you will no longer be able to use the NewPing library's ping_timer() function after doing this.

bombicri

Thank you @pert for all.
Problem solved.
compilation is now without errors.
Concerning ping_timer() I shall discover in future if is needed or not.

Concerning advises, I have to thank you also, now will be easier for me to post questions about errors.
Experienced Dilettante

Go Up