kaynakkod
Üye
- Katılım
- 13 Haz 2013
- Mesajlar
- 59
- Puanları
- 1
Kod:
#include<LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
const int trig1=6;
const int echo1=7;
const int trig2=8;
const int echo2=9;
const int trig3=10;
const int echo3=13;
double sure1;
int sure2;
int sure3;
int X;
int Y;
int Z;
char d;
void setup()
{
pinMode(trig1,OUTPUT);
pinMode(echo1,INPUT);
pinMode(trig2,OUTPUT);
pinMode(echo2,INPUT);
pinMode(trig3,OUTPUT);
pinMode(echo3,INPUT);
lcd.begin(16,2);
lcd.clear();
Serial.begin(9600);
lcd.display();
}
void loop()
{
for(int o=0; o<200; o++)
{
digitalWrite(trig1,HIGH);
delay(1);
digitalWrite(trig1,LOW);
sure1=pulseIn(echo1,HIGH);
Y=(((sure1/2)/28,5*10)-67)*-1;
digitalWrite(trig2,HIGH);
delay(1);
digitalWrite(trig2,LOW);
sure2=pulseIn(echo2,HIGH);
X=(((sure2/2)/28.5*10)+10);
digitalWrite(trig3,HIGH);
delay(1);
digitalWrite(trig3,LOW);
sure3=pulseIn(echo3,HIGH);
Z=(((sure3/2)/28,5*10)-35);
}
lcd.home();
lcd.clear();
lcd.setCursor(0,0);
lcd.print("X=");
lcd.print(Px);
Serial.println("X=");
Serial.println(X);
lcd.print("mm");
lcd.home();
lcd.setCursor(8.0);
lcd.print("Y=");
lcd.print(Py);
Serial.println("Y=");
Serial.println(Y);
lcd.print("mm");
lcd.home();
lcd.setCursor(0,1);
lcd.print("Z=");
lcd.print(Pz);
Serial.println("Z=");
Serial.println(Z);
lcd.print("mm");
lcd.setCursor(8,1);
lcd.print("PLATE 1");
if(Serial.available()>0)
d=Serial.read();
if(d=='a')
{
Serial.print(X);
Serial.print(Y);
Serial.print(Z);
delay(100);
}
}
YUKARIDAKİ KODDA BU HATAYI ALIYORUM .HATA AŞAĞIDA. ŞU LİNK'DEKİ PROJENİN AYNISINI YAPMAK İSTİYORUM FAKAT ARDUİNO KISMINDA BU HATAYI ALIYORUM VİDEODAKİ KOD ÇALIŞIYOR.
VİDEO LİNKİ =(
Kod:
C:\Users\doÄŸantekin\Documents\Arduino\PPP_kartezyen_robot\PPP_kartezyen_robot.ino: In function 'void loop()':
PPP_kartezyen_robot:68: error: 'Px' was not declared in this scope
PPP_kartezyen_robot:75: error: no matching function for call to 'LiquidCrystal::setCursor(double)'
C:\Users\doÄŸantekin\Documents\Arduino\PPP_kartezyen_robot\PPP_kartezyen_robot.ino:75:18: note: candidate is:
In file included from C:\Users\doÄŸantekin\Documents\Arduino\PPP_kartezyen_robot\PPP_kartezyen_robot.ino:1:0:
C:\Program Files (x86)\Arduino\libraries\LiquidCrystal\src/LiquidCrystal.h:82:8: note: void LiquidCrystal::setCursor(uint8_t, uint8_t)
void setCursor(uint8_t, uint8_t);
^
C:\Program Files (x86)\Arduino\libraries\LiquidCrystal\src/LiquidCrystal.h:82:8: note: candidate expects 2 arguments, 1 provided
PPP_kartezyen_robot:78: error: 'Py' was not declared in this scope
PPP_kartezyen_robot:88: error: 'Pz' was not declared in this scope
exit status 1
'Px' was not declared in this scope
Moderatör tarafında düzenlendi: