Ardunio kodumdaki hata nedir?

342524

Hectopat
Katılım
1 Haziran 2020
Mesajlar
7.167
Makaleler
3
Çözümler
20
Hata Kodu:
Arduino:1.8.19 (Windows 10), Kart:"Arduino Uno"

Kod:
C:\Users\Oneri\Desktop\sketch_jan13a\sketch_jan13a\sketch_jan14a\sketch_jan14a\sketch_jan14a\sketch_jan14a\sketch_jan14a\sketch_jan14a.ino: In function 'void loop()':



sketch_jan14a:18:32: error: too few arguments to function 'long int map(long int, long int, long int, long int, long int)'



  derece = map(deger, 0,1023,180);



                                ^



In file included from sketch\sketch_jan14a.ino.cpp:1:0:



C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:254:6: note: declared here



 long map(long, long, long, long, long);



      ^~~



exit status 1



too few arguments to function 'long int map(long int, long int, long int, long int, long int)'







This report would have more information with

"Show verbose output during compilation"

option enabled in File -> Preferences.

Yazdığım Kod:

#include <Servo.h>



Servo motor;



int deger;

int derece;



void setup() {



  motor.attach(3);

 



}



void loop() {



  deger = analogRead(A0);

  derece = map(deger, 0,1023,180);

  motor.write(derece);



}
 
Son düzenleyen: Moderatör:
C++:
map(deger, 0, 1023, 0, 180)
Dereceyi atadigin map fonksiyonunu bu sekilde degistirip dener misin? Bu fonksiyon 5 arguman aliyor ancak sen 4 adet deger girmissin.

C++:
map(value, fromLow, fromHigh, toLow, toHigh) //fonksiyon bu sekilde yazilmali
 

Yeni konular

Geri
Yukarı