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:bfbe9528a949, 2018-03-10 (annotated)
- Committer:
- Camilokingxd
- Date:
- Sat Mar 10 15:33:43 2018 +0000
- Revision:
- 0:bfbe9528a949
PRUEBA 1;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Camilokingxd | 0:bfbe9528a949 | 1 | #include "mbed.h" |
Camilokingxd | 0:bfbe9528a949 | 2 | PwmOut sg90azul(PB_9);//SE NOMBRA OBJETO Y SE ESTABLECE PIN DEL OBJETO |
Camilokingxd | 0:bfbe9528a949 | 3 | DigitalOut ledgrande(LED1);//SE PROGRAMA EL LED A UTILIZAR |
Camilokingxd | 0:bfbe9528a949 | 4 | int a=1,x=500; |
Camilokingxd | 0:bfbe9528a949 | 5 | int main() |
Camilokingxd | 0:bfbe9528a949 | 6 | { |
Camilokingxd | 0:bfbe9528a949 | 7 | sg90azul.period_ms(20); |
Camilokingxd | 0:bfbe9528a949 | 8 | while (a<=18) |
Camilokingxd | 0:bfbe9528a949 | 9 | { |
Camilokingxd | 0:bfbe9528a949 | 10 | sg90azul.pulsewidth_us(x); |
Camilokingxd | 0:bfbe9528a949 | 11 | wait_ms(1000); |
Camilokingxd | 0:bfbe9528a949 | 12 | x=x+120; |
Camilokingxd | 0:bfbe9528a949 | 13 | a++; |
Camilokingxd | 0:bfbe9528a949 | 14 | if(a==18) |
Camilokingxd | 0:bfbe9528a949 | 15 | { |
Camilokingxd | 0:bfbe9528a949 | 16 | while(a>1) |
Camilokingxd | 0:bfbe9528a949 | 17 | { |
Camilokingxd | 0:bfbe9528a949 | 18 | sg90azul.pulsewidth_us(x); |
Camilokingxd | 0:bfbe9528a949 | 19 | wait_ms(1000); |
Camilokingxd | 0:bfbe9528a949 | 20 | x=x-120; |
Camilokingxd | 0:bfbe9528a949 | 21 | a--; |
Camilokingxd | 0:bfbe9528a949 | 22 | } |
Camilokingxd | 0:bfbe9528a949 | 23 | } |
Camilokingxd | 0:bfbe9528a949 | 24 | } |
Camilokingxd | 0:bfbe9528a949 | 25 | } |