![](/media/cache/profiles/avatarGR_79eyiBn.png.50x50_q85.png)
essai
main.cpp@0:b3f6eeee5292, 2020-11-15 (annotated)
- Committer:
- gr91
- Date:
- Sun Nov 15 19:59:41 2020 +0100
- Revision:
- 0:b3f6eeee5292
- Child:
- 2:c70898d59a60
xx
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
gr91 | 0:b3f6eeee5292 | 1 | /* mbed Microcontroller Library |
gr91 | 0:b3f6eeee5292 | 2 | * Copyright (c) 2019 ARM Limited |
gr91 | 0:b3f6eeee5292 | 3 | * SPDX-License-Identifier: Apache-2.0 |
gr91 | 0:b3f6eeee5292 | 4 | */ |
gr91 | 0:b3f6eeee5292 | 5 | |
gr91 | 0:b3f6eeee5292 | 6 | #include "mbed.h" |
gr91 | 0:b3f6eeee5292 | 7 | #include <cstdio> |
gr91 | 0:b3f6eeee5292 | 8 | |
gr91 | 0:b3f6eeee5292 | 9 | #define WAIT_TIME_MS 500 |
gr91 | 0:b3f6eeee5292 | 10 | DigitalOut led1(LED1); |
gr91 | 0:b3f6eeee5292 | 11 | int a=0; |
gr91 | 0:b3f6eeee5292 | 12 | int main() |
gr91 | 0:b3f6eeee5292 | 13 | { |
gr91 | 0:b3f6eeee5292 | 14 | volatile static int b; |
gr91 | 0:b3f6eeee5292 | 15 | volatile int c; |
gr91 | 0:b3f6eeee5292 | 16 | printf("This is the bare metal blinky example running on Mbed OS %d.%d.%d.\n", MBED_MAJOR_VERSION, MBED_MINOR_VERSION, MBED_PATCH_VERSION); |
gr91 | 0:b3f6eeee5292 | 17 | |
gr91 | 0:b3f6eeee5292 | 18 | while (true) |
gr91 | 0:b3f6eeee5292 | 19 | { |
gr91 | 0:b3f6eeee5292 | 20 | a++; |
gr91 | 0:b3f6eeee5292 | 21 | c=a; |
gr91 | 0:b3f6eeee5292 | 22 | b=c; |
gr91 | 0:b3f6eeee5292 | 23 | led1 = !led1; |
gr91 | 0:b3f6eeee5292 | 24 | printf( " a=%d ; b=%d ; c=%d \r\n",a,b,c); |
gr91 | 0:b3f6eeee5292 | 25 | //thread_sleep_for(WAIT_TIME_MS); |
gr91 | 0:b3f6eeee5292 | 26 | wait_us(1000000); |
gr91 | 0:b3f6eeee5292 | 27 | } |
gr91 | 0:b3f6eeee5292 | 28 | } |