Skip to content

Commit

Permalink
[examples] Add Mini-F411 blink example
Browse files Browse the repository at this point in the history
  • Loading branch information
rleh committed Oct 9, 2019
1 parent 4da949b commit 438c6ec
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
36 changes: 36 additions & 0 deletions examples/stm32f411ceu_mini_f411/blink/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Copyright (c) 2016, Sascha Schade
* Copyright (c) 2017, 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 <modm/board.hpp>

using namespace Board;

/*
* Blinks the green user LED with 1 Hz.
* It is on for 90% of the time and off for 10% of the time.
*/

int
main()
{
Board::initialize();

LedGreen::set();

while (true)
{
LedGreen::toggle();
modm::delayMilliseconds(Button::read() ? 100 : 500);
}

return 0;
}
10 changes: 10 additions & 0 deletions examples/stm32f411ceu_mini_f411/blink/project.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<library>
<extends>modm:mini-f411</extends>
<options>
<option name="modm:build:build.path">../../../build/stm32f411ceu_mini_f411/blink</option>
<option name="modm:build:openocd.cfg">openocd.cfg</option>
</options>
<modules>
<module>modm:build:scons</module>
</modules>
</library>

0 comments on commit 438c6ec

Please sign in to comment.