// Arduino based metal detector // (C)Dzl july 2013 // http://dzlsevilgeniuslair.blogspot.dk/ // Connect search coil oscillator (20-200kHz) to pin 5 // Connect piezo between pin 13 and GND // Connect NULL button between pin 12 anf GND // REMEMBER TO PRESS NULL BUTTON AFTER POWER UP!! #define SET(x,y) (x |=(1<10000) clf=10000; FTW=clf; } //-Click generator if(millis()>timer) { timer+=10; PCW+=FTW; if(PCW&0x8000) { digitalWrite(13,HIGH); PCW&=0x7fff; } else digitalWrite(13,LOW); } }