Brian Moloney
/
Brian_Lab_Q_2_2
main.cpp@0:16424cb1e710, 2020-07-24 (annotated)
- Committer:
- bmol
- Date:
- Fri Jul 24 15:32:10 2020 +0000
- Revision:
- 0:16424cb1e710
IT Tralee lab
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
bmol | 0:16424cb1e710 | 1 | #include "mbed.h" |
bmol | 0:16424cb1e710 | 2 | |
bmol | 0:16424cb1e710 | 3 | PwmOut led1(LED1); |
bmol | 0:16424cb1e710 | 4 | AnalogIn pot1(p19); //Pot1 is used to control the intensity of the led |
bmol | 0:16424cb1e710 | 5 | |
bmol | 0:16424cb1e710 | 6 | int main() { // Int Main is used at the start of every program |
bmol | 0:16424cb1e710 | 7 | while(1) { |
bmol | 0:16424cb1e710 | 8 | led1 = pot1; |
bmol | 0:16424cb1e710 | 9 | wait(0.01); |
bmol | 0:16424cb1e710 | 10 | } |
bmol | 0:16424cb1e710 | 11 | } |