Page 75 - Making PIC Microcontroller Instruments and Controllers
P. 75
ADYA CED EXERCISE:
CO TnOlLll{G All BC SERYO FFOiI IHE KEYBOARD
c0
c3
cl
::f,!!iiii9,,gi$lili clrcuitry for controluns an Rc seruo lrom the three
(As
potentiometers. always, only relevantcomponenls Connect
are shown.
the servos to JumDer J7.)
If we had four potentiometers, we could make ths adjushnent to the limirs on one side
independent of the adj ustnent of the other
We will allow the centerposition to be adjusted by 127 counrs in cach direction.
The end positions will be made variable by I 2? counts at each end.
The incremental move will be adjustable from I to 20 counts per key press.
First, we will make it possible to read the potentiometers- We already know how to
do this. Then, we will add the nath relationships to the variable in the program so thc
readings from the poterliomerers interact with the three variables appropriately. (See
Prosram 5.12.)
Pot 0, the one nearest the board edge, controls the center position.
Pot l, the middle pot, controls the limit positions.
Pot 2 sets the speed oi thc se o by sening the step amounr