A simple program that controls the LED1 brightness by using potentiometer.
Dependencies: mbed
main.cpp@0:80eb27fb5770, 2014-12-18 (annotated)
- Committer:
- tbjazic
- Date:
- Thu Dec 18 12:30:47 2014 +0000
- Revision:
- 0:80eb27fb5770
Initial commit.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
tbjazic | 0:80eb27fb5770 | 1 | #include "mbed.h" |
tbjazic | 0:80eb27fb5770 | 2 | |
tbjazic | 0:80eb27fb5770 | 3 | PwmOut led1(LED1); |
tbjazic | 0:80eb27fb5770 | 4 | AnalogIn pot2(p20); |
tbjazic | 0:80eb27fb5770 | 5 | |
tbjazic | 0:80eb27fb5770 | 6 | int main() { |
tbjazic | 0:80eb27fb5770 | 7 | while(1) { |
tbjazic | 0:80eb27fb5770 | 8 | led1 = pot2; |
tbjazic | 0:80eb27fb5770 | 9 | } |
tbjazic | 0:80eb27fb5770 | 10 | } |