Porting of the arduino sketch to native avr-lib