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
main.cpp
- Committer:
- alanchip
- Date:
- 2021-04-19
- Revision:
- 3:17acfeba3730
- Parent:
- 2:1baa0bd2fde0
File content as of revision 3:17acfeba3730:
/* mbed Microcontroller Library * Copyright (c) 2019 ARM Limited * SPDX-License-Identifier: Apache-2.0 */ #include "mbed.h" #include "platform/mbed_thread.h" #include "HCSR04.h" #include "Thread_Handle.h" #include "main.h" #include "handleTasks.h" #include "rtc.h" #include "SSH1106.h" // Blinking rate in milliseconds #define BLINKING_RATE_MS 1000 //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; meas = analog_value.read(); meas = meas * 3300; printf("meas = %.0f mV \n",meas); thread_sleep_for(BLINKING_RATE_MS); } }