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:16161e5455f6, 2021-07-14 (annotated)
- Committer:
- friedrichalicia
- Date:
- Wed Jul 14 14:14:59 2021 +0000
- Revision:
- 0:16161e5455f6
hallo:c
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| friedrichalicia | 0:16161e5455f6 | 1 | /* mbed Microcontroller Library |
| friedrichalicia | 0:16161e5455f6 | 2 | * Copyright (c) 2019 ARM Limited |
| friedrichalicia | 0:16161e5455f6 | 3 | * SPDX-License-Identifier: Apache-2.0 |
| friedrichalicia | 0:16161e5455f6 | 4 | */ |
| friedrichalicia | 0:16161e5455f6 | 5 | |
| friedrichalicia | 0:16161e5455f6 | 6 | #include "mbed.h" |
| friedrichalicia | 0:16161e5455f6 | 7 | #include "platform/mbed_thread.h" |
| friedrichalicia | 0:16161e5455f6 | 8 | |
| friedrichalicia | 0:16161e5455f6 | 9 | |
| friedrichalicia | 0:16161e5455f6 | 10 | DigitalInOut se1InOut(PB_6); |
| friedrichalicia | 0:16161e5455f6 | 11 | DigitalIn se1In(PB_6); |
| friedrichalicia | 0:16161e5455f6 | 12 | |
| friedrichalicia | 0:16161e5455f6 | 13 | DigitalInOut se2InOut(PB_7); |
| friedrichalicia | 0:16161e5455f6 | 14 | DigitalIn se2In(PB_7); |
| friedrichalicia | 0:16161e5455f6 | 15 | |
| friedrichalicia | 0:16161e5455f6 | 16 | DigitalIn eingabeTaste(PA_1); |
| friedrichalicia | 0:16161e5455f6 | 17 | DigitalIn eingabeTaste2(PA_10); |
| friedrichalicia | 0:16161e5455f6 | 18 | DigitalOut testSE1(PC_0); |
| friedrichalicia | 0:16161e5455f6 | 19 | DigitalOut testSE2(PC_1); |
| friedrichalicia | 0:16161e5455f6 | 20 | |
| friedrichalicia | 0:16161e5455f6 | 21 | int main() |
| friedrichalicia | 0:16161e5455f6 | 22 | { |
| friedrichalicia | 0:16161e5455f6 | 23 | se1InOut.output(); |
| friedrichalicia | 0:16161e5455f6 | 24 | se1InOut.mode(OpenDrain); |
| friedrichalicia | 0:16161e5455f6 | 25 | se1In.mode(PullUp); |
| friedrichalicia | 0:16161e5455f6 | 26 | |
| friedrichalicia | 0:16161e5455f6 | 27 | |
| friedrichalicia | 0:16161e5455f6 | 28 | se2InOut.output(); |
| friedrichalicia | 0:16161e5455f6 | 29 | se2InOut.mode(OpenDrain); |
| friedrichalicia | 0:16161e5455f6 | 30 | se2In.mode(PullUp); |
| friedrichalicia | 0:16161e5455f6 | 31 | |
| friedrichalicia | 0:16161e5455f6 | 32 | eingabeTaste.mode(PullDown); |
| friedrichalicia | 0:16161e5455f6 | 33 | eingabeTaste2.mode(PullDown); |
| friedrichalicia | 0:16161e5455f6 | 34 | |
| friedrichalicia | 0:16161e5455f6 | 35 | while(true) |
| friedrichalicia | 0:16161e5455f6 | 36 | { |
| friedrichalicia | 0:16161e5455f6 | 37 | se1InOut = eingabeTaste; |
| friedrichalicia | 0:16161e5455f6 | 38 | se2InOut = eingabeTaste2; |
| friedrichalicia | 0:16161e5455f6 | 39 | testSE1 = se1In; |
| friedrichalicia | 0:16161e5455f6 | 40 | testSE2 = se2In; |
| friedrichalicia | 0:16161e5455f6 | 41 | } |
| friedrichalicia | 0:16161e5455f6 | 42 | } |