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: HIDScope MODSERIAL mbed
Fork of Signal Filter by
main.cpp@0:c8a6e00fbdc3, 2015-09-09 (annotated)
- Committer:
- Peasofcake
- Date:
- Wed Sep 09 12:16:21 2015 +0000
- Revision:
- 0:c8a6e00fbdc3
- Child:
- 1:f6110f80fa45
Eerste zelfgemaakte code;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Peasofcake | 0:c8a6e00fbdc3 | 1 | #include "mbed.h" |
Peasofcake | 0:c8a6e00fbdc3 | 2 | |
Peasofcake | 0:c8a6e00fbdc3 | 3 | |
Peasofcake | 0:c8a6e00fbdc3 | 4 | DigitalOut gpo(D0); |
Peasofcake | 0:c8a6e00fbdc3 | 5 | DigitalOut led(LED_GREEN); |
Peasofcake | 0:c8a6e00fbdc3 | 6 | DigitalIn button(PTA4); |
Peasofcake | 0:c8a6e00fbdc3 | 7 | |
Peasofcake | 0:c8a6e00fbdc3 | 8 | const int led_on = 0; |
Peasofcake | 0:c8a6e00fbdc3 | 9 | const int led_off = 1; |
Peasofcake | 0:c8a6e00fbdc3 | 10 | const int button_pressed = 0; |
Peasofcake | 0:c8a6e00fbdc3 | 11 | |
Peasofcake | 0:c8a6e00fbdc3 | 12 | int main() |
Peasofcake | 0:c8a6e00fbdc3 | 13 | { |
Peasofcake | 0:c8a6e00fbdc3 | 14 | |
Peasofcake | 0:c8a6e00fbdc3 | 15 | |
Peasofcake | 0:c8a6e00fbdc3 | 16 | while (true) { |
Peasofcake | 0:c8a6e00fbdc3 | 17 | if(button.read() == button_pressed) { |
Peasofcake | 0:c8a6e00fbdc3 | 18 | for (int n=0; n<5 ; n++) { |
Peasofcake | 0:c8a6e00fbdc3 | 19 | |
Peasofcake | 0:c8a6e00fbdc3 | 20 | led.write(led_on); |
Peasofcake | 0:c8a6e00fbdc3 | 21 | wait(0.5f); |
Peasofcake | 0:c8a6e00fbdc3 | 22 | |
Peasofcake | 0:c8a6e00fbdc3 | 23 | led.write(led_off); |
Peasofcake | 0:c8a6e00fbdc3 | 24 | |
Peasofcake | 0:c8a6e00fbdc3 | 25 | wait(0.5f); |
Peasofcake | 0:c8a6e00fbdc3 | 26 | } |
Peasofcake | 0:c8a6e00fbdc3 | 27 | } |
Peasofcake | 0:c8a6e00fbdc3 | 28 | } |
Peasofcake | 0:c8a6e00fbdc3 | 29 | } |