Search found 76 matches

by physics-matt
02 Nov 2010, 07:41
Forum: Mindstorms Software
Topic: NXC: enum constants and switch/case
Replies: 8
Views: 5027

Re: NXC: enum constants and switch/case

mrblp wrote: The difference between your code and mine is that the enum is defined globally (your code) vs locally (my code).
Sounds like it's a job for John H then.

Is that the only thing that goes wrong when you define the enum locally?

Matt
by physics-matt
01 Nov 2010, 18:30
Forum: Mindstorms Software
Topic: LeJos: all robot classes and methods in 1?
Replies: 38
Views: 22401

Re: LeJos: all robot classes and methods in 1?

can you show me how to do it? Well, I could... Sounds like you're not giving Java a fair chance. The problems you've cited are pretty straightforward to solve and just require a bit of learning (there are oodles of good Java tutorials online). I doubt anyone will be willing to help write an uber-cl...
by physics-matt
01 Nov 2010, 18:10
Forum: Mindstorms Software
Topic: NXC: enum constants and switch/case
Replies: 8
Views: 5027

Re: NXC: enum constants and switch/case

Seems to work for me using the enum constants. Your code (suitably modified to remove references to SR_Straight) compiles fine and the following also compiles and runs as expected: enum MyEnum { foo=1, bar=2 }; task main() { MyEnum a = bar; switch (a) { case foo: TextOut( 0, LCD_LINE1, "foo" ); brea...
by physics-matt
31 Oct 2010, 22:55
Forum: Mindstorms Software
Topic: LeJos: all robot classes and methods in 1?
Replies: 38
Views: 22401

Re: LeJos: all robot classes and methods in 1?

doc-helmut wrote: But maybe 1 Lejos monster class to bind them all would help ;)
Of course, you would have to write the code for this class, so you'd still have to figure out OO to some extent. IMHO, if you're going to do that, you may as well go the whole hog and learn how to use Java properly.

Matt
by physics-matt
29 Oct 2010, 07:22
Forum: Mindstorms Software
Topic: wishlist for BricxCC
Replies: 186
Views: 125449

Re: wishlist for BricxCC

I think the editor colours could be improved. I've tried numerous times to change the colours of the editor (I mean, it just ain't programming unless it's green text on a black background ;) ) but often find some of the colours revert to default every now and again. I'm also not sure about the fact ...
by physics-matt
28 Oct 2010, 19:57
Forum: Mindstorms Software
Topic: LeJos: all robot classes and methods in 1?
Replies: 38
Views: 22401

Re: LeJos: all robot classes and methods in 1?

Can't you do this by defining one uber-class which has an instance of all the other classes? I don't know, I was the one who asked that question... :? Sorry, I was using a very English idiom there. It means "I think it is possible to define an uber-class". Why don't you give it a try? I'd like to u...
by physics-matt
28 Oct 2010, 19:42
Forum: Mindstorms Hardware
Topic: Inaccurate Hitechnic Compass
Replies: 6
Views: 6468

Re: Inaccurate Hitechnic Compass

There was a long discussion about this a little while ago in another thread: https://sourceforge.net/apps/phpbb/mindboards/viewtopic.php?f=4&t=85 The short answer is that the sensor itself can be very accurate, but is highly susceptible to errors due to stray magnetic fields or tilt. Is the amount o...
by physics-matt
28 Oct 2010, 08:13
Forum: Mindstorms Software
Topic: LeJos: all robot classes and methods in 1?
Replies: 38
Views: 22401

Re: LeJos: all robot classes and methods in 1?

Can't you do this by defining one uber-class which has an instance of all the other classes?

However, you will never be able to get rid of the OO syntax: in Java, everything is a class and all functions are methods of those classes.

Matt
by physics-matt
28 Oct 2010, 07:48
Forum: Mindstorms Projects
Topic: Lasers, Diffraction Gratings, NXT
Replies: 7
Views: 6628

Re: Lasers, Diffraction Gratings, NXT

Like the video. It's like a high-tec version of spirograph!

Matt
by physics-matt
19 Oct 2010, 07:21
Forum: Mindstorms Projects
Topic: Proposal how to proof the navigation correction by sensors
Replies: 16
Views: 11427

Re: Proposal how to proof the navigation correction by sensors

Regarding measuring distance. The original rules did say the motor encoders can be read. Distance can be determined simply by adding the two encoders. They can be read, but apparently can't be used to "correct driving": you may read encoder values of both motors, and you may use them to determine t...