DC motor and Servo
Dependencies: DC_Motor Servo mbed
Fork of Lab2_41 by
main.cpp@0:5ea7adc7e9cf, 2018-09-27 (annotated)
- Committer:
- Red_Nova_Six
- Date:
- Thu Sep 27 19:12:14 2018 +0000
- Revision:
- 0:5ea7adc7e9cf
- Child:
- 1:88e499bfdcc7
m
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Red_Nova_Six | 0:5ea7adc7e9cf | 1 | #include "mbed.h" |
Red_Nova_Six | 0:5ea7adc7e9cf | 2 | #include "Servo.h" |
Red_Nova_Six | 0:5ea7adc7e9cf | 3 | |
Red_Nova_Six | 0:5ea7adc7e9cf | 4 | Servo myservo1(p21); |
Red_Nova_Six | 0:5ea7adc7e9cf | 5 | Servo myservo2(p22); |
Red_Nova_Six | 0:5ea7adc7e9cf | 6 | |
Red_Nova_Six | 0:5ea7adc7e9cf | 7 | int main() |
Red_Nova_Six | 0:5ea7adc7e9cf | 8 | { |
Red_Nova_Six | 0:5ea7adc7e9cf | 9 | myservo1.calibrate(0.0009,90); |
Red_Nova_Six | 0:5ea7adc7e9cf | 10 | myservo2.calibrate(0.0009,90); |
Red_Nova_Six | 0:5ea7adc7e9cf | 11 | while(1) |
Red_Nova_Six | 0:5ea7adc7e9cf | 12 | { |
Red_Nova_Six | 0:5ea7adc7e9cf | 13 | myservo1=1; |
Red_Nova_Six | 0:5ea7adc7e9cf | 14 | myservo2=0; |
Red_Nova_Six | 0:5ea7adc7e9cf | 15 | wait(5); |
Red_Nova_Six | 0:5ea7adc7e9cf | 16 | myservo1=0; |
Red_Nova_Six | 0:5ea7adc7e9cf | 17 | myservo2=1; |
Red_Nova_Six | 0:5ea7adc7e9cf | 18 | wait(5); |
Red_Nova_Six | 0:5ea7adc7e9cf | 19 | |
Red_Nova_Six | 0:5ea7adc7e9cf | 20 | |
Red_Nova_Six | 0:5ea7adc7e9cf | 21 | } |
Red_Nova_Six | 0:5ea7adc7e9cf | 22 | |
Red_Nova_Six | 0:5ea7adc7e9cf | 23 | |
Red_Nova_Six | 0:5ea7adc7e9cf | 24 | } |