This thesis presents the design of autonomous flight control algorithms for a flappingwing aerial robot with onboard sensing and computational resources. We use a 13 gram ornithopter with biologically-inspired clap-and-fling mechanism. For autonomous flight control, we have developed 1.0 gram control electronics integrated with a microcontroller, inertial and visual sensors, communication electronics, and motor drivers. We have also developed a simplified aerodynamic model of ornithopter flight to reduce the order of the control system. With the aerodynamic model and the orientation estimation from on-board inertial sensors, we present flight control of an ornithopter capable of flying toward a target using onboard sensing and computational resources only. To this end, we have developed a dead-reckoning algorithm to recover from the temporary loss of the target which can occur with a visual sensor with a narrow field of view. With closed-loop height regulation of the ornithopter, we propose a method for identifying the discrepancy between the tethered flight force measurement and the free flight aerodynamic force. Lastly, we present a nondimensionalized analysis of a motor-driven flapping-wing system and experimentally demonstrate a resonant drive to reduce average battery power consumption for DC motor-driven flapping-wing robots.