Priyank Kalgaonkar
/
TALab3BsliderECE595
ECE595 - Lab 3 Part 2 - Slider Potentiometer Program - TA
main.cpp@0:4cb6e9d0da34, 2021-01-15 (annotated)
- Committer:
- priyank12p
- Date:
- Fri Jan 15 23:55:27 2021 +0000
- Revision:
- 0:4cb6e9d0da34
- Child:
- 1:93e233c997ad
initial commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
priyank12p | 0:4cb6e9d0da34 | 1 | /* mbed Microcontroller Library |
priyank12p | 0:4cb6e9d0da34 | 2 | * Copyright (c) 2019 ARM Limited |
priyank12p | 0:4cb6e9d0da34 | 3 | * SPDX-License-Identifier: Apache-2.0 |
priyank12p | 0:4cb6e9d0da34 | 4 | */ |
priyank12p | 0:4cb6e9d0da34 | 5 | |
priyank12p | 0:4cb6e9d0da34 | 6 | #include "mbed.h" |
priyank12p | 0:4cb6e9d0da34 | 7 | |
priyank12p | 0:4cb6e9d0da34 | 8 | DigitalIn button(D6); |
priyank12p | 0:4cb6e9d0da34 | 9 | |
priyank12p | 0:4cb6e9d0da34 | 10 | int main() |
priyank12p | 0:4cb6e9d0da34 | 11 | { |
priyank12p | 0:4cb6e9d0da34 | 12 | while(1){ |
priyank12p | 0:4cb6e9d0da34 | 13 | if(button){ |
priyank12p | 0:4cb6e9d0da34 | 14 | printf("Button Pressed\n\r"); |
priyank12p | 0:4cb6e9d0da34 | 15 | wait(0.7); // simple debouncing |
priyank12p | 0:4cb6e9d0da34 | 16 | } |
priyank12p | 0:4cb6e9d0da34 | 17 | } |
priyank12p | 0:4cb6e9d0da34 | 18 | |
priyank12p | 0:4cb6e9d0da34 | 19 | } |