![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Decimal, ascii, hexadecimal
main.cpp@0:7e938a43da08, 2020-02-01 (annotated)
- Committer:
- javierdavid2006
- Date:
- Sat Feb 01 16:44:18 2020 +0000
- Revision:
- 0:7e938a43da08
Contador hecho en clase
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
javierdavid2006 | 0:7e938a43da08 | 1 | #include "mbed.h" |
javierdavid2006 | 0:7e938a43da08 | 2 | Serial device(PA_2,PA_3); |
javierdavid2006 | 0:7e938a43da08 | 3 | int i = 1; |
javierdavid2006 | 0:7e938a43da08 | 4 | |
javierdavid2006 | 0:7e938a43da08 | 5 | int main() |
javierdavid2006 | 0:7e938a43da08 | 6 | { |
javierdavid2006 | 0:7e938a43da08 | 7 | device.baud(115200); |
javierdavid2006 | 0:7e938a43da08 | 8 | |
javierdavid2006 | 0:7e938a43da08 | 9 | i= 1; |
javierdavid2006 | 0:7e938a43da08 | 10 | device.printf("Envio en Decimal del 1 al 256 %d \r\n", i);//Envio en Digito |
javierdavid2006 | 0:7e938a43da08 | 11 | while(i <= 250) { |
javierdavid2006 | 0:7e938a43da08 | 12 | device.printf("%d\r", i);//Envio en Digito |
javierdavid2006 | 0:7e938a43da08 | 13 | //wait(0.2); |
javierdavid2006 | 0:7e938a43da08 | 14 | i++; |
javierdavid2006 | 0:7e938a43da08 | 15 | } |
javierdavid2006 | 0:7e938a43da08 | 16 | |
javierdavid2006 | 0:7e938a43da08 | 17 | i = 1; |
javierdavid2006 | 0:7e938a43da08 | 18 | device.printf("Envio en ascii del 1 al 256 %c \r\n", i); |
javierdavid2006 | 0:7e938a43da08 | 19 | while(i <=250) { |
javierdavid2006 | 0:7e938a43da08 | 20 | device.printf(" %c\r", i);//Envio en Digito |
javierdavid2006 | 0:7e938a43da08 | 21 | //wait(0.2); |
javierdavid2006 | 0:7e938a43da08 | 22 | i++; |
javierdavid2006 | 0:7e938a43da08 | 23 | |
javierdavid2006 | 0:7e938a43da08 | 24 | } |
javierdavid2006 | 0:7e938a43da08 | 25 | i = 1; |
javierdavid2006 | 0:7e938a43da08 | 26 | device.printf("Envio en hexadecimal del 1 al 256 %x \r\n", i); |
javierdavid2006 | 0:7e938a43da08 | 27 | while(i <=250) { |
javierdavid2006 | 0:7e938a43da08 | 28 | device.printf("%x\r", i);//Envio en Digito |
javierdavid2006 | 0:7e938a43da08 | 29 | //wait(0.2); |
javierdavid2006 | 0:7e938a43da08 | 30 | i++; |
javierdavid2006 | 0:7e938a43da08 | 31 | |
javierdavid2006 | 0:7e938a43da08 | 32 | } |
javierdavid2006 | 0:7e938a43da08 | 33 | } |