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.
Dependencies: mbed
main.cpp@0:7aa83f9f0178, 2018-07-06 (annotated)
- Committer:
- Ben51
- Date:
- Fri Jul 06 07:24:23 2018 +0000
- Revision:
- 0:7aa83f9f0178
235435
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| Ben51 | 0:7aa83f9f0178 | 1 | // 04b_Taster_BusIn |
| Ben51 | 0:7aa83f9f0178 | 2 | // hierbei werden die Taster auf der Multi-Functionshield-Platine genutzt |
| Ben51 | 0:7aa83f9f0178 | 3 | #include "mbed.h" |
| Ben51 | 0:7aa83f9f0178 | 4 | // Achtung LSB zuerst |
| Ben51 | 0:7aa83f9f0178 | 5 | BusIn taster(PA_1,PA_4,PB_0); |
| Ben51 | 0:7aa83f9f0178 | 6 | Serial pc(SERIAL_TX, SERIAL_RX); |
| Ben51 | 0:7aa83f9f0178 | 7 | |
| Ben51 | 0:7aa83f9f0178 | 8 | int main() { |
| Ben51 | 0:7aa83f9f0178 | 9 | while (1) { |
| Ben51 | 0:7aa83f9f0178 | 10 | int tasterValue = taster.read(); |
| Ben51 | 0:7aa83f9f0178 | 11 | // Kurzform: int tasterValue = taster; |
| Ben51 | 0:7aa83f9f0178 | 12 | pc.printf("%d ",tasterValue); |
| Ben51 | 0:7aa83f9f0178 | 13 | wait(1.0); |
| Ben51 | 0:7aa83f9f0178 | 14 | } |
| Ben51 | 0:7aa83f9f0178 | 15 | } |