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.
Diff: main.cpp
- Revision:
- 11:cfc9b8e963db
- Parent:
- 10:f459b443f676
- Child:
- 12:014d7359785d
--- a/main.cpp Sat Mar 13 17:37:03 2021 +0100
+++ b/main.cpp Sat Mar 13 17:37:49 2021 +0100
@@ -14,8 +14,7 @@
void button_rise();
/* input your stuff here */
-AnalogIn analogIn(PA_0);
-float dist = 0.0f;
+
int main()
{
@@ -30,12 +29,9 @@
/* ------------- start hacking ------------- -------------*/
if(executeMainTask) {
-
- dist = analogIn.read()*3.3f;
+
- /* do only output what's really necessary, outputting "Measured value in mV: "" within the loop is no good solution */
- printf("Measured value in mV: %d\r\n", (static_cast<int>(dist * 1e3)));
-
+
/* visual feedback that the main task is executed */
led = !led;