Priyank Kalgaonkar
/
TALab3BsliderECE595
ECE595 - Lab 3 Part 2 - Slider Potentiometer Program - TA
main.cpp@2:adc51888ece5, 2021-01-16 (annotated)
- Committer:
- priyank12p
- Date:
- Sat Jan 16 00:53:52 2021 +0000
- Revision:
- 2:adc51888ece5
- Parent:
- 1:93e233c997ad
Initial Commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
priyank12p | 1:93e233c997ad | 1 | #include "mbed.h" |
priyank12p | 0:4cb6e9d0da34 | 2 | |
priyank12p | 2:adc51888ece5 | 3 | AnalogIn pot(A0); |
priyank12p | 2:adc51888ece5 | 4 | DigitalOut led(A1); |
priyank12p | 0:4cb6e9d0da34 | 5 | |
priyank12p | 2:adc51888ece5 | 6 | int main (void) { |
priyank12p | 2:adc51888ece5 | 7 | float value = 0.0f; |
priyank12p | 1:93e233c997ad | 8 | while(1) { |
priyank12p | 2:adc51888ece5 | 9 | value = pot; |
priyank12p | 2:adc51888ece5 | 10 | printf("Slide location %3.2f\n", value); |
priyank12p | 2:adc51888ece5 | 11 | wait(0.5f); |
priyank12p | 2:adc51888ece5 | 12 | led = !led; |
priyank12p | 1:93e233c997ad | 13 | } |
priyank12p | 1:93e233c997ad | 14 | } |