Search the Community
Showing results for tags 'NXC'.
Found 2 results
-
[MOC] Sequencer Music Machine
Fissl posted a topic in LEGO Technic, Mindstorms, Model Team and Scale Modeling
Hello! I just joined the forum, and now i want to introduce myself and the latest MOC i built ;) It's a programmable sequencer playing a little song on a KORG monotron Duo (an analogue synthesizer) and a MakeyMakey what sends midi-signals to an audio-software (in my case logic) to trigger drum sounds. But I'm not very good at explaining, so take a look and tell me what do you think! Cheers, Fissl -
NXC: MotorOverload always returns false
AVCampos posted a topic in LEGO Technic, Mindstorms, Model Team and Scale Modeling
Hi all! I'm programming a robot that has limited travel on one of its articulations. I don't require precision on its position, just that it stops the motor as soon as it hits the limit. NXC has the MotorOverLoad function, which appears to do exactly what I want... however, it always returns "false" even if the motor is completely stalled! Digging a bit, I found that MotorOverload is actually a shortcut for one of the fields of GetOutput (like "GetOutput(OUT_A, OverloadField)"). Checking the field's documentation, I see that, for it to work, I need to set the motor according to numerous parametres... but, after setting them, I can't get the motor to actually run! This is what I wrote to get the motor running, while enabling MotorOverload: SetOutput( OUT_C, RunStateField, OUT_RUNSTATE_RUNNING, OutputModeField, OUT_MODE_MOTORON + OUT_MODE_REGULATED, RegModeField, OUT_REGMODE_SPEED, PowerField, power_C * d); (power_C and d are variables I defined) If I use the normal "OnFwd" instead, the motor is never stopped: if(MotorOverload(OUT_C)) { Stop(OUT_C); } What could I be doing wrong? Thanks in advance!- 13 replies
-
- NXC
- MotorOverload
-
(and 2 more)
Tagged with: