Skip to content

mbed-ce-libraries-examples/LibraryTemplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LibraryTemplate

Template for a new Library show just structure, basic Cmake configuration and requested informations (in Edit mode of this file) of new library

How to start

  1. Create a new project according to MbedCE instructions
  2. Add this as submodule to your project via git submodule add https://github.com/mbed-ce-libraries-examples/LibraryTemplate LibraryTemplate
  3. The top level CMakeLists.txt (in root of your project) should be modified according to this wiki page
  4. Create your main.cpp file and copy & paste example code below.
  5. Build the project

Example code

#include "mbed.h"
#include "LibraryTemplate.h"

LibraryTemplate lb(LED1);

int main()
{
    printf("MbedCE_LibraryTemplate\n");
	
    while(1) {
        lb.doSomething();
        thread_sleep_for(500);
    }
}

Description

Some text about this library...

Status:

This library was tested with Nucleo-F446RE, VS-Code under Win11, GCC 12.3 and MbedCE library

Important notes:

  • Any library should not contain ThisThread::sleep_for() because then is not possible to use the lib in the baremetal profile. So rather use thread_sleep_for()