Before I try to read your code and figure out what you want please spend the time to read the forum guidelines and post your code using code tags. Since I cannot see what you have also post links to technical information on the hardware items and your preliminary schematic be sure to show all power, ground and power sources.