Skip to Content
C Programming for the PIC Microcontroller: Demystify Coding with Embedded Programming
book

C Programming for the PIC Microcontroller: Demystify Coding with Embedded Programming

by Hubert Henry Ward
December 2019
Intermediate to advanced
282 pages
4h 22m
English
Apress
Content preview from C Programming for the PIC Microcontroller: Demystify Coding with Embedded Programming
© Hubert Henry Ward 2020
H. H. WardC Programming for the PIC Microcontrollerhttps://doi.org/10.1007/978-1-4842-5525-4_2

2. Our First Program

Hubert Henry Ward1  
(1)
Lancashire, UK
 

After reading this chapter, you should be able to create a project and write a program that uses inputs from switches and turns on outputs. We are going to start off by writing a program that will make the PIC wait until a switch connected to bit 0 of PORTA goes high. It will then light an LED on bit 0 of PORTB. The PIC will then wait until a second switch, connected this time to bit 1 of PORTA, goes high. When this happens, the LED on bit 0 of PORTB will be turned off. Note that both switches will be single momentary switches, that is, they will stay high only when they ...

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

Intermediate C Programming for the PIC Microcontroller: Simplifying Embedded Programming

Intermediate C Programming for the PIC Microcontroller: Simplifying Embedded Programming

Hubert Henry Ward

Publisher Resources

ISBN: 9781484255254Purchase LinkPublisher Website