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: HCSR04new SSH1106-alan
Diff: main.cpp
- Revision:
- 3:17acfeba3730
- Parent:
- 2:1baa0bd2fde0
--- a/main.cpp Mon Mar 08 02:43:03 2021 +0000
+++ b/main.cpp Mon Apr 19 10:10:35 2021 +0000
@@ -17,24 +17,26 @@
-Serial pc(USBTX, USBRX); //uart init
+//Serial pc(USBTX, USBRX); //uart init
DigitalOut led(LED1); //LED init
Thread init_start_thread;
-
+AnalogIn analog_value(A0);//adc
+//Ticker time_ticker;
int main()
{
//init start threads
//oled_Init()
-
-
-
+ float meas;
init_start_thread.start(init_thread);
-
+
while (true)
- {
- led = !led;
+ {
+ //led = !led;
+ meas = analog_value.read();
+ meas = meas * 3300;
+ printf("meas = %.0f mV \n",meas);
thread_sleep_for(BLINKING_RATE_MS);
}
}