why not use sketch from Allard PE1NW
see details here
and download it from here (and find further info for wire up, hints and kinks, moddings)
it even has a capacitive touch sensor for cw added (on TWO pins so no problems with sending dit dah instead of dit)
and other useful things (example usb added on the 40m unit to be used with digi modes, a second vfo for "split", etc etc)
greetz sigi dg9bfc