Derleme hatası: "function definition does not declare parameters"

Arkadaşlar merhaba sitenizi yeni keşfettim. Yapmak istediğim bir proje var. Yalnız kodlamada sıkıntı yaşıyorum. Daha önce arduino.cc sitesinde sormuştum. Ama ingilizce bir yere kadar. Sanırım burada bana yardımcı olabilecek arkadaşlar var. Hata ayıklamada sonuna geldim gibi. Bir hata veriyor çözemedim. Konu linki: http://arduino.cc/forum/index.php/topic,158775.0.html Bu noktadan sonra ne yapmam lazım? hata: Ping3.cpp:54: error: function definition does not declare parameters Hata verdiği kısım: void Ping3:fire() { // Trigger US-100 to start measurement // Set up trigger digitalWrite(triggerPin,LOW); delayMicroseconds(5); // Start Measurement digitalWrite(triggerPin,HIGH); delayMicroseconds(10); digitalWrite(triggerPin,LOW); // Acquire and convert to mtrs _m_distance=distance*0.0001 _m_distance=pulseIn(echoPin,HIGH); }

void Ping3:fire() satırını void Ping3::fire() ile değiştirip dener misin?

Daha önce denedim alperian hata verdi. Şu hatayı veriyor: Ping3.cpp: In member function ‘void Ping3::fire()’: Ping3.cpp:69: error: expected `;’ before ‘_m_distance’ verdiği yer şurası: // Acquire and convert to mtrs _m_distance=distance*0.0001 _m_distance=pulseIn(echoPin,HIGH); }

her komut ; ile bitirilmesi gerekir. _m_distance=distance*0.0001 satırının sonuna ; ekleyip. _m_distance=distance*0.0001 ; yaparsan sorun çözülür.

Onu da denedim. Hataların sayısı artıyor: E:\Documents and Settings\Fatih ŞIVKIN\Desktop\arduino-1.0.2\libraries\Ping3\Ping3.cpp:45: error: prototype for ‘Ping3::Ping3(int, double, double)’ does not match any in class ‘Ping3’ E:\Documents and Settings\Fatih ŞIVKIN\Desktop\arduino-1.0.2\libraries\Ping3/Ping3.h:30: error: candidates are: Ping3::Ping3(const Ping3&) E:\Documents and Settings\Fatih ŞIVKIN\Desktop\arduino-1.0.2\libraries\Ping3/Ping3.h:33: error: Ping3::Ping3(int, int, double, double) E:\Documents and Settings\Fatih ŞIVKIN\Desktop\arduino-1.0.2\libraries\Ping3\Ping3.cpp:33: error: Ping3::Ping3(int, int) E:\Documents and Settings\Fatih ŞIVKIN\Desktop\arduino-1.0.2\libraries\Ping3\Ping3.cpp: In member function ‘void Ping3::fire()’: E:\Documents and Settings\Fatih ŞIVKIN\Desktop\arduino-1.0.2\libraries\Ping3\Ping3.cpp:59: error: ‘triggerPin’ was not declared in this scope E:\Documents and Settings\Fatih ŞIVKIN\Desktop\arduino-1.0.2\libraries\Ping3\Ping3.cpp:68: error: ‘_m_distance’ was not declared in this scope E:\Documents and Settings\Fatih ŞIVKIN\Desktop\arduino-1.0.2\libraries\Ping3\Ping3.cpp:68: error: ‘echoPin’ was not declared in this scope E:\Documents and Settings\Fatih ŞIVKIN\Desktop\arduino-1.0.2\libraries\Ping3\Ping3.cpp:69: error: ‘distance’ was not declared in this scope E:\Documents and Settings\Fatih ŞIVKIN\Desktop\arduino-1.0.2\libraries\Ping3\Ping3.cpp:71: error: expected `;’ before ‘}’ token E:\Documents and Settings\Fatih ŞIVKIN\Desktop\arduino-1.0.2\libraries\Ping3\Ping3.cpp: In member function ‘int Ping3::microseconds()’: E:\Documents and Settings\Fatih ŞIVKIN\Desktop\arduino-1.0.2\libraries\Ping3\Ping3.cpp:78: error: ‘_m_distance’ was not declared in this scope E:\Documents and Settings\Fatih ŞIVKIN\Desktop\arduino-1.0.2\libraries\Ping3\Ping3.cpp: In member function ‘double Ping3::inches()’: E:\Documents and Settings\Fatih ŞIVKIN\Desktop\arduino-1.0.2\libraries\Ping3\Ping3.cpp:84: error: ‘_m_distance’ was not declared in this scope E:\Documents and Settings\Fatih ŞIVKIN\Desktop\arduino-1.0.2\libraries\Ping3\Ping3.cpp: In member function ‘double Ping3::centimeters()’: E:\Documents and Settings\Fatih ŞIVKIN\Desktop\arduino-1.0.2\libraries\Ping3\Ping3.cpp:90: error: ‘_m_distance’ was not declared in this scope

