Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LcdClean() doesn't work correctly #13

Closed
F0gRex opened this issue Apr 12, 2018 · 2 comments
Closed

LcdClean() doesn't work correctly #13

F0gRex opened this issue Apr 12, 2018 · 2 comments

Comments

@F0gRex
Copy link

F0gRex commented Apr 12, 2018

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
Copy link
Member

a3f commented Apr 12, 2018

Here's the relevant part of the API:

EV3-API/API/ev3_lcd.c

Lines 1823 to 1836 in 8a10c4f

case '\r':
X0 = 0;
break;
case '\b':
X0 -= width;
break;
case '\v':
Y0 += height+1;
break;
case '\f':
X0 = Y0 = 0;
break;
case '\t':
X0 += width * (TAB_SIZE - indent);

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
Copy link
Author

F0gRex commented Apr 13, 2018

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. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants