Set clockspeed of Arduino Pro Micro a. k. a. AtMega32u4 Is it possible to change clock speed when running sketch?

Low-power lib drops the current consumption from 20mA to 9.5mA at 8MHz, it is still too much. Is there a way how to set clockspeed (for example) to 1MHz, go to sleep, after interrupt wake up, set clockspeed back to the 8Mhz (for 3v3), do some stuff and then go sleep again?

Thanks
Absolutely. The built-in prescaler can dynamically change the clock speed for most of the systems on the chip (USB still needs to run at full speed in order to operate properly).

#include &lt;avr/power.h&gt;

 ...
clock_prescale_set(clock_div_32);
sleep();
clock_prescale_set(clock_div_1);
 ...


See the datasheet and AVR Libc documentation for more details.