Skip to main content
3 of 6
deleted 13 characters in body
Juraj
  • 18.3k
  • 4
  • 32
  • 50

.ino is compiled as C++. your test is C code. put the C code in a .c file and the declaration in .h file and include the .h in .ino

I created a test.c, copied the content of your main.c into it and renamed the main function to test().

The I created a test.h with

#ifndef test_h
#define test_h

extern "C" void test();

#endif

and in ino setup() I call test();

it compiles. It runs.

Juraj
  • 18.3k
  • 4
  • 32
  • 50