Controlling Digital Servo using HC-06 bluetooth module

Hello, I am beginning to learn how to code and I have been able to learn how to use an HC-06 bluetooth module to control an LED and turn it off and on, as well as how to set a servo motor to automatically turn at certain paces. Can anyone help me kind of integrate the two concepts and use an HC-06 bluetooth module connected to an Arduino Mega 2560 board to control a digital servo? I have tried several combinations of the two codes, but do not understand enough to integrate the two. I have attached the separate codes I have used for the separate actions and two failed attempts to integrate the two.