フォトリフレクタprpr
Dependencies: mbed
main.cpp@0:dff288c3f0f6, 2018-07-14 (annotated)
- Committer:
- yuron
- Date:
- Sat Jul 14 02:18:25 2018 +0000
- Revision:
- 0:dff288c3f0f6
????????prpr;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
yuron | 0:dff288c3f0f6 | 1 | #include "mbed.h" |
yuron | 0:dff288c3f0f6 | 2 | |
yuron | 0:dff288c3f0f6 | 3 | DigitalIn photo(D7); |
yuron | 0:dff288c3f0f6 | 4 | DigitalOut myled(D13); |
yuron | 0:dff288c3f0f6 | 5 | |
yuron | 0:dff288c3f0f6 | 6 | int main() { |
yuron | 0:dff288c3f0f6 | 7 | while(1) { |
yuron | 0:dff288c3f0f6 | 8 | if(photo == 1){ |
yuron | 0:dff288c3f0f6 | 9 | myled = 1; |
yuron | 0:dff288c3f0f6 | 10 | } else { |
yuron | 0:dff288c3f0f6 | 11 | myled = 0; |
yuron | 0:dff288c3f0f6 | 12 | } |
yuron | 0:dff288c3f0f6 | 13 | } |
yuron | 0:dff288c3f0f6 | 14 | } |