Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Quadcopter

AbdoullahBougataya edited this page Jul 24, 2023 · 1 revision

Quadcopter

struct Quadcopter
{
    Servo ESC1;
    Servo ESC2;
    Servo ESC3;
    Servo ESC4;
    float mass;
    float propellers_radius;
    float voltage;
    int KVs;
};

This is a Quadcopter struct schema, made to simplify 8 function parameters to one parameter. you can use by declaring a parameters struct as shown below:

struct Quadcopter drone;
drone.mass = 352.5;           /*variable of the mass in (g) */
drone.propellers_radius = 38; /*variable of the propeller radius in (mm) */
drone.voltage = 22.8;         /*variable of the battery voltage in (v) */
drone.KVs = 2450;             /*variable of the KVs of the motor (KV) */
/* The pulse width attached to pins 6, 9, 10 and 11
have a minimum of 1000 µs and maximum of 2000 µs */
drone.ESC1.attach(6, 1000, 2000);
drone.ESC2.attach(9, 1000, 2000);
drone.ESC3.attach(10, 1000, 2000);
drone.ESC4.attach(11, 1000, 2000);
Clone this wiki locally