Fehlermeldung beim einrichten des Arduino pro micro

  • Hallo,


    Ich arbeite grade an einem Projekt mit einem Arduino pro micro und bekomme immer die

    Fehlermeldung (No such file or directory) und weis nicht was ich machen soll.

    (Wer etwas weis kann eine Konversation starten)


    Lg marco

  • Hatte in der Schule mit Arduino zu tun. Kenn mich nicht besondern gut aus und bin mir auch unsicher dabei, aber ich glaube du benutzt Methoden, die noch nicht hinzugefügt wurden. D.h. du musst in deine Programmbibliothek die "Libary" hinzufügen, die du in deinem Quellcode benutzt.

    Beispiel: Benutzt ein bestimmten Sensor und willst einen Wert auslesen. Das funktioniert nur, wenn du die Libary von diesem Sensor in deine Programmbibliothek hinzugefügt hast.

    Also ich vermute das nur, wie gesagt, ist schon länger her. Ansonsten wäre ich auch schon raus.

  • ok danke ich versuche es mal.


    hat nicht geklappt aber trotzdem danke


    btw das ist der code:



    #include <Wire.h>

    #include <I2Cdev.h>

    #include <MPU6050.h>

    #include <Mouse.h>

    #include <Keyboard.h>


    MPU6050 mpu;

    int16_t ax, ay, az, gx, gy, gz;

    int16_t accx, accy, accz;

    int vx, vy;

    int TRIGGER_BUTTON = 5;

    int WEAPON_TOGGLE = 9;

    bool weaponModeOn = false;

    float angle;


    //code for smoothing input

    int readIndex = 0;

    const int numReadings = 20;

    int angleReadings[numReadings];

    int total = 0;

    float averageAngle = 0.0;



    int oldZ = 0;

    int newZ = 0;


    void setup() {

    Serial.begin(115200);

    Wire.begin();

    mpu.initialize();

    if (!mpu.testConnection()) {

    while (1);

    }

    pinMode(TRIGGER_BUTTON, INPUT_PULLUP);

    pinMode(WEAPON_TOGGLE, INPUT_PULLUP);


    for (int thisReading = 0; thisReading < numReadings; thisReading++) {

    angleReadings[thisReading] = 0;

    }

    }


    void loop() {


    int triggerPushed = digitalRead(TRIGGER_BUTTON);

    int weaponToggle = digitalRead(WEAPON_TOGGLE);


    total = total - angleReadings[readIndex];

    angleReadings[readIndex] = angle;

    total = total + angleReadings[readIndex];

    readIndex = readIndex + 1;

    if (readIndex >= numReadings) {

    readIndex = 0;

    }



    if (triggerPushed == HIGH) {

    //digitalWrite(13, LOW);

    if (Mouse.isPressed()) {

    Mouse.release();

    }

    } else {

    // Serial.println("button pushed");

    Mouse.press();

    }


    if (weaponToggle == HIGH) {

    weaponModeOn = false;

    } else {

    if (!weaponModeOn) {

    Keyboard.write('2');

    delay(400);

    }

    weaponModeOn = true;

    }


    //accx, accy, accz;

    mpu.getMotion6(&ax, &ay, &az, &gx, &gy, &gz);

    mpu.getAcceleration(&accx, &accy, &accz);


    //Serial.println(gy);


    // Serial.println(angle);


    oldZ = newZ;

    vx = (gx + 300) / 150; // "+300" because the x axis of gyroscope give values about -350 while it's not moving. Change this value if you get something different using the TEST code, chacking if there are values far from zero.

    vy = -(gz - 100) / 150; // same here about "-100"


    /*

    Serial.print("gx = ");

    Serial.print(gx);

    Serial.print(" | gz = ");

    Serial.print(gz);

    Serial.print(" | gy = ");

    Serial.println(gy);


    */


    if (gx > 32000) {

    Serial.println("Flick Right");

    for (int i; i < 12; i++) {

    Mouse.move(50, 0);

    }

    delay(250);

    } else if (gx < -32000) {

    Serial.println("Flick Left");

    for (int i; i < 12; i++) {

    Mouse.move(-50, 0);

    }

    delay(250);

    }


    /*

    Serial.print("accx = ");

    Serial.print(accx);

    Serial.print(" | accy = ");

    Serial.print(accy);

    Serial.print(" | accz = ");

    Serial.println(accz);

    */



    averageAngle = total / numReadings;

    if (!weaponModeOn && accy > 16000)

    {



    if (averageAngle < 10) {

    Serial.println("Build floor");

    Keyboard.write(KEY_F2);

    } else if (averageAngle > 10 & averageAngle < 45) {

    Serial.println("Build ramp");

    Keyboard.write(KEY_F3);

    } else {

    Serial.println("Build wall");

    Keyboard.write(KEY_F1);

    }


    // Serial.println(averageAngle);


    //Serial.println("shake");

    //Keyboard.write(KEY_F1);

    delay(250);

    Mouse.click();

    } else if (weaponModeOn && accy > 16000)

    {

    if (averageAngle < 10) {

    Keyboard.write('r');

    }

    }


    if (weaponModeOn) {

    //Serial.println("Weapon mode on");

    Mouse.move(vx, vy);

    }


    //working

    //angle = atan2((float) (ay - 16384), (float) (ax - 16384)) * (180.0 / PI) * -1;

    angle = atan2((float) ay, (float) ~ax) * (180.0 / PI);

    //float angle = atan2((float) ay, (float) -ax) * (180.0 / PI);


    //Serial.println(averageAngle);


    delay(20);

    }


    und die komplette Fehlermeldung:

    Arduino: 1.8.9 (Windows Store 1.8.21.0) (Windows 10), Board: "Arduino Leonardo"


    sketch_jul04b:3:20: error: I2Cdev.h: No such file or directory


    compilation terminated.


    exit status 1

    I2Cdev.h: No such file or directory


    Dieser Bericht wäre detaillierter, wenn die Option

    "Ausführliche Ausgabe während der Kompilierung"

    in Datei -> Voreinstellungen aktiviert wäre.

  • sketch_jul04b:3:20: error: I2Cdev.h: No such file or directory

    Also soweit ich das verstehe, habe noch nie was mit Arduionos zu tun gehabt aber verstehe C(halbwegs), will dir der compiler sagen, dass er die Headerdatei 12Cdev.h nicht in deinem angegebenen ordner findet


    // Bitte bessert mich gerne aus wenns anders ist

  • Wobba

    Hat das Thema geschlossen.