December 2019
Intermediate to advanced
282 pages
4h 22m
English
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 ...