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

please help me the arduino code translate ccs c code.

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



Joined: 04 Nov 2009
Posts: 2

View user's profile Send private message

please help me the arduino code translate ccs c code.
PostPosted: Wed Nov 04, 2009 6:41 pm     Reply with quote

please help me the arduino code translate to ccs c code for 12f675.
The code is using Led Fire Effect.

Thanks for your helping.

-- Sad sinan

Code:
int ledPin1 = 10;
int ledPin2 = 9;
int ledPin3 = 11;

void setup()
{
pinMode(ledPin1, OUTPUT);
pinMode(ledPin2, OUTPUT);
pinMode(ledPin3, OUTPUT);

}

void loop() {
analogWrite(ledPin1, random(x)+(255-x));
analogWrite(ledPin2, random(y)+(255-y));
analogWrite(ledPin3, random(z)+(255-z));

delay(random(100));
}
andyfraser



Joined: 04 May 2004
Posts: 47
Location: UK

View user's profile Send private message

please help me the arduino code translate ccs c code.
PostPosted: Wed Nov 04, 2009 6:53 pm     Reply with quote

If you spend 10 minutes reading the CCS manual you should have no problem converting this to CCS code.

Andy
www.sharpcontrols.net :: Free custom controls for .NET
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Thu Nov 05, 2009 12:42 am     Reply with quote

Quote:
you should have no problem converting this to CCS code

I don't agree. The said proprietary function analog_write() provides a software-PWM, no similar CCS built-in function exists.
It wouldn't be of much general use in my opinion, because it restricts the system performance seriously and thus
doesn't meet the requirements of embedded computing. A similar functionality can be implemented with
CCS C, if the processor is free of critical real-time tasks. But it can't be found in the CCS manual or examples.
andyfraser



Joined: 04 May 2004
Posts: 47
Location: UK

View user's profile Send private message

PostPosted: Thu Nov 05, 2009 11:37 am     Reply with quote

Point taken, I should have spent more than 10 seconds reading the OP's post. Apologies to sinan for my terse reply Crying or Very sad
cogitoist



Joined: 04 Nov 2009
Posts: 2

View user's profile Send private message

hi there,
PostPosted: Thu Nov 05, 2009 12:05 pm     Reply with quote

I know not included ccs c compiler this command (analog_write()).
But I need this fire effect ccs c code.

How do they do it for the 12f675 ?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Nov 05, 2009 12:30 pm     Reply with quote

This thread has software PWM code that should work on a 12F675:
http://www.ccsinfo.com/forum/viewtopic.php?t=37807
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