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() doesn't work correctly #13

Closed F0gRex closed 6 years ago

F0gRex commented 6 years ago

Hi there,

I have an issue with the LcdClean() function. If I call the function, everything is fine and the display of the EV3 gets cleared.

But when I use the function LcdPrintf() afterwards to cursor position has not been reseted. In other words: If the screen is completly full with text and I use the LcdClean() function the screen gets cleard but I can't print output text anymore.

Has someone also had this issue or knows how to fix it?

Thanks for your answers.

BTW: The project C4EV3 is very nice but for newbies it is quite hard to install the whole thing and also the commands.pdf didn't help me that much.

Trotzdem riesiges Lob an die Entwickler dieses Projekts und vielen Dank für eure Mühe. Benutze C4EV3 aktuell für meine Maturaarbeit (Semesterarbeit in der Schweiz auf der Sekundarstufe II) und war begeistert, dass ich den Roboter in C programmieren konnte, da ich schon seit längerem C lernen wollte.

a3f commented 6 years ago

Here's the relevant part of the API:

https://github.com/c4ev3/EV3-API/blob/8a10c4fdea9881b16a69810ace7aed19a7794980/API/ev3_lcd.c#L1823-L1836

Carriage return \r resets the cursor to the start of the line and line feed \f moves it to the left most corner, so a LcdPrintf(0, "\f"); should be what you're after. One could argue LcdClean should do this by default, but if we change it now, it would break behavior for existing users: Consider someone animating a progress bar by writing . and then LcdClean in a loop.

BTW: The project C4EV3 is very nice but for newbies it is quite hard to install the whole thing

I would be interested to hear what issues you ran into. I don't actively develop c4ev3 anymore, but I can clarify things in the documentation if need be.

and also the commands.pdf didn't help me that much.

The source code is the documentation. Isn't it more fun this way? ;) But, I agree with you, the project could benefit greatly from documentation and examples. If you want to contribute one, I would gladly include it. I wrote the tooling (and LcdPrintf!), but haven't actually programmed (or owned) an EV3 myself, so I can't really do it on my own...

Thanks for the encouraging words. I absolutely love to hear about what people use the software for. And please tell if we can help with any other problems! :)

EDIT: Thinking about it, providing some sort of c4ev3 user forum could help with answering questions (and fostering contributions), so I create a c4ev3 channel on Gitter: Gitter Chat

F0gRex commented 6 years ago

Thank you for your answer. This was exactly what I was looking for.

I would be interested to hear what issues you ran into. I don't actively develop c4ev3 anymore, but I can clarify things in the documentation if need be.

I managed to get everything installed with the help of this website https://www.brickobotik.de/c4ev3-installationsanleitung/.

It would be great if you also mention that it is necessary to install Java SE and Eclipse before you click the installer of C4EV3

Another thing which is quite important is the fact that in Windows sometimes an application called "echo" is missing and one has to install it manually. (I had to do that)

The source code is the documentation. Isn't it more fun this way?

Yes, true. :) You should have seen my face when I realized that there are not only the ten functions mentioned in the documentation but at least hundred more. xD

If you want to contribute one, I would gladly include it.

If I have time left at the end of the project, I will write one. :)