Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp@0:3ac1dc174e02, 2019-10-07 (annotated)
- Committer:
- smekata
- Date:
- Mon Oct 07 04:49:34 2019 +0000
- Revision:
- 0:3ac1dc174e02
sensor degital
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
smekata | 0:3ac1dc174e02 | 1 | #include "mbed.h" |
smekata | 0:3ac1dc174e02 | 2 | |
smekata | 0:3ac1dc174e02 | 3 | DigitalOut myled1(PTB8); |
smekata | 0:3ac1dc174e02 | 4 | |
smekata | 0:3ac1dc174e02 | 5 | DigitalIn sensor1(PTD7); |
smekata | 0:3ac1dc174e02 | 6 | |
smekata | 0:3ac1dc174e02 | 7 | int main(){ |
smekata | 0:3ac1dc174e02 | 8 | while(1){ |
smekata | 0:3ac1dc174e02 | 9 | if(sensor1 == 0){ |
smekata | 0:3ac1dc174e02 | 10 | myled1 = 1; |
smekata | 0:3ac1dc174e02 | 11 | } else if (sensor1 == 1){ |
smekata | 0:3ac1dc174e02 | 12 | myled1 = 0; |
smekata | 0:3ac1dc174e02 | 13 | } |
smekata | 0:3ac1dc174e02 | 14 | } |
smekata | 0:3ac1dc174e02 | 15 | } |