4180

Dependencies:   X_NUCLEO_53L0A1 mbed

Fork of HelloWorld_VL53L0X_LPC1768 by jim hamblen

Files at this revision

API Documentation at this revision

Comitter:
mli396
Date:
Tue Oct 16 17:34:57 2018 +0000
Parent:
11:5186cc367be0
Commit message:
4180

Changed in this revision

X_NUCLEO_53L0A1.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 5186cc367be0 -r 6abbf8827c8b X_NUCLEO_53L0A1.lib
--- a/X_NUCLEO_53L0A1.lib	Thu Sep 07 00:01:45 2017 +0000
+++ b/X_NUCLEO_53L0A1.lib	Tue Oct 16 17:34:57 2018 +0000
@@ -1,1 +1,1 @@
-https://developer.mbed.org/teams/ST/code/X_NUCLEO_53L0A1/#27d3d95c8593
+https://developer.mbed.org/teams/ST/code/X_NUCLEO_53L0A1/#99c367e8a402
diff -r 5186cc367be0 -r 6abbf8827c8b main.cpp
--- a/main.cpp	Thu Sep 07 00:01:45 2017 +0000
+++ b/main.cpp	Tue Oct 16 17:34:57 2018 +0000
@@ -3,6 +3,7 @@
 #include <stdio.h>
 Serial pc(USBTX,USBRX);
 DigitalOut shdn(p26);
+PwmOut speaker(p21);
 // This VL53L0X board test application performs a range measurement in polling mode
 // Use 3.3(Vout) for Vin, p28 for SDA, p27 for SCL, P26 for shdn on mbed LPC1768
 
@@ -30,10 +31,13 @@
         status = board->init_board();
     }
     //loop taking and printing distance
+    float freq = 0;
+    speaker =0.1; //volume
     while (1) {
         status = board->sensor_centre->get_distance(&distance);
         if (status == VL53L0X_ERROR_NONE) {
-            pc.printf("D=%ld mm\r\n", distance);
+            freq = distance * 1.2;
+            speaker.period(1.0/freq); // period
         }
     }
 }
diff -r 5186cc367be0 -r 6abbf8827c8b mbed.bld
--- a/mbed.bld	Thu Sep 07 00:01:45 2017 +0000
+++ b/mbed.bld	Tue Oct 16 17:34:57 2018 +0000
@@ -1,1 +1,1 @@
-https://mbed.org/users/mbed_official/code/mbed/builds/e2bfab296f20
\ No newline at end of file
+https://os.mbed.com/users/mbed_official/code/mbed/builds/e95d10626187
\ No newline at end of file