EasyManuals Logo

Microchip Technology PICkit 3 User Manual

Microchip Technology PICkit 3
102 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #65 background imageLoading...
Page #65 background image
Lessons
2012 Microchip Technology Inc. DS41628B-page 65
3.8 LESSON 7: REVERSIBLE VARIABLE SPEED ROTATE
3.8.1 Introduction
This lesson combines all of the previous lessons in using the button to reverse the
direction of rotation when the button is pressed. The speed of rotation is controlled
using the potentiometer.
3.8.2 Hardware Effects
LEDs will rotate at a speed that is proportional to the ADC value. The switch will toggle
the direction of the LEDs.
3.8.3 Summary
The program needs to keep track of rotation direction and new code needs to be added
to rotate in the other direction. Lesson 5 rotates right and checks for a ‘1’ in the carry
bit to determine when to restart the sequence. In Lesson 7, the program needs to rotate
both ways and check for a1’ in bit 4 of the display when rotating to the left. When the
1’ shows up in bit 4 of LATC, it will be re-inserted into bit 0.
FIGURE 3-6: PROGRAM FLOW FOR LESSON 7
Get ADC Measurement
Delay Using ADC Result
Delay 5ms
Is Switch Still Down?
Check if ADC Result is ‘0
Is Switch Down?
Change Direction
YES
YES
NO
Main Init
Was It Held Down Previously?
Rotate LEDs to Left
Rotate LEDs to Right
Left Direction
YES NO
YES
NO
NO

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Microchip Technology PICkit 3 and is the answer not in the manual?

Microchip Technology PICkit 3 Specifications

General IconGeneral
BrandMicrochip Technology
ModelPICkit 3
CategoryComputer Accessories
LanguageEnglish

Related product manuals