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 biquadFilter
main.cpp@0:98ae3feb778c, 2018-10-08 (annotated)
- Committer:
- TimLu
- Date:
- Mon Oct 08 10:46:03 2018 +0000
- Revision:
- 0:98ae3feb778c
- Child:
- 1:93a041e62d7e
Test servo - werkt niet
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| TimLu | 0:98ae3feb778c | 1 | // Continuously sweep the servo through it's full range |
| TimLu | 0:98ae3feb778c | 2 | #include "mbed.h" |
| TimLu | 0:98ae3feb778c | 3 | #include "Servo.h" |
| TimLu | 0:98ae3feb778c | 4 | |
| TimLu | 0:98ae3feb778c | 5 | Servo myservo(D1); |
| TimLu | 0:98ae3feb778c | 6 | |
| TimLu | 0:98ae3feb778c | 7 | int main() { |
| TimLu | 0:98ae3feb778c | 8 | while(1) { |
| TimLu | 0:98ae3feb778c | 9 | for(int i=0; i<100; i++) { |
| TimLu | 0:98ae3feb778c | 10 | myservo = i/100.0; |
| TimLu | 0:98ae3feb778c | 11 | wait(0.01); |
| TimLu | 0:98ae3feb778c | 12 | } |
| TimLu | 0:98ae3feb778c | 13 | for(int i=100; i>0; i--) { |
| TimLu | 0:98ae3feb778c | 14 | myservo = i/100.0; |
| TimLu | 0:98ae3feb778c | 15 | wait(0.01); |
| TimLu | 0:98ae3feb778c | 16 | } |
| TimLu | 0:98ae3feb778c | 17 | } |
| TimLu | 0:98ae3feb778c | 18 | } |