Sonar
Dependencies: mbed SDHC_FileSystem DS18B20_1wire HC_SR04_Ultrasonic_Library
main.cpp@0:a449396d32de, 2016-09-22 (annotated)
- Committer:
- igorsilvati
- Date:
- Thu Sep 22 16:18:36 2016 +0000
- Revision:
- 0:a449396d32de
Pega ai
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
igorsilvati | 0:a449396d32de | 1 | #include "mbed.h" |
igorsilvati | 0:a449396d32de | 2 | |
igorsilvati | 0:a449396d32de | 3 | DigitalOut gpo(D0); |
igorsilvati | 0:a449396d32de | 4 | DigitalOut led(LED_RED); |
igorsilvati | 0:a449396d32de | 5 | |
igorsilvati | 0:a449396d32de | 6 | |
igorsilvati | 0:a449396d32de | 7 | int main() |
igorsilvati | 0:a449396d32de | 8 | { |
igorsilvati | 0:a449396d32de | 9 | while (true) { |
igorsilvati | 0:a449396d32de | 10 | gpo = !gpo; // toggle pin |
igorsilvati | 0:a449396d32de | 11 | led = !led; // toggle led |
igorsilvati | 0:a449396d32de | 12 | wait(0.2f); |
igorsilvati | 0:a449396d32de | 13 | } |
igorsilvati | 0:a449396d32de | 14 | } |