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-STM32F103C8T6 mbed
main.cpp@0:7379e65596b6, 2017-04-29 (annotated)
- Committer:
- BaserK
- Date:
- Sat Apr 29 15:28:36 2017 +0000
- Revision:
- 0:7379e65596b6
*
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| BaserK | 0:7379e65596b6 | 1 | #include "stm32f103c8t6.h" |
| BaserK | 0:7379e65596b6 | 2 | #include "mbed.h" |
| BaserK | 0:7379e65596b6 | 3 | |
| BaserK | 0:7379e65596b6 | 4 | // Digital In Example |
| BaserK | 0:7379e65596b6 | 5 | // Reads the input from a button and changes the state of the |
| BaserK | 0:7379e65596b6 | 6 | // on-board led accordingly |
| BaserK | 0:7379e65596b6 | 7 | |
| BaserK | 0:7379e65596b6 | 8 | DigitalOut led(PB_12); |
| BaserK | 0:7379e65596b6 | 9 | DigitalIn button(PB_13); |
| BaserK | 0:7379e65596b6 | 10 | |
| BaserK | 0:7379e65596b6 | 11 | bool data = 0; |
| BaserK | 0:7379e65596b6 | 12 | |
| BaserK | 0:7379e65596b6 | 13 | int main() |
| BaserK | 0:7379e65596b6 | 14 | { |
| BaserK | 0:7379e65596b6 | 15 | confSysClock(); //Configure system clock (72MHz HSE clock, 48MHz USB clock) |
| BaserK | 0:7379e65596b6 | 16 | |
| BaserK | 0:7379e65596b6 | 17 | while (1) |
| BaserK | 0:7379e65596b6 | 18 | { |
| BaserK | 0:7379e65596b6 | 19 | led = 1 - button; |
| BaserK | 0:7379e65596b6 | 20 | } |
| BaserK | 0:7379e65596b6 | 21 | } |