Skip to Main Content
PIC Projects and Applications using C
book

PIC Projects and Applications using C

by David W Smith
December 2012
Intermediate to advanced content levelIntermediate to advanced
204 pages
3h 40m
English
Newnes
Content preview from PIC Projects and Applications using C
Chapter 14

Projects

Project 1: Countdown Timer

The circuit for the countdown timer is shown in Figure 14.1.

image

Figure 14.1 The countdown timer.

The countdown time mm:ss is entered via the keypad and the display shows the time remaining up to 99 min 59 s.

The program for the countdown timer is shown below in Countdown.C

1. //Countdown.C by DW Smith 20-6-12

2. #include <p18f1220.h>

3. #pragma config WDT=OFF, OSC=INTIO2, PWRT=ON, LVP=OFF, MCLRE=OFF

4. #include <delays.h>

5. #include <dwsLCD.h>

6. #include <dwsScan.h>

7. // put variables here

8. char secUnit, secTen, minUnit, minTen, result;

9. void main (void)

10. {

11. //SET UP

12. // OSCCON defaults ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Computer Fundamentals and Programming in C (RMK)

Computer Fundamentals and Programming in C (RMK)

Anita Goel, Ajay Mittal
Jumpstarting C

Jumpstarting C

Wolfram Donat

Publisher Resources

ISBN: 9780080971513