Friday, November 6, 2009

004 beep frequency [arduino]














int value;
void setup(){
pinMode(2,OUTPUT);
}
void loop(){
value=analogRead(0);
digitalWrite(2,HIGH);
delayMicroseconds(value);//we are using smaller delay intervals [microseconds], to cause vibration fast enough to be heard.
digitalWrite(2,LOW);
delayMicroseconds(value);

}

No comments:

Post a Comment