#include LiquidCrystal lcd(12, 11, 5, 4, 3, 2); int up=7; //yukarı butonu D7 int down=9; //aşağı butonu D9 int sel=1; //OK butonu D1 //frekans çıkışı D10 void setup() { lcd.begin(16, 2); lcd.print("ENGINEERS GARAGE"); pinMode(up, INPUT); pinMode(down, INPUT); pinMode(sel, INPUT); } void loop() { int counter=0; char name[][20]= {"Altin-1","Altin-2","Altin-3","Altin-4","Altin-5","Altin-6","Gumus-1","Gumus-2","Bronz-1", "Bakir","Elmas","Altin-7","Fosfor-Dis","Fosfor-Kemik","Bosluk","Aluminyum","Mucevher-1","Genel-1","Kursun-1","Kursun-2","Altin-14", "Su"}; int data[20]={4900,5000,5100,5200,5252,5300,8700,8950,11311,12700,12700,55000,14000,24520,4830,10000}; int up_state,down_state,sel_state,last_sel_state,last_up_state,last_down_state,last_counter; Serial.begin(9600); counter = counter%20; up_state=digitalRead(up); down_state=digitalRead(down); sel_state=digitalRead(sel); if (up_state != last_up_state) { if (up_state == HIGH) { counter++; } } last_up_state = up_state; if (down_state != last_down_state) { if (down_state == HIGH) { counter--; } } last_down_state = down_state; if (sel_state != last_sel_state) { if (sel_state == HIGH) { Serial.println(name[counter]); Serial.println(data[counter]); tone(10,data[counter]); } } last_sel_state = sel_state; if (counter!=last_counter) { Serial.println(name[counter]); } last_counter=counter; for (int i=0;i<20;i++) { Serial.println(data[i]); } // stop the waveform and start with the new analog input value }