diff --git a/examples/stm32f030f4p6_demo_board/adc/main.cpp b/examples/stm32f030f4p6_demo_board/adc/main.cpp new file mode 100644 index 0000000000..0a92f6e6d3 --- /dev/null +++ b/examples/stm32f030f4p6_demo_board/adc/main.cpp @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2020, Niklas Hauser + * + * This file is part of the modm project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +#include + +using namespace Board; + +int +main() +{ + Board::initialize(); + + Adc::initialize(); + const uint16_t Vref = Adc::readInternalVoltageReference(); + + while (true) + { + int16_t Temp = Adc::readTemperature(Vref); + LedOrange::set(Temp > 30); + modm::delay(1s); + } + + return 0; +} diff --git a/examples/stm32f030f4p6_demo_board/adc/openocd.cfg b/examples/stm32f030f4p6_demo_board/adc/openocd.cfg new file mode 100644 index 0000000000..b157e7e432 --- /dev/null +++ b/examples/stm32f030f4p6_demo_board/adc/openocd.cfg @@ -0,0 +1,2 @@ +# Replace this with your custom programmer +source [find interface/stlink-v2.cfg] diff --git a/examples/stm32f030f4p6_demo_board/adc/project.xml b/examples/stm32f030f4p6_demo_board/adc/project.xml new file mode 100644 index 0000000000..72f175d2e3 --- /dev/null +++ b/examples/stm32f030f4p6_demo_board/adc/project.xml @@ -0,0 +1,11 @@ + + modm:stm32f030_demo + + + + + + modm:build:scons + modm:platform:adc + +