expected initializer before 'void' hatası çözümü acil

Bu konuyu okuyanlar

Hikmet Türkkal

Öğrenci
Katılım
2 Ara 2020
Mesajlar
1
Reaksiyon puanı
0
Puanları
1
Yaş
15
#define echoPin 6
#define trigPin 7
#define buzzerPin 8
#define led 11

int maximumRange = 50;
int minimumRange = 0;
int distance


void setup()
{


pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
pinMode(led, OUTPUT);
}
}

void loop()
{

int olcum = mesafe(maximumRange, minimumRange);
melodi(olcum*10);
if(olcum!= 0)
{


digitalWrite(led, LOW);
if(olcum < 15)
{
digitalWrite(led, HIGH);

}
else
{
digitalWrite(led,LOW);
}
}
}
}
int mesafe(int maxrange, int minrange)
{long duration, distance;

digitalWrite(trigPin,LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);

duration = pulseIn(echoPin,HIGH);
distance = duration / 58.2;
delay(50);
}








int mesafe()
{
long sure, uzaklik;

digitalWrite(trigPin,LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);

sure = pulseIn(echoPin,HIGH);
uzaklik = sure / 58.2 ;
delay(50);

if(distance >= maxrange || distance <= minrange)
return 0;
return distance;
}

int melodi(int miggy)

{
tone(buzzerPin, 440);
delay(miggy);
noTone(buzzerPin);
delay(miggy) ;
}
 
Üst