Skip to content

Files

Latest commit

de96a1e · Jan 1, 2025

History

History
This branch is up to date with modm-io/modm:develop.

examples

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Dec 1, 2024
Nov 10, 2024
Dec 1, 2024
Jan 1, 2025
Jun 22, 2024
Jul 15, 2021
Jan 1, 2025
Jun 8, 2023
Aug 17, 2022
Jan 1, 2025
Dec 1, 2024
Sep 26, 2024
Apr 8, 2020
Dec 1, 2024
Feb 6, 2024
Jun 16, 2021
Dec 1, 2024
Mar 26, 2021
Dec 1, 2024
Oct 6, 2020
Dec 1, 2024
Dec 1, 2024
Dec 1, 2024
Dec 1, 2024
Dec 1, 2024
Dec 30, 2021
May 11, 2020
Dec 1, 2024
May 19, 2024
Dec 1, 2024
Mar 16, 2022
Mar 16, 2022
Dec 1, 2024
Dec 1, 2024
Jul 15, 2021
Jun 12, 2022
Oct 21, 2021
Apr 6, 2020
Dec 1, 2024
Dec 1, 2024
Dec 19, 2024
May 9, 2021
Jun 9, 2023
Nov 10, 2024
Apr 6, 2020
Dec 1, 2024
Sep 29, 2022
Sep 29, 2022
Sep 29, 2022
Mar 14, 2023
Jan 1, 2025
Sep 22, 2021
Dec 1, 2024
Sep 7, 2021
Dec 1, 2024
Jan 1, 2025
Dec 1, 2024
Jun 22, 2024
Jun 22, 2024
Dec 1, 2024
Dec 1, 2024
Jan 1, 2025
Jan 5, 2024
Dec 1, 2024
Dec 1, 2024
Dec 1, 2024
Dec 30, 2021
Jan 1, 2025
Apr 6, 2020
Apr 6, 2020
Aug 18, 2022
Oct 15, 2018
Feb 24, 2024
Mar 30, 2020

Explore the Examples

To get a quick feel about modm's APIs you can look at and experiment with our examples, especially if you have a development board that modm supports out-of-box.

Make sure you've installed all tools required for building modm and you've cloned the modm repository recursively:

git clone --recurse-submodules --jobs 8 https://github.com/modm-io/modm.git

TL;DR

Change directory into any of the examples and compile it:

# cd into any example you like
cd modm/examples/generic/blinky
# generate modm library (call only once)
lbuild build
# compile the example
scons -j8
# Connect your development board and upload the firmware
scons program

To debug with GDB in TUI mode. Make sure to change to the debug profile:

# compile and upload debug profile
scons program profile=debug
# launch OpenOCD and GDB for debugging
scons debug profile=debug

To generate your target specific Doxypress documentation:

(cd modm/docs && doxypress doxypress.json)
# open modm/docs/html/index.html

To remove it all:

# Remove build artifacts
scons -c
# Remove generated files
lbuild clean

Have a look at the build system documentation and the online documentation.

Interesting Examples

We have hundreds of examples but here are some of our favorite ones for our supported development boards:

Here are some additional examples of displays and sensors we like:

Copy Carefully

When copying from our examples make sure to set the repository path correctly! All example modm/examples/**/project.xml files are missing this path, since we set it in the inherited base modm/examples/lbuild.xml configuration. You must also add the modm:docs module manually if you want it.

The modm/examples/lbuild.xml file:

<library>
  <!-- This is the default lbuild configuration file for every
       example in this folder. It only defaults the common settings,
       so that this isn't duplicated in every single example.
       When you write your own application, you must set this
       path yourself! -->
  <repositories>
  	<repository><path>../repo.lb</path></repository>
  </repositories>
  <modules>
  	<module>modm:docs</module>
  </modules>
</library>