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: mbed
main.cpp@0:0d63c17e7b7a, 2021-01-19 (annotated)
- Committer:
- gtarronge1
- Date:
- Tue Jan 19 10:46:46 2021 +0000
- Revision:
- 0:0d63c17e7b7a
test;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
gtarronge1 | 0:0d63c17e7b7a | 1 | #include "mbed.h" |
gtarronge1 | 0:0d63c17e7b7a | 2 | |
gtarronge1 | 0:0d63c17e7b7a | 3 | PwmOut servo(p21); |
gtarronge1 | 0:0d63c17e7b7a | 4 | |
gtarronge1 | 0:0d63c17e7b7a | 5 | void servo_joueur(); |
gtarronge1 | 0:0d63c17e7b7a | 6 | |
gtarronge1 | 0:0d63c17e7b7a | 7 | int main() |
gtarronge1 | 0:0d63c17e7b7a | 8 | { |
gtarronge1 | 0:0d63c17e7b7a | 9 | servo.period_ms(20); |
gtarronge1 | 0:0d63c17e7b7a | 10 | // servo.pulsewidth_us(2325/2); |
gtarronge1 | 0:0d63c17e7b7a | 11 | while(1) |
gtarronge1 | 0:0d63c17e7b7a | 12 | { |
gtarronge1 | 0:0d63c17e7b7a | 13 | servo_joueur(); |
gtarronge1 | 0:0d63c17e7b7a | 14 | } |
gtarronge1 | 0:0d63c17e7b7a | 15 | } |
gtarronge1 | 0:0d63c17e7b7a | 16 | |
gtarronge1 | 0:0d63c17e7b7a | 17 | void servo_joueur(void) |
gtarronge1 | 0:0d63c17e7b7a | 18 | { |
gtarronge1 | 0:0d63c17e7b7a | 19 | servo.pulsewidth_us(1000); |
gtarronge1 | 0:0d63c17e7b7a | 20 | wait_ms(750); |
gtarronge1 | 0:0d63c17e7b7a | 21 | servo.pulsewidth_us(2200); |
gtarronge1 | 0:0d63c17e7b7a | 22 | wait_ms(750); |
gtarronge1 | 0:0d63c17e7b7a | 23 | } |