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.
main.cpp@0:72680658bf08, 2014-12-30 (annotated)
- Committer:
- alevelara
- Date:
- Tue Dec 30 18:17:12 2014 +0000
- Revision:
- 0:72680658bf08
Servo move
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
alevelara | 0:72680658bf08 | 1 | #include "mbed.h" |
alevelara | 0:72680658bf08 | 2 | #include "Servo.h" |
alevelara | 0:72680658bf08 | 3 | |
alevelara | 0:72680658bf08 | 4 | Servo myServo(PB_9); |
alevelara | 0:72680658bf08 | 5 | DigitalIn button(USER_BUTTON); |
alevelara | 0:72680658bf08 | 6 | |
alevelara | 0:72680658bf08 | 7 | |
alevelara | 0:72680658bf08 | 8 | int main(){ |
alevelara | 0:72680658bf08 | 9 | myServo.calibrate(0.0005,45.0); |
alevelara | 0:72680658bf08 | 10 | |
alevelara | 0:72680658bf08 | 11 | while(1){ |
alevelara | 0:72680658bf08 | 12 | //While we press the user button, the servo turn right |
alevelara | 0:72680658bf08 | 13 | if(!button){ |
alevelara | 0:72680658bf08 | 14 | myServo.write(0.5); |
alevelara | 0:72680658bf08 | 15 | } |
alevelara | 0:72680658bf08 | 16 | } |
alevelara | 0:72680658bf08 | 17 | } |
alevelara | 0:72680658bf08 | 18 | |
alevelara | 0:72680658bf08 | 19 | |
alevelara | 0:72680658bf08 | 20 |