Skip to content

Commit ea9663c

Browse files
committed
[example] Add Nucleo-L552ZE-Q blink example
1 parent 690b598 commit ea9663c

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* Copyright (c) 2021, Raphael Lehmann
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+
11+
#include <modm/board.hpp>
12+
13+
using namespace Board;
14+
15+
// ----------------------------------------------------------------------------
16+
int
17+
main()
18+
{
19+
Board::initialize();
20+
21+
MODM_LOG_DEBUG << "debug" << modm::endl;
22+
MODM_LOG_INFO << "info" << modm::endl;
23+
MODM_LOG_WARNING << "warning" << modm::endl;
24+
MODM_LOG_ERROR << "error" << modm::endl;
25+
26+
uint32_t counter = 0;
27+
28+
while (true)
29+
{
30+
Leds::write(counter % (1 << 3));
31+
modm::delay(Button::read() ? 250ms : 500ms);
32+
MODM_LOG_INFO << "loop: " << counter << modm::endl;
33+
counter++;
34+
}
35+
36+
return 0;
37+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<library>
2+
<extends>modm:nucleo-l552ze-q</extends>
3+
<options>
4+
<option name="modm:build:build.path">../../../build/nucleo_l552ze-q/blink</option>
5+
</options>
6+
<modules>
7+
<module>modm:platform:gpio</module>
8+
<module>modm:build:scons</module>
9+
</modules>
10+
</library>

0 commit comments

Comments
 (0)