c4ev3 / EV3-API

EV3-API for Programming the LEGO Mindstorms EV3 in C
http://c4ev3.github.io
GNU General Public License v2.0
70 stars 21 forks source link

LcdClean() seems to skip the rest of the EV3 program that is run #26

Closed Electrenator closed 4 years ago

Electrenator commented 4 years ago

When printing on the lcd with LcdPrintf() and then clearing it with LcdClean() seems to always skip the rest of the program that still needs to be run on the EV3.

dnlmlr commented 4 years ago

Could you clarify what you mean by "skip the rest of the program"? Does the program exit after reaching LcdClean or do you mean something else?

Electrenator commented 4 years ago

The program exits when reaching the LcdClean function.

dnlmlr commented 4 years ago

That is of course not supposed to happen. If this is an issue with the API code, it seems really strange though that this never occourred before. Do the other LCD related functions (Ev3Printf or the older LcdPrintf) work? Would you mind providing code for a minimal functional program that produces the error for you? That might help understanding what goes wrong and/or allow to maybe replicate the problem.

Electrenator commented 4 years ago

Have never tried to use Ev3Printf, because it wasn't in the commands.pdf and can't test it at the moment but I've used this code to get the result that I had described;

#include <ev3.h>

int main(void){
    int x, y;

    for(x = 0; x < 10; x++){
        LcdClean();
        for(y = 0; y < 8; y++){
            if(x % 2 == 0)
            {
                LcdPrintf(1, "Hello World!\n");
                LcdPrintf(0, "Hello World!\n");
            }else{
                LcdPrintf(0, "Hello World!\n");
                LcdPrintf(1, "Hello World!\n");
            }
        }
        Wait(MS_500);
    }
}
Electrenator commented 4 years ago

Yes, Ev3Printf and LcdPrintf work with the above code

a3f commented 4 years ago

Did you figure out why LcdClean behaved strangely for you? Can this issue be closed?

Electrenator commented 4 years ago

No, I didn't figure it out in the end. Could have been something with the device itself because it did work with other EV3s that I could test it on.

a3f commented 4 years ago

Possibly different firmware versions? Could you check?