View unanswered posts | View active topics It is currently Thu Aug 21, 2014 7:59 pm






Reply to topic  [ 7 posts ] 
REALLY wierd problem... 
Author Message
Senior Roboticist
User avatar

Joined: Wed Sep 28, 2011 10:13 pm
Posts: 630
Location: If I told you, I'd have to kill you.
Post REALLY wierd problem...
So... I have a really odd program glitch... this code does nothing:

Code:
#pragma config(Motor,  motorA,          MtrA,          tmotorNXT, PIDControl, encoder)
#pragma config(Motor,  motorB,          MtrB,          tmotorNXT, PIDControl, encoder)
#pragma config(Motor,  motorC,          MtrC,          tmotorNXT, PIDControl, encoder)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

task main()
{
   while(true)
   {
      nxtDisplayCenteredBigTextLine(4, "%d", motorPWMLevel[motorC]);
      motor[motorC] = 50;
   }
}


and I'm like what the heck? What could possibly be wrong with this? I've tried different wires and motors...

_________________
A.K.A. inxt-generation
Self-proclaimed genius, and future world dominator.
My Brickshelf Folder
"Don't they teach recreational mathematics anymore?" - The Tenth Doctor
Bow down to Nikola Tesla, King of the Geek Gods.


Mon May 06, 2013 10:31 am
Profile WWW
Senior Roboticist
User avatar

Joined: Wed Sep 28, 2011 10:13 pm
Posts: 630
Location: If I told you, I'd have to kill you.
Post Re: REALLY wierd problem...
Ok I fixed it. Somehow. I really have no idea what I did. I guess just chalk this up to the code gremlins.

_________________
A.K.A. inxt-generation
Self-proclaimed genius, and future world dominator.
My Brickshelf Folder
"Don't they teach recreational mathematics anymore?" - The Tenth Doctor
Bow down to Nikola Tesla, King of the Geek Gods.


Mon May 06, 2013 11:22 am
Profile WWW
Site Admin
Site Admin

Joined: Thu May 24, 2012 12:15 pm
Posts: 564
Post Re: REALLY wierd problem...
The problem you are encountering is because the motorPWMLevel does not work on the NXT platform (it is for the VEX platform instead). We are looking into why it is appearing in the Function Library for the NXT platform and have added this into list of things to check for future releases.

Edit: Now I am curious; would you be able to post the updated code on here for us to check as well? Thanks in advance.

_________________
Check out our Blog! And our Facebook page!
Need help? Take a look at our Wiki and our Forums.

I just met you,
And this is crazy,
But here's my code now,
So fix it, maybe?
~ Carly Rae Jepsen parody


Mon May 06, 2013 11:23 am
Profile
Senior Roboticist
User avatar

Joined: Wed Sep 28, 2011 10:13 pm
Posts: 630
Location: If I told you, I'd have to kill you.
Post Re: REALLY wierd problem...
JohnWatson wrote:
The problem you are encountering is because the motorPWMLevel does not work on the NXT platform....
Excuse me? Yes it does work. I'm used it many times. All I did was past the exact same code and put it in a new file. Therefore the gremlins. :?

Here it is now:

Code:
#pragma config(Motor,  motorA,          MtrA,          tmotorNXT, PIDControl, encoder)
#pragma config(Motor,  motorB,          MtrB,          tmotorNXT, PIDControl, encoder)
#pragma config(Motor,  motorC,          MtrC,          tmotorNXT, PIDControl, encoder)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

task main()
{
   motor[MtrA] = 25;
   motor[MtrB] = 25;
   motor[MtrC] = 25;
   while(motorPWMLevel[MtrA] != 100 || motorPWMLevel[MtrB] != 100 || motorPWMLevel[MtrC] != 100);
   motor[MtrA] = 0;
   motor[MtrB] = 0;
   motor[MtrC] = 0;
}}


EDIT: changed code

_________________
A.K.A. inxt-generation
Self-proclaimed genius, and future world dominator.
My Brickshelf Folder
"Don't they teach recreational mathematics anymore?" - The Tenth Doctor
Bow down to Nikola Tesla, King of the Geek Gods.


Mon May 06, 2013 11:34 am
Profile WWW
Expert
User avatar

Joined: Fri Nov 02, 2012 12:07 am
Posts: 164
Location: California, USA
Post Re: REALLY wierd problem...
Hmmm... I certainly haven't seen that before. What does motorPWM supposed to do? :?

_________________
string Robored = "Awesome"
~~Neil Balch~~


Mon Jun 03, 2013 8:00 pm
Profile WWW
Senior Roboticist
User avatar

Joined: Wed Sep 28, 2011 10:13 pm
Posts: 630
Location: If I told you, I'd have to kill you.
Post Re: REALLY wierd problem...
motorPWMLevel returns the amount of power that is being applied to the motor. If you have PID control on, then if the motor isn't moving at the speed it should, a higher power level will be sent to it. motorPWMLevel can tell you that power level.

_________________
A.K.A. inxt-generation
Self-proclaimed genius, and future world dominator.
My Brickshelf Folder
"Don't they teach recreational mathematics anymore?" - The Tenth Doctor
Bow down to Nikola Tesla, King of the Geek Gods.


Mon Jun 03, 2013 9:32 pm
Profile WWW
Expert
User avatar

Joined: Fri Nov 02, 2012 12:07 am
Posts: 164
Location: California, USA
Post Re: REALLY wierd problem...
Ok, Thanks

_________________
string Robored = "Awesome"
~~Neil Balch~~


Mon Jun 03, 2013 9:36 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 7 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

Search for:
Jump to:  
cron



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.