Chapter 15

C Extra

In Chapter 2 we saw how to turn outputs on and off using C18 statements. Use the delay routines and execute a while loop.

In Chapter 3 we used the for loop.

The if statement was introduced in Chapters 4 and 5 and a modification of this the case statement was discussed in Chapter 14.

Chapter 14 showed how powerful the C language is for the microcontroller by calculating the value of C in the expression:

image

We have of course seen how to add, subtract, multiply, and divide variables and have used the “log” function to evaluate C in the above expression. But there are numerous other mathematical functions that we can use in our programs, ...

Get PIC Projects and Applications using C now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.