University of Plymouth - Stages 1, 2 and 3
/
ELEC241-C1-ReactionTime
Starter code for ELEC241 C1 2019-2020
main.cpp@0:9e572b2e2cc8, 2020-03-06 (annotated)
- Committer:
- noutram
- Date:
- Fri Mar 06 15:08:39 2020 +0000
- Revision:
- 0:9e572b2e2cc8
Starter code for ELEC241 C1
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
noutram | 0:9e572b2e2cc8 | 1 | /* mbed Microcontroller Library |
noutram | 0:9e572b2e2cc8 | 2 | * Copyright (c) 2019 ARM Limited |
noutram | 0:9e572b2e2cc8 | 3 | * SPDX-License-Identifier: Apache-2.0 |
noutram | 0:9e572b2e2cc8 | 4 | */ |
noutram | 0:9e572b2e2cc8 | 5 | |
noutram | 0:9e572b2e2cc8 | 6 | #include "mbed.h" |
noutram | 0:9e572b2e2cc8 | 7 | |
noutram | 0:9e572b2e2cc8 | 8 | DigitalOut led1(LED1); |
noutram | 0:9e572b2e2cc8 | 9 | DigitalOut led2(LED2); |
noutram | 0:9e572b2e2cc8 | 10 | DigitalOut led3(LED3); |
noutram | 0:9e572b2e2cc8 | 11 | InterruptIn Button(USER_BUTTON); |
noutram | 0:9e572b2e2cc8 | 12 | |
noutram | 0:9e572b2e2cc8 | 13 | int main() |
noutram | 0:9e572b2e2cc8 | 14 | { |
noutram | 0:9e572b2e2cc8 | 15 | // Initialise the digital pin LED1 as an output |
noutram | 0:9e572b2e2cc8 | 16 | |
noutram | 0:9e572b2e2cc8 | 17 | while (true) { |
noutram | 0:9e572b2e2cc8 | 18 | sleep(); |
noutram | 0:9e572b2e2cc8 | 19 | } |
noutram | 0:9e572b2e2cc8 | 20 | } |