
The purpose of this code is to rotate an HC-SR04 and measure the perimeter of a room. The measurements will then be sent to ThingSpeak to record the data.
Dependencies: mbed mbed-http TextLCD ESP8266 ULN2003_StepperDriver
main.cpp
- Committer:
- andcor02
- Date:
- 2017-01-13
- Revision:
- 8:25138f7b9309
- Child:
- 9:607ee6e92552
File content as of revision 8:25138f7b9309:
#include "mbed.h" #include "hcsr04.h" DigitalOut myled(LED1); HCSR04 usensor(D8,D9); unsigned int dist; int main() { while(1) { usensor.start(); wait_ms(500); dist=usensor.get_dist_cm(); printf("\n\r cm:%ld",dist ); } }