Skip to content

OpenKNX_Stack

Mike edited this page May 2, 2023 · 1 revision

Use the OGM-Common Library

The Common Library does a lot for you.
It initializes the knx stack, reads memory and check if the stored Application is compatible to the one which it is expecting.
When you want to use it your main.cpp will look like this:

#include <Arduino.h>
#include "OpenKNX.h"   //Include the Common
#include "LogModule.h" //Include your own Module

void setup()
{
    //you can use firmwareRevision for changes where the 
    //KnxProd will be compatible with
	const uint8_t firmwareRevision = 0;
    openknx.init(firmwareRevision);
    //Add your own Module and give it an ID
    openknx.addModule(1, new LogModule());
    //set it up
    openknx.setup();
    //and thats all!
}

void loop()
{
    //let openknx do the magic in a loop
	openknx.loop();
}
Clone this wiki locally