essai

Committer:
gr91
Date:
Sun Nov 15 20:04:45 2020 +0100
Revision:
2:c70898d59a60
Parent:
0:b3f6eeee5292
Child:
3:50a5978e692b
zz

Who changed what in which revision?

UserRevisionLine numberNew 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 while (true)
gr91 0:b3f6eeee5292 18 {
gr91 0:b3f6eeee5292 19 a++;
gr91 0:b3f6eeee5292 20 c=a;
gr91 0:b3f6eeee5292 21 b=c;
gr91 0:b3f6eeee5292 22 led1 = !led1;
gr91 0:b3f6eeee5292 23 printf( " a=%d ; b=%d ; c=%d \r\n",a,b,c);
gr91 0:b3f6eeee5292 24 //thread_sleep_for(WAIT_TIME_MS);
gr91 0:b3f6eeee5292 25 wait_us(1000000);
gr91 0:b3f6eeee5292 26 }
gr91 0:b3f6eeee5292 27 }