After setting up BricxCC and codesourcery (which wasn't difficult at all after I've found the right tutorial) everything worked as expected - I tested all 4 test-samples and there was no problem.
(I am using the lms-api to communicate with the brick)
But when trying to write my own programs there seemed to be random crashes of the ev3 brick. It freezes executing one command forever (or until I force it to restart).
It took me some time until I noticed that RotateMotor was responsible for the crashes. And that's where it's getting strage: The output_test worked fine.
So after some more testing the reason was clear: RotateMotor does only work with 2 or all 4 outputs. E.g. RotateMotor(OUT_A, 20, 360) crashes, while RotateMotor(OUT_BD, 20, 360) doesn't.
But since it looks like a very simple and convincing way of rotating one motor for the giben amount of degrees I'd like to use it. (On(OUT_A) works)
Thus I conclude that there's a bug in the lms-api, or I need some alternative firmware (I searched for it but didn't found a EFW for EV3 - i use just V1.03H)
So if anyone has an idea to fix that problem, feel free to post it as I don't have a clue regarding how lms-api works.
There was an error with the LEGO Mindstorms API, which made the EV3 crash when trying to use RotateMotor, OutputStepSync or similar on anything other than exactly 2 motors.
But thanks to John Hansen this problem was solved. Make sure to use his newest API: http://bricxcc.sourceforge.net/test_releases/
and update the Makefile Template in Preferences->Compiler->EV3 to:
- Code: Select all
all:: realclean $(DOBJECTS) $(PROGRAM)
#pscp -scp -pw "%PW%" %PROGRAM% root@%IPADDR%:%FOLDER%
rm -f *.o *.ppu *.rst
rm -f $(PROGRAM)
# how to link executable
$(CC) $(FLAGS) $(LDFLAGS) $< -o$@ %LINKOBJS%
# how to compile source
$(CC) $(FLAGS) %LINKONLY% $< -o$@
That should solve the problem.