#include "stdafx.h"
#include "iostream"
#include "roboard_dll.h"
#include <stdio>
#include <string>
#include <stdlib>
using namespace System;
using namespace std;
int main(array<System> ^args)
{
int channel = 0;
unsigned long usedchannel;
unsigned long period = 20000;
unsigned long duty = 1000;
unsigned long count = 300;
usedchannel = RCSERVO_USECHANNEL0 + RCSERVO_USECHANNEL1 + RCSERVO_USECHANNEL2 + RCSERVO_USECHANNEL3 + RCSERVO_USECHANNEL4 + RCSERVO_USECHANNEL5 + RCSERVO_USECHANNEL6 + RCSERVO_USECHANNEL7 + RCSERVO_USECHANNEL8 + RCSERVO_USECHANNEL9 + RCSERVO_USECHANNEL10 + RCSERVO_USECHANNEL11 + RCSERVO_USECHANNEL12 + RCSERVO_USECHANNEL13 + RCSERVO_USECHANNEL14 + RCSERVO_USECHANNEL15;
roboio_SetRBVer(110);
// Initialize PWM interface
if (rcservo_Initialize(usedchannel) == false)
{
printf("ERR: fail to initialize RCSERVO (%s)!\n", roboio_GetErrMsg());
return 1;
}
rcservo_EnterPWMMode();
rcservo_SendPWMPulses(channel, period, duty, count);
printf("Start to send %ld PWM pluses with period %ld us\n"
"and duty %ld us on PWM channel %d.\n\n", count, period, duty, channel);
while(rcservo_IsPWMCompleted(channel) == false);
printf("Send %ld PWM pulses completed.\n", count);
rcservo_Close();
return 0;
}
snest wrote:However, I get the error message "I/O library fails to initialize!"
snest wrote:What is the purpose of WinIO.dll and WinIO.sys? Are those there to help the executable access the RoBoIO.dll file?
Also, are RoBoIO.dll, WinIO.dll and WinIO.sys the only files I need to include with my executable to get full functionality of the RoBoIO library?