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

Need help writing ccs c compiler program

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



Joined: 28 Nov 2016
Posts: 1

View user's profile Send private message

Need help writing ccs c compiler program
PostPosted: Wed Nov 30, 2016 1:32 pm     Reply with quote

So I have a school assignment due and I have no idea what to do.
1 –With help from a potentiometer to simulate a temperature sensor, the LED turns ON only when the temperature is above 70 and is Off otherwise.
2-Use a push button switch to turn the LED off for 5 seconds at any time.
3-Use the WDT (Watch dog timer) or the overflow of another timer to achieve the timing in step 2 (above).
If anyone can help with even just the 1st part I would appreciate it.
I am using a PIC 16F690
Ttelmah



Joined: 11 Mar 2010
Posts: 19329

View user's profile Send private message

PostPosted: Wed Nov 30, 2016 2:04 pm     Reply with quote

If you have the compiler, you have dozens of examples. Look in the examples directory. There are examples of reading a temperature, reading a keyboard, etc. etc..
You won't use the watchdog for the timing. It is too inaccurate on most PIC's, and just resets the chip. Just look at the delay function.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Nov 30, 2016 2:32 pm     Reply with quote

I did a search of the forum for likely programs, using these search terms:
Quote:
read_adc output_low output_high
and my name.

The sample code in this post is very similar to what you want for the first part:
Need Help Fuzz-C Code:
http://www.ccsinfo.com/forum/viewtopic.php?t=42952
temtronic



Joined: 01 Jul 2010
Posts: 9162
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Wed Nov 30, 2016 5:07 pm     Reply with quote

first step

Cut code for a 1Hz LED program and get it working !
Until that's working do NOT attempt the real project....

After that look at the examples CCS provides.....
to program any computer, you need to think like one.. figure out the steps and sequence, get one section working then build upon that.

Jay
Arakel



Joined: 06 Aug 2016
Posts: 107
Location: Moscow

View user's profile Send private message Visit poster's website AIM Address

A similar code with PIC16F690
PostPosted: Fri Dec 02, 2016 2:54 pm     Reply with quote

This is like my thread. But my thread is with a real temperature sensor and a display.

http://www.ccsinfo.com/forum/viewtopic.php?t=55674
_________________
Yo! I love learning and technology! I just do not have experience so do not be angry if I ask a stupid question about a detail! From so much to remember sometimes I forget the details in order to remember the big problems!
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