GyroExample crashes

HomeForumsMonoBrick EV3 FirmwareGyroExample crashes

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #4066
    Author Image
    Jošt Novak
    Participant

    Hello,

    I’m trying to use EV3 gyro, which will be our main sensor for orientation. Running gyroExample, which is part of SD card image downloaded from monobrick website, always gives me -600 deg/sec.

    If i try to compile gyroExample from sources and download it to EV3, it just crashes before printing anything to console. Same thing happens with my program which looks like this:

    LcdConsole.WriteLine(“Test print…”);
    EV3GyroSensor gyro = new EV3GyroSensor(SensorPort.In4 , GyroMode.Angle);
    System.Threading.Thread.Sleep(5000);
    for (int i = 0; i < 100; i++) {
    LcdConsole.WriteLine(“Sensor value: ” + gyro.Read());
    System.Threading.Thread.Sleep(1000);
    }

    Test print does not print, and program closes immediately.
    I tried re-compilling MonoBrickFirmware library from sources (nothing changes).
    Any idea what might be wrong?

    Regards

    #4067
    Author Image
    Jošt Novak
    Participant

    Another thing:

    I had similar problem with colorSensorExample.

    Program located on SD card worked properly, but compiled program crashed before printing anything.
    After removing this line:
    LcdConsole.WriteLine(“Sensor value: ” + sensor.ReadAsString());
    Program worked.

    Regards

    #4068
    Author Image
    Jošt Novak
    Participant

    some extra info… Running compiled GyroExample form shell gives me this:

    root@EV3:~# mono apps/GyroSensorExample2.exe

    Unhandled Exception:
    mono() [0x108e18]
    mono() [0x109208]
    mono() [0x109eec]
    mono() [0x10ad14]
    mono(mono_arm_throw_exception+0xf0) [0x15cdfc]

    [ERROR] FATAL UNHANDLED EXCEPTION: System.TypeLoadException: Could not load type ‘GyroSensorExample.MainClass+<Main>c__AnonStorey0’ from assembly ‘GyroSensorExample, Version=1.0.5196.19288, Culture=neutral, PublicKeyToken=null’.

    #4069
    Author Image
    Jošt Novak
    Participant

    Solved!

    I forgot to copy dll library.

    Regards

    #4088
    Author Image
    Anders Søborg
    Keymaster

    Great that you where able to solve this… Welcome to the MonoBrick community

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.

Posted in

Make a donation