Skip to content

library of c++ functions to record static variables in memory according a define trigger

License

Notifications You must be signed in to change notification settings

owntech-foundation/scopemimicry

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ScopeMimicry

ScopeMimicry Library allows to capture live data and variables.

image

Load library

Add the following to lib_deps in platformio.ini
scopemimicry = https://github.com/owntech-foundation/scopemimicry.git

Include the library

#include "ScopeMimicry.h"

ScopeMimicry Usage

Connecting Channels

Create your scope object

ScopeMimicry scope(sample_lenght, number_of_channels);
  • Sample lenght is the number of data points per channel.
  • Number of channel is the total number of channel acquired by the scope.

For example :

ScopeMimicry scope(512, 4);

Defines a scope with 4 channels and 512 data points per channel.

Channels are connected to variables using:

scope.connectChannel(variable, "channel_name");

For example:

scope.connectChannel(I1_low_value, "I1_low");

Make sure to connect as many channels as the number of channels set up in scope object.

Launching the acquisition

Acquisition can be launched using :

scope.acquire();

Setting Triggers and Delays

Instead of using scope.acquire(), it is possible to trigger the scope with a given logic condition.

To do that :

Define a trigger function. The trigger function shoud not have any arguments. It should return a bool value, that will trigger the scope when returning 1.

For example :

bool a_trigger()
    return (myVariable == 1)

Will trigger the scope when myVariable = 1

Once the trigger function created, set the trigger function

scope.set_trigger(&a_trigger);

A delay can be added to acquire a given amount of data before the trigger instant. delay should be a float between 0 and 1.

scope.set_delay(0.0F);

Starting the Scope

Start the scope to begin data acquisition:

scope.start();

About

library of c++ functions to record static variables in memory according a define trigger

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published