...
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
/* Library that contains all functions to control the flight of the Quadrocopter */ //----------------------GETTER-------------------------------- //return the current Height of the Quadrocopter depending on ceiling height int getHeight(); //returns the current Direction of the Quadrocopter int getDirection(); //returns the base Speed of the Quadrocopter int getBaseSpeed(); //------------------Control----SETTER-Functions------------------------------- //setsstop the basecurrent Speedmovement of the Quadrocopter void setBaseSpeed(); //------------------Control-Functions------------------------- //stop the current movement of the Quadrocopter and return to balanced flight as soon as possible void stop(); //Letlet the Quadcopter start flying upwards untilwith somethinggiven elsespeed isin setcm/s void incHeight(int speed); //let the Quadcopter start flying upwards untilwith given speed heightin iscm/s reachedfor void incHeight(inta given height); gain. //letensures thegetHeight.old Quadcopter start flying upwards with given speed until given height is reached + height = getHeight.new void incHeight(int height, int speed); //decreases Height untilwith somethinggiven elsespeed isin setcm/s void decHeight(int speed); //decreasesdeacreases Height with given amount and void decHeight(int height); given speed in cm/s //deacreasesensures HeightgetHeight.old with- givenheight amount and given speed = getHight.new void decHeight(int height, int speed); //let the quadrocopter fly forward untilwith somethingthe elsegiven isspeed set void flyForward(); //let the quadrocopter fly forward for the given distance in cm/s void flyForward(int distance); //let the quadrocopter fly forward for the given distance in cm with given speed in cm/s void flyForward(int distance, int speed); //let the quadrocopter fly right untilwith somethingthe elsegiven isspeed set void flyRight(); //let the quadrocopter fly right for the given distance in cm/s void flyRight(int distancespeed); //let the quadrocopter fly right for the given distance in cm with given speed in cm/s void flyRight(int distance, int speed); //let the quadrocopter fly left untilwith somethingthe elsegiven isspeed set void flyLeft(); //let the quadrocopter fly left for the given distance in cm/s void flyLeft(int distancespeed); //let the quadrocopter fly left for the given distance in cm with given speed in cm/s void flyLeft(int distance, int speed); //let the quadrocopter fly backwards untilwith somethingthe elsegiven isspeed set void flyBackward(); //let the quadrocopter fly backwards for the given distance in cm/s void flyBackward(int distancespeed); //let the quadrocopter fly backwards for the given distance in cm with given speed in cm/s void flyBackward(int distance, int speed); //let the quadrocopter turn right with given untilspeed somethingin else° isper setsecond void turnRight(int speed); //let the quadrocopter turn right for given angle void turnRight(int angle); //let the quadrocopter turn right until given angle with given speed in ° with given speed in ° per second void turnRight(int angle; int speed); //let the quadrocopter turn left until something else is setwith given speed in ° per second void turnLeft(int speed); //let the quadrocopter turn left for given angle void turnLeft(int angle); //let the quadrocopter turn left until given angle with given speed in ° with given speed in ° per second void turnLeft(int angle; int speed); //let the quadrocopter land at the current position void land(); |
fma suggested to just provide functions for given speed and with this to remove the baseSpeed. This will be a topic to discuss.