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.
Dependencies: mbed ADS1115 StepperMotor SRF05 TPA81new
Revision 16:771d84a80e3d, committed 2019-01-21
- Comitter:
- hisyamfs
- Date:
- Mon Jan 21 12:17:55 2019 +0000
- Parent:
- 15:da7a15289893
- Child:
- 17:fd06e8104835
- Child:
- 22:d3be21d21297
- Commit message:
- tes ultrasonik
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Thu Jan 17 13:24:13 2019 +0000
+++ b/main.cpp Mon Jan 21 12:17:55 2019 +0000
@@ -1,10 +1,19 @@
#include "mbed.h"
#include "TPA81new.h"
+#include "SRF05.h"
+
+#define LCD_D4_DIG PA_15
+#define LCD_D5_DIG PA_14
+#define LCD_E_DIG PC_15
+#define LCD_RS_DIG PB_7
Serial pc(USBTX,USBRX);
TPA81 tpax(PB_9, PB_8, 0xDC);
TPA81 tpay(PB_3, PB_10, 0xDE);
+SRF05 srf1(PC_13, PA_14); // trigger, echo
+SRF05 srf2(PA_15, PB_7); // trigger, echo
+
int main()
{
//tpax.changeaddress(0xDC,0xDE);
@@ -24,7 +33,7 @@
}
pc.printf("\n");
-
+ pc.printf("us 1: %.2f\tus 2:%.2f\n", srf1.read(), srf2.read());
wait(0.5); // 200 ms