Autonomous Quadcopter with Altitude Control using Ultrasonic Sensor

I already have these quadcopter basics: frame, motors, ESCs, propellers, Arduino 6dof IMU, Arduino Nano, Battery, Arduino SMPS, Ultrasonic Sensor, logic level converter, DIY aeroquad shield. My objective is to have a stable flight that will hold the altitude up to approximately 1m using an ultrasonic sensor. I didn't put a receiver since I will not use a remote. The aeroquad motor test code I found works well on my quadcopter. All motors are responding while using this code. Problem is, I dont know where to start with my own code. I am not expert at C. When connecting the quad to the Aeroquad software, the motors are not detected. What do you think is the problem? Your response is greatly appreciated. Thanks in advance.

When connecting the quad to the Aeroquad software

What Aeroquad software? How are you connecting the quad to it? Duct tape?

Cross-post deleted - DO NOT CROSS-POST, IT WASTES TIME.

You may find some inspiration here : http://ardupilot.com/