jordan harper
/
ServoControl
Control servo motors
SystemFunctions.h@0:b5ce567b469c, 2017-02-07 (annotated)
- Committer:
- jordaahh
- Date:
- Tue Feb 07 13:25:10 2017 +0000
- Revision:
- 0:b5ce567b469c
- Child:
- 1:d5cc5d977c0d
Algorithm in main is used to control a single servo with potentiometer. Function prototypes for the automated control have been added in as well.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jordaahh | 0:b5ce567b469c | 1 | |
jordaahh | 0:b5ce567b469c | 2 | Servo servo1(p21); // PWM out to servo in first axis (Solar Azimuth) |
jordaahh | 0:b5ce567b469c | 3 | Servo servo2(p22); // PWM out to servo in second axis (Solar Altitude) |
jordaahh | 0:b5ce567b469c | 4 | |
jordaahh | 0:b5ce567b469c | 5 | AnalogIn pot(p20); |
jordaahh | 0:b5ce567b469c | 6 | |
jordaahh | 0:b5ce567b469c | 7 | AnalogIn LDR1(p15); // Top Left LDR |
jordaahh | 0:b5ce567b469c | 8 | AnalogIn LDR2(p16); // Top Right LDR |
jordaahh | 0:b5ce567b469c | 9 | AnalogIn LDR3(p17); // Bottom Left LDR |
jordaahh | 0:b5ce567b469c | 10 | AnalogIn LDR4(p18); // Bottom Right LDR |
jordaahh | 0:b5ce567b469c | 11 | |
jordaahh | 0:b5ce567b469c | 12 | float range = 0.00095; // maximum on period set to 0.95ms |
jordaahh | 0:b5ce567b469c | 13 | float position; //= 0.5; // set initial position to middle // can probably take this out?? |