Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int beep=13;
- void setup()
- {
- Serial.begin(9600);
- pinMode(beep, OUTPUT);
- }
- void Beep();
- void SerialPrint();
- //**************************************
- void loop()
- {
- int n=10000;
- for (int i=10; i<n; i+=10)
- {
- for(int j=0;j<(n-i)/10;j++)
- {
- Beep(i);
- //SerialPrint(n,i,j);
- }
- }
- }
- //*************************************
- void Beep(int P)
- {
- digitalWrite(beep, HIGH); // turn the LED on (HIGH is the voltage level)
- delayMicroseconds(P);
- //delay(P); // wait for a second
- digitalWrite(beep, LOW); // turn the LED off by
- //delay(P); // wait for a second
- delayMicroseconds(P);
- }
- void SerialPrint(int N, int I, int J)
- {
- Serial.print (N);
- Serial.print ("_");
- Serial.print (I);
- Serial.print ("_");
- Serial.println (J);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement