Skip to content

Commit

Permalink
[examples] Add Raspberry Pi GPIO example
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikssn authored and salkinium committed Sep 7, 2020
1 parent b0d84ba commit d3496a3
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
28 changes: 28 additions & 0 deletions examples/rpi/blinky/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* Copyright (c) 2020, Erik Henriksson
*
* 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/debug/logger.hpp>
#include <modm/board.hpp>

using namespace Board;

int main()
{
Board::initialize();
GpioPin<0>::setOutput();
MODM_LOG_INFO << "Blink blink...";

for (int i = 0; i < 10; ++i)
{
GpioPin<0>::toggle();
modm::delay(500ms);
}
return 0;
}
9 changes: 9 additions & 0 deletions examples/rpi/blinky/project.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<library>
<extends>modm:raspberrypi</extends>
<options>
<option name="modm:build:build.path">../../../build/rpi/blinky</option>
</options>
<modules>
<module>modm:build:scons</module>
</modules>
</library>

0 comments on commit d3496a3

Please sign in to comment.