![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Vejam ai essa merda
Dependencies: HC_SR04_Ultrasonic_Library mbed
sonar.cpp@0:498cbd4c79e9, 2016-09-21 (annotated)
- Committer:
- Edgar2016
- Date:
- Wed Sep 21 18:43:01 2016 +0000
- Revision:
- 0:498cbd4c79e9
V? ai se v?
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Edgar2016 | 0:498cbd4c79e9 | 1 | #include "sonar.h" |
Edgar2016 | 0:498cbd4c79e9 | 2 | #include "mbed.h" |
Edgar2016 | 0:498cbd4c79e9 | 3 | #include "ultrasonic.h" |
Edgar2016 | 0:498cbd4c79e9 | 4 | |
Edgar2016 | 0:498cbd4c79e9 | 5 | Sonar::Sonar(): |
Edgar2016 | 0:498cbd4c79e9 | 6 | _ultrasonic(Sonar::trigger, Sonar::echo, Sonar::updateTime, Sonar::timeout) |
Edgar2016 | 0:498cbd4c79e9 | 7 | { |
Edgar2016 | 0:498cbd4c79e9 | 8 | |
Edgar2016 | 0:498cbd4c79e9 | 9 | |
Edgar2016 | 0:498cbd4c79e9 | 10 | } |
Edgar2016 | 0:498cbd4c79e9 | 11 | float Sonar::lerDistancia(ultrasonic _ultrasonic){ |
Edgar2016 | 0:498cbd4c79e9 | 12 | |
Edgar2016 | 0:498cbd4c79e9 | 13 | float distancia = _ultrasonic.getCurrentDistance(); |
Edgar2016 | 0:498cbd4c79e9 | 14 | return distancia; |
Edgar2016 | 0:498cbd4c79e9 | 15 | |
Edgar2016 | 0:498cbd4c79e9 | 16 | } |