Selvakumar Samuel
/
Board1Prg1
Program for Board1 Black button
Fork of Board1Prg1 by
main.cpp@0:af784625c6c0, 2018-03-28 (annotated)
- Committer:
- selvakumararm
- Date:
- Wed Mar 28 07:31:54 2018 +0000
- Revision:
- 0:af784625c6c0
Testing
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
selvakumararm | 0:af784625c6c0 | 1 | #include "mbed.h" |
selvakumararm | 0:af784625c6c0 | 2 | |
selvakumararm | 0:af784625c6c0 | 3 | DigitalOut myled(LED1); |
selvakumararm | 0:af784625c6c0 | 4 | DigitalIn button1(USER_BUTTON); |
selvakumararm | 0:af784625c6c0 | 5 | |
selvakumararm | 0:af784625c6c0 | 6 | int main() { |
selvakumararm | 0:af784625c6c0 | 7 | while(1) { |
selvakumararm | 0:af784625c6c0 | 8 | if(button1 ==1){ |
selvakumararm | 0:af784625c6c0 | 9 | myled = 1; // LED is ON |
selvakumararm | 0:af784625c6c0 | 10 | wait(1.0); // 1 sec |
selvakumararm | 0:af784625c6c0 | 11 | myled = 0; // LED is OFF |
selvakumararm | 0:af784625c6c0 | 12 | wait(1.0); // 1 sec |
selvakumararm | 0:af784625c6c0 | 13 | } |
selvakumararm | 0:af784625c6c0 | 14 | else{ |
selvakumararm | 0:af784625c6c0 | 15 | myled = 0; |
selvakumararm | 0:af784625c6c0 | 16 | } |
selvakumararm | 0:af784625c6c0 | 17 | }} |