Implement the basic algorithm
After we learned some basic hardware controls in the last chapter, let's make up our basic software lessons.