Closed charlespax closed 10 years ago
Yes, you can do that by creating a custom board by modifying the boards.txt file.
But is there a way to change it from within an Arduino sketch
In boards.txt the clock is defined by the line "
Then platform.txt that value is passed to the compiler by the argument "-DF_CPU={build.f_cpu}".
In the Arduino sketch can we redefine that value with a line like this?
I'll do a quick test. It shouldn't matter if we're using the ATtiny and not using the Arduino IDE, but I'm still curious.
Unfortunately, no, it cannot.
If we clock the processor at 12 MHz, it would be good if we can redefine the clock frequency through the Arduino IDE, so all the timers are correct.