Here are examples on how to do stuff with the AVR microcontroller chip, i use the "ATMEGA 328P" mostly but will work for other ATMEGA chips too as long if you fallow its pinout datasheet.
Written in embedded C. To make PORT B pin 0 LED light go on and off by serial communication by pressing 1 for LED on, and 0 for LED off.