Skip to content
Snippets Groups Projects
Commit 2dffac9d authored by Anders Blomdell's avatar Anders Blomdell
Browse files

Simple C example

parent 36b9204d
No related branches found
No related tags found
No related merge requests found
#include <moberg.h>
int main(int argc, char *argv)
{
struct moberg *moberg = moberg_new();
for (int i = 0 ; i < 500 ; i++) {
struct moberg_analog_in analog_in;
struct moberg_status status;
double value;
status = moberg_analog_in_open(moberg, i, &analog_in);
if (moberg_OK(status)) {
status = analog_in.read(analog_in.context, &value);
if (moberg_OK(status)) {
printf("%03d: %f\n", i, value);
}
}
status = moberg_analog_in_close(moberg, i, analog_in);
}
moberg_free(moberg);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment