using leonardo to upload sketches to atmega168/328

PeterVH:
That question came up before, two options were given over here: Program AT328 with Leonardo - #2 by tim7 - Microcontrollers - Arduino Forum

If your goal is just to run some code on the targets, you are better off without bootloader: just burn your compiled sketches with ArduinoISP (I assume you used that to burn the bootloader into the targets?)

If you really want to use the target as an arduino on a breadbord, and program it from the IDE etc... You'd need to run a sketch on the leo that copies everything received from Serial (usb) to Serial1 (the regular uart) and vice versa. You'd have to connect respectively tx/rx on the leo to rx/tx on your target.

You can even combine the two functionalities into one sketch and use a jumper to select between isp mode and usb2serial mode (I saw the idea here: http://arduino.cc/forum/index.php/topic,101690.0.html, though the situation with the leonardo is a bit simpler: augmenting a sketch (ArduinoISP) with USB to serial conversion instead of adapting a bootloader)

i saw the post about using the leonardo but the way to dit is not specified there...it woud be nice to get the sketch which will copy everything from Serial to Serial1