From d3496a354c831ddef4b98e7f0afd9959ec950ea8 Mon Sep 17 00:00:00 2001 From: Erik Henriksson Date: Mon, 7 Sep 2020 17:10:08 +0200 Subject: [PATCH] [examples] Add Raspberry Pi GPIO example --- examples/rpi/blinky/main.cpp | 28 ++++++++++++++++++++++++++++ examples/rpi/blinky/project.xml | 9 +++++++++ 2 files changed, 37 insertions(+) create mode 100644 examples/rpi/blinky/main.cpp create mode 100644 examples/rpi/blinky/project.xml diff --git a/examples/rpi/blinky/main.cpp b/examples/rpi/blinky/main.cpp new file mode 100644 index 0000000000..3a8cf054ac --- /dev/null +++ b/examples/rpi/blinky/main.cpp @@ -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 +#include + +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; +} diff --git a/examples/rpi/blinky/project.xml b/examples/rpi/blinky/project.xml new file mode 100644 index 0000000000..c804feb469 --- /dev/null +++ b/examples/rpi/blinky/project.xml @@ -0,0 +1,9 @@ + + modm:raspberrypi + + + + + modm:build:scons + +