making a compass problems with drawing

This is where you talk about the NXJ software itself, installation issues, and programming talk.

Moderators: roger, 99jonathan, imaqine

making a compass problems with drawing

Postby janvos2506 » Fri Nov 16, 2012 10:35 pm

Hey so i have made a compass for my nxt so i now wich angles and stuff
i wrote some code to draw a circle and a line and that line keeps pointing the same way as you started it but i dont know how to refresh
i use this
Code: Select all
Graphics g = new Graphics()
                         g.drawLine(44,36,x,y)
                          g.clear()


and the x and y change the whole time but this code works but it isn't smooth the line disappears and appears randomly?
isn't there some sort of g.refresh() or something?
janvos2506
Novice
 
Posts: 34
Joined: Mon Oct 24, 2011 8:58 pm

Re: making a compass problems with drawing

Postby skoehler » Sat Nov 17, 2012 12:38 am

You will have to disable the autorefresh of the LCD. Then manually refresh after you draw and before you clear. Take a look at the LCD class for the appropriate methods to do that.
skoehler
leJOS Team Member
 
Posts: 1114
Joined: Thu Oct 30, 2008 4:54 pm


Return to NXJ Software

Who is online

Users browsing this forum: No registered users and 0 guests

more stuff