the function call just partly work

Actually I copy the sinewave generation code from website. i guess the code just want to clear value to 0.