Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: Servo mbed Chumbaka_backup
Fork of Servo_HelloWorld by
main.cpp@4:4e2ad2aa99b7, 2014-04-16 (annotated)
- Committer:
- limcheecheng
- Date:
- Wed Apr 16 10:39:31 2014 +0000
- Revision:
- 4:4e2ad2aa99b7
- Parent:
- 3:e836d1c41a0b
- Child:
- 5:805d37469e22
add speaker library
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| limcheecheng | 4:4e2ad2aa99b7 | 1 | // Hello World to sweep a servo through its full range |
| simon | 1:40d2fd0b99e6 | 2 | |
| limcheecheng | 4:4e2ad2aa99b7 | 3 | #include "mbed.h" |
| limcheecheng | 4:4e2ad2aa99b7 | 4 | #include "Servo.h" |
| limcheecheng | 4:4e2ad2aa99b7 | 5 | |
| limcheecheng | 4:4e2ad2aa99b7 | 6 | Servo myservo(PTD4); |
| limcheecheng | 4:4e2ad2aa99b7 | 7 | |
| limcheecheng | 4:4e2ad2aa99b7 | 8 | int main() { |
| simon | 1:40d2fd0b99e6 | 9 | |
| limcheecheng | 4:4e2ad2aa99b7 | 10 | // myservo.calibrate(0.00095, 90.0); |
| limcheecheng | 4:4e2ad2aa99b7 | 11 | |
| limcheecheng | 4:4e2ad2aa99b7 | 12 | while (1){ |
| limcheecheng | 4:4e2ad2aa99b7 | 13 | myservo = 0; |
| limcheecheng | 4:4e2ad2aa99b7 | 14 | wait(1); |
| limcheecheng | 4:4e2ad2aa99b7 | 15 | myservo = 0.5; |
| limcheecheng | 4:4e2ad2aa99b7 | 16 | wait(2); |
| limcheecheng | 4:4e2ad2aa99b7 | 17 | myservo = 1.0; |
| limcheecheng | 4:4e2ad2aa99b7 | 18 | wait(3); |
| limcheecheng | 4:4e2ad2aa99b7 | 19 | } |
| limcheecheng | 4:4e2ad2aa99b7 | 20 | } |
