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.
function.h@1:3d05c0de31ae, 2016-08-22 (annotated)
- Committer:
- choutin
- Date:
- Mon Aug 22 07:26:20 2016 +0000
- Revision:
- 1:3d05c0de31ae
- Child:
- 2:95555e722c03
2nd
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| choutin | 1:3d05c0de31ae | 1 | |
| choutin | 1:3d05c0de31ae | 2 | |
| choutin | 1:3d05c0de31ae | 3 | |
| choutin | 1:3d05c0de31ae | 4 | |
| choutin | 1:3d05c0de31ae | 5 | void close_hand(void) { |
| choutin | 1:3d05c0de31ae | 6 | PwmOut mypwm(PB_3); |
| choutin | 1:3d05c0de31ae | 7 | int i,degree; |
| choutin | 1:3d05c0de31ae | 8 | |
| choutin | 1:3d05c0de31ae | 9 | mypwm.period_ms(20); //20ms |
| choutin | 1:3d05c0de31ae | 10 | |
| choutin | 1:3d05c0de31ae | 11 | degree=0; |
| choutin | 1:3d05c0de31ae | 12 | |
| choutin | 1:3d05c0de31ae | 13 | i=500+degree*1900/180; |
| choutin | 1:3d05c0de31ae | 14 | mypwm.pulsewidth_us(i); |
| choutin | 1:3d05c0de31ae | 15 | |
| choutin | 1:3d05c0de31ae | 16 | |
| choutin | 1:3d05c0de31ae | 17 | } |
| choutin | 1:3d05c0de31ae | 18 | |
| choutin | 1:3d05c0de31ae | 19 | void close_arm(void) { |
| choutin | 1:3d05c0de31ae | 20 | PwmOut mypwm(PB_3); |
| choutin | 1:3d05c0de31ae | 21 | int i,degree; |
| choutin | 1:3d05c0de31ae | 22 | |
| choutin | 1:3d05c0de31ae | 23 | mypwm.period_ms(20); //20ms |
| choutin | 1:3d05c0de31ae | 24 | |
| choutin | 1:3d05c0de31ae | 25 | degree=0; |
| choutin | 1:3d05c0de31ae | 26 | |
| choutin | 1:3d05c0de31ae | 27 | i=500+degree*1900/180; |
| choutin | 1:3d05c0de31ae | 28 | mypwm.pulsewidth_us(i); |
| choutin | 1:3d05c0de31ae | 29 | |
| choutin | 1:3d05c0de31ae | 30 | |
| choutin | 1:3d05c0de31ae | 31 | } |
| choutin | 1:3d05c0de31ae | 32 | |
| choutin | 1:3d05c0de31ae | 33 | |
| choutin | 1:3d05c0de31ae | 34 | |
| choutin | 1:3d05c0de31ae | 35 | void open_hand(void) { |
| choutin | 1:3d05c0de31ae | 36 | PwmOut mypwm(PWM_OUT); |
| choutin | 1:3d05c0de31ae | 37 | int i,degree; |
| choutin | 1:3d05c0de31ae | 38 | |
| choutin | 1:3d05c0de31ae | 39 | mypwm.period_ms(20); //20ms |
| choutin | 1:3d05c0de31ae | 40 | |
| choutin | 1:3d05c0de31ae | 41 | degree=180; |
| choutin | 1:3d05c0de31ae | 42 | |
| choutin | 1:3d05c0de31ae | 43 | i=500+degree*1900/180; |
| choutin | 1:3d05c0de31ae | 44 | mypwm.pulsewidth_us(i); |
| choutin | 1:3d05c0de31ae | 45 | |
| choutin | 1:3d05c0de31ae | 46 | |
| choutin | 1:3d05c0de31ae | 47 | } |
| choutin | 1:3d05c0de31ae | 48 | |
| choutin | 1:3d05c0de31ae | 49 | |
| choutin | 1:3d05c0de31ae | 50 | |
| choutin | 1:3d05c0de31ae | 51 | void open_arm(void) { |
| choutin | 1:3d05c0de31ae | 52 | PwmOut mypwm(PWM_OUT); |
| choutin | 1:3d05c0de31ae | 53 | int i,degree; |
| choutin | 1:3d05c0de31ae | 54 | |
| choutin | 1:3d05c0de31ae | 55 | mypwm.period_ms(20); //20ms |
| choutin | 1:3d05c0de31ae | 56 | |
| choutin | 1:3d05c0de31ae | 57 | degree=180; |
| choutin | 1:3d05c0de31ae | 58 | |
| choutin | 1:3d05c0de31ae | 59 | i=500+degree*1900/180; |
| choutin | 1:3d05c0de31ae | 60 | mypwm.pulsewidth_us(i); |
| choutin | 1:3d05c0de31ae | 61 | |
| choutin | 1:3d05c0de31ae | 62 | |
| choutin | 1:3d05c0de31ae | 63 | } |
| choutin | 1:3d05c0de31ae | 64 | |
| choutin | 1:3d05c0de31ae | 65 | void lift(void) { |
| choutin | 1:3d05c0de31ae | 66 | PwmOut mypwm(PWM_OUT); |
| choutin | 1:3d05c0de31ae | 67 | int i,degree; |
| choutin | 1:3d05c0de31ae | 68 | |
| choutin | 1:3d05c0de31ae | 69 | mypwm.period_ms(20); //20ms |
| choutin | 1:3d05c0de31ae | 70 | |
| choutin | 1:3d05c0de31ae | 71 | degree=180; |
| choutin | 1:3d05c0de31ae | 72 | |
| choutin | 1:3d05c0de31ae | 73 | i=500+degree*1900/180; |
| choutin | 1:3d05c0de31ae | 74 | mypwm.pulsewidth_us(i); |
| choutin | 1:3d05c0de31ae | 75 | |
| choutin | 1:3d05c0de31ae | 76 | |
| choutin | 1:3d05c0de31ae | 77 | } |