mauricio fernandez montoya

SOME HELP WITH ROBOT´S STUFF AND MORE WITH MC68HC908JK1

Discussion created by mauricio fernandez montoya on May 18, 2007
Latest reply on May 27, 2007 by Thomas Dowad
HELLO, yes i know that i use some """out-of-date"""" devices but what i can do? jejeje.  i bought a china's cheap r/c car and i modified it to be a simple robot.   the only thing (for the moment) that this little piece of plastic have to do is to follow a black line (3M black tape for example). the only problem is that mi little car is too fast to follow properly the black line.   in the program i add a kind of improvised PWM speed control in the part of motor controls on the hc908's code.
here is the piece of code:

void AdelantePWM(int pwm){
PTB_PTB3=0;
PTD_PTD2=1;
Delayms(pwm);
PTB_PTB3=0;
PTD_PTD2=0;
Delayms(pwm);
}

this code is within a library (MOTORAPI.c) and controls the main motor.
int the main code the function apears AdelantePWM(250) for example, this will turn on and off the motor during 0.25 seconds. (Delayms is a delay function).
i think that is good but i will no take a risks with that... (call me donkey if you want cause i know only the basics of hc908 architecture).   here is some stills of the "robot".  if you want to see it working please help me :smileywink:)
(sorry , i know just a little new english words.... :smileyvery-happy:)






Outcomes