Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   FIRST Tech Challenge (http://www.chiefdelphi.com/forums/forumdisplay.php?f=146)
-   -   programming motors with programming kit (http://www.chiefdelphi.com/forums/showthread.php?t=40290)

BorisTheBlade 01-11-2005 04:03

programming motors with programming kit
 
just curious I must be doing something wrong or something but I'm trying to teach our new members how to program and I tried just going into the default routine and just setting the motor to full forward like this:
Code:

pwm01 = 255;
then when I download it it does nothing is this not the way to do it anymore? Back when I was using the EDU bot 2 years ago this always worked just fine. could really use some help on this one. thanks

billbo911 01-11-2005 10:23

Re: programming motors with programming kit
 
Quote:

Originally Posted by BorisTheBlade
... I tried just going into the default routine and just setting the motor to full forward like this:
Code:

pwm01 = 255;
could really use some help on this one. thanks

I was unable to get of my own code to work until I changed one particular section. This is in the "user_routines.c" near line 193.

In the following code, you define who controls the PWM, the USER or the MASTER PIC. You will have to write the code for generating PWMs if you want the USER to to control them. ( For seriously custom code )
Code:

/* SEVENTH: Choose which processor will control which PWM outputs. */
  //Setup_Who_Controls_Pwms(MASTER,MASTER,MASTER,MASTER,MASTER,MASTER,MASTER,MASTER);
  Setup_Who_Controls_Pwms(USER,USER,USER,USER,USER,USER,USER,USER);

If you have not changed this, the USER will be controlling the PWMs and your code will not. Change these lines according to what you want to control and your code should work. :D

BorisTheBlade 01-11-2005 16:44

Re: programming motors with programming kit
 
cool thanks alot I'll give it a try!

Morenoh149 01-11-2005 18:41

Re: programming motors with programming kit
 
just clearing up. Is this right?
Quote:

Code:

/* SEVENTH ...
Setup_Who_Controls_Pwms(USER,USER,USER,USER,USER,U SER,USER,USER);


billbo911 01-11-2005 19:03

Re: programming motors with programming kit
 
Quote:

Originally Posted by Morenoh149
just clearing up. Is this right?

I'm working from memory here, I won't bet my pay check on what I am about to say, but I believe I am correct.

You will need to set that line to:
Code:

Setup_Who_Controls_Pwms(MASTER,MASTER,MASTER,MASTER,MASTER,MASTER,MASTER,MASTER)
This will cause the master processor to handle the PWM signal generation. If left at the value from the default code:
Code:

Setup_Who_Controls_Pwms(USER,USER,USER,USER,USER,USER,USER,USER);
then the user processor would have to generate the PWM signals. This means that you have to write the code yourself that will tell the user processor how PWMs should be created.
BTW, If I'm not mistaken, this line will also allow you to mix both USER and MASTER for the various PWM outputs. Thereby, having complete control over certain PWMs while allowing the master processor control the output of others.


All times are GMT -5. The time now is 10:40.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi