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:10a83d6e8aba, 2021-07-26 (annotated)
- Committer:
- jack1930
- Date:
- Mon Jul 26 15:19:39 2021 +0000
- Revision:
- 0:10a83d6e8aba
neu
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| jack1930 | 0:10a83d6e8aba | 1 | /* mbed Microcontroller Library |
| jack1930 | 0:10a83d6e8aba | 2 | * Copyright (c) 2019 ARM Limited |
| jack1930 | 0:10a83d6e8aba | 3 | * SPDX-License-Identifier: Apache-2.0 |
| jack1930 | 0:10a83d6e8aba | 4 | */ |
| jack1930 | 0:10a83d6e8aba | 5 | |
| jack1930 | 0:10a83d6e8aba | 6 | #include "mbed.h" |
| jack1930 | 0:10a83d6e8aba | 7 | |
| jack1930 | 0:10a83d6e8aba | 8 | // Initialise the digital pin LED1 as an output |
| jack1930 | 0:10a83d6e8aba | 9 | DigitalOut led(LED1); |
| jack1930 | 0:10a83d6e8aba | 10 | PortOut leds(PortC,0b11111111); |
| jack1930 | 0:10a83d6e8aba | 11 | DigitalIn taste(PC_13); |
| jack1930 | 0:10a83d6e8aba | 12 | |
| jack1930 | 0:10a83d6e8aba | 13 | |
| jack1930 | 0:10a83d6e8aba | 14 | int main() |
| jack1930 | 0:10a83d6e8aba | 15 | { |
| jack1930 | 0:10a83d6e8aba | 16 | |
| jack1930 | 0:10a83d6e8aba | 17 | |
| jack1930 | 0:10a83d6e8aba | 18 | while (true) { |
| jack1930 | 0:10a83d6e8aba | 19 | if (taste==0) |
| jack1930 | 0:10a83d6e8aba | 20 | { |
| jack1930 | 0:10a83d6e8aba | 21 | led = !led; |
| jack1930 | 0:10a83d6e8aba | 22 | leds=leds+1; |
| jack1930 | 0:10a83d6e8aba | 23 | HAL_Delay(1000); |
| jack1930 | 0:10a83d6e8aba | 24 | } |
| jack1930 | 0:10a83d6e8aba | 25 | } |
| jack1930 | 0:10a83d6e8aba | 26 | } |