CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

control led and pwm..

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
zack



Joined: 30 Jan 2010
Posts: 4

View user's profile Send private message

control led and pwm..
PostPosted: Tue Feb 23, 2010 6:30 am     Reply with quote

how i want to make my led flashing for 30 seconds...what is the command that i need to use..

what is the command to control the pwm for dc motor...
i want to control 3 different speed which will increase from slow until it reach the desire speed...

i use PIC 16f877A...

help me please...thank you...
Gabriel



Joined: 03 Aug 2009
Posts: 1067
Location: Panama

View user's profile Send private message

PostPosted: Tue Feb 23, 2010 7:01 am     Reply with quote

To flash the LED
Code:

int i=0;

While(i<30)
  {
   Output_high(PIN_D1);
   Delay_ms(500);
   Output_low(PIN_D1);
   Delay_ms(500);
   i++;
  }

That should flash your led for 30 secs....

As for the PWM.... I can't help you there. I only used sofware PWMs for RGB LED control not motors.

g
_________________
CCS PCM 5.078 & CCS PCH 5.093
jaimechacoff



Joined: 14 Feb 2010
Posts: 24
Location: Santiago, Chile

View user's profile Send private message

PostPosted: Tue Feb 23, 2010 12:16 pm     Reply with quote

I believe you need a speed ramp.

look on google Trapezoidal Ramp, furthermore, PCM programmer gave us an example about it:

http://www.ccsinfo.com/forum/viewtopic.php?t=41473&start=3

good luck.
zack



Joined: 30 Jan 2010
Posts: 4

View user's profile Send private message

PostPosted: Wed Feb 24, 2010 3:24 am     Reply with quote

Alright...thank you guys...I really appreciate that... Very Happy
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group