i should generate a "beep-beep" from 1Hz to 20Hz.
I assume that's the on/off frequency, not the audio frequency?
i don't wrote a code because i don't know "how". This is the problem!
If your audio frequency is in the range of tone() it shouldn't be too hard to modify the Blink example to get a "beep - beep" sound. If you're "multi-tasking" and delay() is going to mess-up whatever-else your program is doing, start with the Blink Without Delay example.
Then, add an if-statement to turn the beeping on or off. The Button Example shows how a simple if-statement works.
Once that works, you should be able to duplicate that code with a different if-condition and a different beep sound. (You may need some additional and/or logic in case both if-conditions can be true.)
don't wrote a code because i don't know "how". This is the problem!
Programming is NOT EASY! But if you're going to learn, the Arduino is one of the easiest ways to get started! (The BEST way to learn ANYTHNG is take a class.*)
Don't try to write the whole program at once. Start-out with the smallest/simplest program and then "develop" your code by writing one or two lines of code at time, test-compiling and test-running as you go. It's often helpful to send-out Serial.print() messages so you can "see" variables or you can "see" what the program is doing.
Even professional programmers don't write the whole program at once. They write and test in sections.
It's usually better to work on the input & output separately. For example, a beeper is output and you can write the for the beeper first and test the beeper software & hardware totally under software-control (without any input). Then you can add the switches/buttons/pots, or whatever controls the beeper and work on the software for it.
It's up to you what you want to work-on first. You might what to start with whatever is easy, or you might want to start with something that needs experimentation... If you're not sure if the beeper is going to "sound right" or if it's going be loud enough, etc., you might want to experiment with that part first. Or sometimes you need one thing working before you can test another thing.
Sometimes, you might want to write some test-code that won't end-up in your final project. And, sometimes you might build hardware that's not part of your final project... Maybe a pot to simulate a temperature sensor, or LEDs in place of motors, etc.
- The biggest thing you're missing when you try to teach yourself from books or from the Internet, is that they usually cover the programming language without teaching you the concepts or "how to program".
I think most people on this forum learned on their own. I've had a couple of programming classes but I learned C/C++ from a book (the Arduino stuff from the Internet) but I'm not an expert propgrammer.
Most professional programmers took programming in college (even if they didn't major in computer science). I've known one professional programmer who didn't graduate from high school. I don't know if he ever took a programming class or if he was completely self-taught. (And, I've known one electrical engineer who didn't have an engineering degree.)