Marco Rubio
/
RTOS_Controller
Controller for Seagoat in the RoboSub competition
Fork of ESC by
main.cpp@2:aabc14a9a8c8, 2016-05-21 (annotated)
- Committer:
- gelmes
- Date:
- Sat May 21 00:06:43 2016 +0000
- Revision:
- 2:aabc14a9a8c8
- Child:
- 3:5ffe7e9c0bb3
controling LED1 pin now
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
gelmes | 2:aabc14a9a8c8 | 1 | // Continuously sweep the servo through it's full range |
gelmes | 2:aabc14a9a8c8 | 2 | #include "mbed.h" |
gelmes | 2:aabc14a9a8c8 | 3 | #include "Servo.h" |
gelmes | 2:aabc14a9a8c8 | 4 | |
gelmes | 2:aabc14a9a8c8 | 5 | Servo myservo(led1); |
gelmes | 2:aabc14a9a8c8 | 6 | |
gelmes | 2:aabc14a9a8c8 | 7 | int main() { |
gelmes | 2:aabc14a9a8c8 | 8 | while(1) { |
gelmes | 2:aabc14a9a8c8 | 9 | for(int i=0; i<100; i++) { |
gelmes | 2:aabc14a9a8c8 | 10 | myservo = i/100.0; |
gelmes | 2:aabc14a9a8c8 | 11 | wait(0.01); |
gelmes | 2:aabc14a9a8c8 | 12 | } |
gelmes | 2:aabc14a9a8c8 | 13 | for(int i=100; i>0; i--) { |
gelmes | 2:aabc14a9a8c8 | 14 | myservo = i/100.0; |
gelmes | 2:aabc14a9a8c8 | 15 | wait(0.01); |
gelmes | 2:aabc14a9a8c8 | 16 | } |
gelmes | 2:aabc14a9a8c8 | 17 | } |
gelmes | 2:aabc14a9a8c8 | 18 | } |