Hello,
I'm new here and with Arduino
I have my pcb's on that i use differents cristal frequencies.
Like i said i'm new with Arduino, i come from Bascom and PBP Pro world
On this languages, we can write the cristal frequencies that we want use on a pcb
Now my question is, where can i write in Arduino code the desired frequency for the CPU?
There are 2 predominant frequencies used in Arduinos, 16MHz and 8MHz. It is OK to use other frequencies, but your results in using pre-made libraries may vary if you do. The frequency of your processor is provided at the compile time as a command line option when you compile. If you are using the Arduino IDE, that setting is in the boards.txt file that is part of the IDE installation. So, you do not need to set the frequency in the code.
If you are using a board with ATmega328P processor, the board selection Uno is for 16MHz. Pro Mini has a submenu allowing you to choose 16MHz or 8MHz.