void Ping3:fire() satırını void Ping3::fire() yaparsam hataların sayısı 1 'e düşüyor. Ping3.cpp:54: error: function definition does not declare parameters hata verilen kısım: void Ping3:fire()

class ve contructor yapılarını düzgün olarak modifiye edememişsiniz. Aşağıda hata vermeyen kütüphaneler var. Ping3.h ----- /* Ping 3 library. Hacking up to make equivalent to Caleb’s Ping library. Steve Struebing Steve@polymythic.com Jan 26, 2013 Ping2.cpp - Library for using Ping2))) Sensors with Arduino - Version 2 Copyright (c) 2009 Caleb Zulawski. All right reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ //#ifndef Ping3_h //#define Ping3_h include “Arduino.h” class Ping3 { public: Ping3(int triggerPin, int echoPin); Ping3(int pin, double in, double cm); void fire(); int microseconds(); double inches(); double centimeters(); int triggerPin; int echoPin; int distance; private: int _triggerPin; int _echoPin; double _in; double _cm; long _duration; long _m_distance; int _pin; }; //#endif ________________________ Ping3.cpp __________________________________ /* Hacking up to make US-100 like Parallax ping))) library Steve Struebing Steve@polymythic.com Jan 26, 2013 http://www.e-gizmo.com/KIT/images/gizDuino%20X/gizDuino%20X%20hardware%20manual.pdf http://www.e-gizmo.com/KIT/images/ultrasonicsonar/ultrasonic%20sonar%20module%201r0.pdf Ping3.cpp - Library for using Ping2))) Sensors with Arduino - Version 2 Copyright (c) 2009 Caleb Zulawski. All right reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ include “Arduino.h” include “Ping3.h” Ping3::Ping3(int triggerPin, int echoPin) { pinMode(triggerPin , OUTPUT); pinMode(echoPin, INPUT); _triggerPin = triggerPin; _echoPin = echoPin; _in = 0; _cm = 0; _duration = -1; } Ping3:: Ping3(int pin, double in, double cm) { pinMode(pin, OUTPUT); _pin = pin; _in = in; _cm = cm; _duration = -1; } void Ping3::fire() { // Trigger US-100 to start measurement // Set up trigger digitalWrite(triggerPin,LOW); delayMicroseconds(5); // Start Measurement digitalWrite(triggerPin,HIGH); delayMicroseconds(10); digitalWrite(triggerPin,LOW); // Acquire and convert to mtrs _m_distance=pulseIn(echoPin,HIGH); _m_distance=distance*0.0001; } int Ping3::microseconds() { // Run the math backwards to generate what would have // been the parallax duration return (_m_distance *2 * (29 + _cm)); } double Ping3::inches() { // We’re native meters, so do the conversion return (_m_distance /100) * 0.3937; } double Ping3::centimeters() { return (_m_distance /100); } __________________________________