File tree Expand file tree Collapse file tree 3 files changed +43
-0
lines changed
examples/stm32f030f4p6_demo_board/adc Expand file tree Collapse file tree 3 files changed +43
-0
lines changed Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright (c) 2020, Niklas Hauser
3
+ *
4
+ * This file is part of the modm project.
5
+ *
6
+ * This Source Code Form is subject to the terms of the Mozilla Public
7
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
8
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9
+ */
10
+ #include < modm/board.hpp>
11
+
12
+ using namespace Board ;
13
+
14
+ int
15
+ main ()
16
+ {
17
+ Board::initialize ();
18
+
19
+ Adc::initialize<Board::SystemClock, Adc::ClockMode::Synchronous, 12_MHz>();
20
+ const uint16_t Vref = Adc::readInternalVoltageReference ();
21
+
22
+ while (true )
23
+ {
24
+ int16_t Temp = Adc::readTemperature (Vref);
25
+ LedOrange::set (Temp > 30 );
26
+ modm::delay (1s);
27
+ }
28
+
29
+ return 0 ;
30
+ }
Original file line number Diff line number Diff line change
1
+ # Replace this with your custom programmer
2
+ source [find interface/stlink-v2.cfg]
Original file line number Diff line number Diff line change
1
+ <library >
2
+ <extends >modm:stm32f030_demo</extends >
3
+ <options >
4
+ <option name =" modm:build:build.path" >../../../build/stm32f030f4p6_demo/adc</option >
5
+ <option name =" modm:build:openocd.cfg" >openocd.cfg</option >
6
+ </options >
7
+ <modules >
8
+ <module >modm:build:scons</module >
9
+ <module >modm:platform:adc</module >
10
+ </modules >
11
+ </library >
You can’t perform that action at this time.
0 commit comments