View previous topic :: View next topic |
Author |
Message |
jmbraightmeyer
Joined: 28 Nov 2016 Posts: 1
|
Need help writing ccs c compiler program |
Posted: Wed Nov 30, 2016 1:32 pm |
|
|
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: 19513
|
|
Posted: Wed Nov 30, 2016 2:04 pm |
|
|
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
|
|
Posted: Wed Nov 30, 2016 2:32 pm |
|
|
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: 9226 Location: Greensville,Ontario
|
|
Posted: Wed Nov 30, 2016 5:07 pm |
|
|
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
|
A similar code with PIC16F690 |
Posted: Fri Dec 02, 2016 2:54 pm |
|
|
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! |
|
|
|