|
Page 1 of 1
|
[ 3 posts ] |
|
Motorencoder Values on display
Author |
Message |
JPWingman
Rookie
Joined: Mon Mar 10, 2008 5:03 pm Posts: 5
|
 Motorencoder Values on display
Hi there,
lately I have had some problems with the Values shown on my display of my NXT. I wrote a programm in which 2 motors should follow the first motor, which I turned myself during the program. The values from the motorEncoders should be shown on the display.
Now the problem is that at the beginning the values are all right, but when I turn the motor back from 100 to 90 degrees, the display at first shows 100 and then 900. I guess that 900 is supposed to mean 90, but why is the additional 0 stilll standing there.
I admitt that I am just getting started to use a display, so is there anybody, who could help?
this is the code that should show the Encodervalues on the display
post deciamal positions could be helpful, I guess. The values are supposed to help me debugging an other problem. [/code]
|
Fri Mar 21, 2008 6:42 am |
|
 |
Ford Prefect
Guru
Joined: Sat Mar 01, 2008 12:52 pm Posts: 1030
|
hi,
probier's doch mal so:
[EDIT:] Bei wird am Schluss nicht mit Leerzeichen aufgefüllt, daher bleiben "alte" zeichen stehen. Bei wird die gesamte Zeile immer neu geschrieben und am Ende mit Leerzeichen aufgefüllt, dann sieht immer alles "sauber" aus. weil das aber so unmöglich kompliziert und langwierig zu schreiben ist, definiere ich mir immer und schreib dann künftig nur noch :)
_________________ regards, HaWe aka Ford #define S sqrt(t+2*i*i)<2 #define F(a,b) for(a=0;a<b;++a) float x,y,r,i,s,j,t,n;task main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PutPixel(x,y);}}}while(1)}
|
Fri Mar 21, 2008 7:00 am |
|
 |
JPWingman
Rookie
Joined: Mon Mar 10, 2008 5:03 pm Posts: 5
|
jo, danke nochma und für den rat aus der anderen nachricht
|
Fri Mar 21, 2008 9:54 am |
|
|
|
Page 1 of 1
|
[ 3 posts ] |
|
Who is online |
Users browsing this forum: No registered users and 2 guests |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum
|
|