-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests/sys_arduino_lib: demo the use of Arduino library
This test application defines a packages which imports a very simple Arduino library that is used by test application to demonstrate how an Arduino library can be imported as package and used by an application.
- Loading branch information
Showing
8 changed files
with
78 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
PKG_NAME=talking_leds | ||
PKG_URL=https://github.com/fabriziop/TalkingLED | ||
PKG_VERSION=8ae4f2d0b736aa338f24e097dbaf876fbb385dbd | ||
PKG_LICENSE=MIT | ||
|
||
.PHONY: all | ||
|
||
all: | ||
"$(MAKE)" -C $(PKG_BUILDDIR)/src -f $(CURDIR)/Makefile.talking_leds | ||
|
||
include $(RIOTBASE)/pkg/pkg.mk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
USEMODULE += arduino |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
INCLUDES += -I$(PKGDIRBASE)/talking_leds/src | ||
|
||
CXXEXFLAGS += -std=c++11 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
MODULE = talking_leds | ||
|
||
include $(RIOTBASE)/Makefile.base |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/** | ||
* @defgroup pkg_talking_leds Talking LEDs - Arduino library for demonstration | ||
* @ingroup pkg | ||
* @brief Demonstrates the usage of Arduino libraries as packages | ||
* @see https://github.com/fabriziop/TalkingLED | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
include ../Makefile.tests_common | ||
|
||
USEPKG += talking_leds | ||
|
||
include $(RIOTBASE)/Makefile.include |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
BOARD_INSUFFICIENT_MEMORY := \ | ||
arduino-duemilanove \ | ||
arduino-leonardo \ | ||
arduino-nano \ | ||
arduino-uno \ | ||
nucleo-f031k6 \ | ||
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* Copyright (C) 2019 Gunar Schorcht | ||
* | ||
* This file is subject to the terms and conditions of the GNU Lesser | ||
* General Public License v2.1. See the file LICENSE in the top level | ||
* directory for more details. | ||
*/ | ||
|
||
/** | ||
* @ingroup tests | ||
* @{ | ||
* | ||
* @file | ||
* @brief Demonstrates the use of an Arduino library imported as package | ||
* | ||
* @author Gunar Schorcht <gunar@schorcht.net> | ||
* | ||
* @} | ||
*/ | ||
|
||
#include <stdint.h> | ||
#include <TalkingLED.h> | ||
|
||
#include "arduino_board.h" | ||
|
||
TalkingLED tled; | ||
|
||
int main(void) | ||
{ | ||
tled.begin(ARDUINO_LED); | ||
|
||
while (1) { | ||
/* message 2: short short */ | ||
tled.message(2); | ||
tled.waitEnd(); | ||
/* message 8: long long */ | ||
tled.message(8); | ||
tled.waitEnd(); | ||
} | ||
|
||
return 0; | ||
} |