I'm following this question and am curious how I go about actually importing the following the necessary dependencies. I see this line:
#include "ev3sources/lms2012/c_com/source/c_com.h"
and have downloaded the entire lms2012
directory. Importing that into visual studio is proving more difficult than it would seem. I can add that single dependency by following the directions posted here by adding just the c_com
header and executable, but then I'm missing the dependencies upon which it rests. How can I add this entire directory as a dependency?
Thanks!
[Update]
Thanks David for your recommendation to add just the dependencies I need. Which would those be for the following? Adding c_com.h
then prompts me to add lms2012.h
and then dirent.h
and on and on. I just want the isolate the functionality below.
#include <unistd.h>
#include <fcntl.h>
#include "ev3sources/lms2012/c_com/source/c_com.h"
int main()
{
// start motor on port A at speed 20
unsigned const char start_motor[] {12, 0, 0, 0,
DIRECT_COMMAND_NO_REPLY,
0, 0,
opOUTPUT_POWER, LC0(0), LC0(0x01), LC0(20),
opOUTPUT_START, LC0(0), LC0(0x01)};
// send above command to EV3 via Bluetooth
int bt = open("/dev/tty.EV3-SerialPort", O_WRONLY);
write(bt, start_motor, 14);
close(bt);
}