Code for Circuit

You start here. Then using code tags you post your code. Then you describe in detail exactly how you figure your code and your circuit should work. Nobody here is going to do any school assignments for you.

Ron